From fbbea20e78f196ffccda5a3a844a265772c68ea4 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 16 Jun 2017 20:13:55 -0700 Subject: Completely remap kpref binders --- .../kotlin/ca/allanwang/kau/changelog/Changelog.kt | 2 +- .../kau/dialogs/color/ColorPickerDialog.kt | 92 ++++++++++++---------- .../allanwang/kau/dialogs/color/ColorPickerView.kt | 16 +++- .../kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt | 50 ++++++++---- .../ca/allanwang/kau/kpref/items/KPrefCheckbox.kt | 8 +- .../allanwang/kau/kpref/items/KPrefColorPicker.kt | 52 +++++++----- .../ca/allanwang/kau/kpref/items/KPrefHeader.kt | 5 +- .../ca/allanwang/kau/kpref/items/KPrefItemBase.kt | 49 ++++++------ .../ca/allanwang/kau/kpref/items/KPrefItemCore.kt | 39 ++++----- .../ca/allanwang/kau/kpref/items/KPrefText.kt | 18 +++-- .../kotlin/ca/allanwang/kau/utils/ContextUtils.kt | 2 +- 11 files changed, 198 insertions(+), 135 deletions(-) (limited to 'library/src/main/kotlin/ca/allanwang') diff --git a/library/src/main/kotlin/ca/allanwang/kau/changelog/Changelog.kt b/library/src/main/kotlin/ca/allanwang/kau/changelog/Changelog.kt index 7f71195..1af03e1 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/changelog/Changelog.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/changelog/Changelog.kt @@ -53,7 +53,7 @@ internal fun parse(context: Context, @XmlRes xmlRes: Int): List Unit)> = mutableListOf() - var colorsTop: IntArray? = null - internal fun colorsTop(): IntArray = - if (colorsTop != null) colorsTop!! - else if (isAccent) ColorPalette.ACCENT_COLORS - else ColorPalette.PRIMARY_COLORS - - var colorsSub: Array? = null - internal fun colorsSub(): Array? = - if (colorsTop != null) colorsSub - else if (isAccent) ColorPalette.ACCENT_COLORS_SUB - else ColorPalette.PRIMARY_COLORS_SUB - - var theme: Theme? = null + override var dynamicButtonColors: Boolean = true + override var circleSizeRes: Int = R.dimen.kau_color_circle_size + override var colorCallback: ((selectedColor: Int) -> Unit)? = null + override var colorsTop: IntArray? = null + override var colorsSub: Array? = null + override var theme: Theme? = null +} - fun applyNestedBuilder(action: Builder.() -> Unit) = this.action() +interface ColorContract { + var title: String? + var titleRes: Int + var allowCustom: Boolean + var allowCustomAlpha: Boolean + var isAccent: Boolean + var defaultColor: Int + var doneText: Int + var backText: Int + var cancelText: Int + var presetText: Int + var customText: Int + var dynamicButtonColors: Boolean + var circleSizeRes: Int + var colorCallback: ((selectedColor: Int) -> Unit)? + var colorsTop: IntArray? + var colorsSub: Array? + var theme: Theme? } /** * This is the extension that allows us to initialize the dialog * Note that this returns just the dialog; you still need to call .show() to show it */ -fun Context.colorPickerDialog(action: Builder.() -> Unit): MaterialDialog { - val b = Builder() +fun Context.colorPickerDialog(action: ColorContract.() -> Unit): MaterialDialog { + val b = ColorBuilder() b.action() + return colorPickerDialog(b) +} + +fun Context.colorPickerDialog(contract: ColorContract): MaterialDialog { val view = ColorPickerView(this) val dialog = with(MaterialDialog.Builder(this)) { - title(string(b.titleRes, b.title) ?: string(R.string.kau_md_color_palette)) + title(string(contract.titleRes, contract.title) ?: string(R.string.kau_md_color_palette)) customView(view, false) autoDismiss(false) - positiveText(b.doneText) - negativeText(b.cancelText) - if (b.allowCustom) neutralText(b.presetText) - onPositive { dialog, _ -> b.colorCallbacks.forEach { it.invoke(view.selectedColor) }; dialog.dismiss() } + positiveText(contract.doneText) + negativeText(contract.cancelText) + if (contract.allowCustom) neutralText(contract.presetText) + onPositive { dialog, _ -> contract.colorCallback?.invoke(view.selectedColor); dialog.dismiss() } onNegative { dialog, _ -> view.backOrCancel() } - if (b.allowCustom) onNeutral { dialog, _ -> view.toggleCustom() } + if (contract.allowCustom) onNeutral { dialog, _ -> view.toggleCustom() } showListener { view.refreshColors() } - if (b.theme != null) theme(b.theme!!) + if (contract.theme != null) theme(contract.theme!!) build() } - view.bind(b, dialog) + view.bind(contract, dialog) return dialog } \ No newline at end of file diff --git a/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/ColorPickerView.kt b/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/ColorPickerView.kt index 8c26645..2643d27 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/ColorPickerView.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/ColorPickerView.kt @@ -34,7 +34,7 @@ internal class ColorPickerView @JvmOverloads constructor( if (context.resolveColor(android.R.attr.textColorPrimary).isColorDark()) Color.WHITE else 0xff424242.toInt()) val backgroundColorTint = backgroundColor.colorToForeground(0.2f) lateinit var dialog: MaterialDialog - lateinit var builder: Builder + lateinit var builder: ColorContract lateinit var colorsTop: IntArray var colorsSub: Array? = null var topIndex: Int = -1 @@ -75,11 +75,19 @@ internal class ColorPickerView @JvmOverloads constructor( View.inflate(context, R.layout.md_dialog_colorchooser, this) } - fun bind(builder: Builder, dialog: MaterialDialog) { + fun bind(builder: ColorContract, dialog: MaterialDialog) { this.builder = builder this.dialog = dialog - this.colorsTop = builder.colorsTop() - this.colorsSub = builder.colorsSub() + this.colorsTop = with(builder) { + if (colorsTop != null) colorsTop!! + else if (isAccent) ColorPalette.ACCENT_COLORS + else ColorPalette.PRIMARY_COLORS + } + this.colorsSub = with(builder) { + if (colorsTop != null) colorsSub + else if (isAccent) ColorPalette.ACCENT_COLORS_SUB + else ColorPalette.PRIMARY_COLORS_SUB + } this.selectedColor = builder.defaultColor if (builder.allowCustom) { if (!builder.allowCustomAlpha) { diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt index 3e33abf..eec1e02 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt @@ -4,7 +4,6 @@ import android.support.annotation.StringRes import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView import ca.allanwang.kau.R -import ca.allanwang.kau.dialogs.color.Builder import ca.allanwang.kau.kpref.items.* import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter @@ -27,25 +26,48 @@ class KPrefAdapterBuilder { var textColor: (() -> Int)? = null var accentColor: (() -> Int)? = null - fun header(@StringRes title: Int) = list.add(KPrefHeader(this, title)) + fun header(@StringRes title: Int) + = list.add(KPrefHeader(this, KPrefItemCore.CoreBuilder() + .apply { + titleRes = title + })) fun checkbox(@StringRes title: Int, - coreBuilder: KPrefItemCore.Builder.() -> Unit = {}, - itemBuilder: KPrefItemBase.Builder.() -> Unit = {} - ) = list.add(KPrefCheckbox(this, title, coreBuilder, itemBuilder)) + getter: (() -> Boolean), + setter: ((value: Boolean) -> Unit), + builder: KPrefItemBase.BaseContract.() -> Unit = {}) + = list.add(KPrefCheckbox(this, KPrefItemBase.BaseBuilder() + .apply { + this.titleRes = title + this.getter = getter + this.setter = setter + builder() + })) + fun colorPicker(@StringRes title: Int, - coreBuilder: KPrefItemCore.Builder.() -> Unit = {}, - itemBuilder: KPrefItemBase.Builder.() -> Unit = {}, - colorBuilder: Builder.() -> Unit = {}, - showPreview: Boolean = true - ) = list.add(KPrefColorPicker(this, title, coreBuilder, itemBuilder, colorBuilder, showPreview)) + getter: (() -> Int), + setter: ((value: Int) -> Unit), + builder: KPrefColorPicker.KPrefColorContract.() -> Unit = {}) + = list.add(KPrefColorPicker(this, KPrefColorPicker.KPrefColorBuilder() + .apply { + this.titleRes = title + this.getter = getter + this.setter = setter + builder() + })) fun text(@StringRes title: Int, - coreBuilder: KPrefItemCore.Builder.() -> Unit = {}, - itemBuilder: KPrefItemBase.Builder.() -> Unit = {}, - textGetter: (T) -> String? = { it?.toString() } - ) = list.add(KPrefText(this, title, coreBuilder, itemBuilder, textGetter)) + getter: (() -> T), + setter: ((value: T) -> Unit), + builder: KPrefText.KPrefTextContract.() -> Unit = {}) + = list.add(KPrefText(this, title, KPrefText.KPrefTextBuilder() + .apply { + this.titleRes = title + this.getter = getter + this.setter = setter + builder() + })) internal val list: MutableList = mutableListOf() diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefCheckbox.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefCheckbox.kt index cc09a33..e4b80a1 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefCheckbox.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefCheckbox.kt @@ -13,11 +13,9 @@ import ca.allanwang.kau.utils.tint * Checkbox preference * When clicked, will toggle the preference and the apply the result to the checkbox */ -class KPrefCheckbox(builder: KPrefAdapterBuilder, - @StringRes title: Int, - coreBuilder: KPrefItemCore.Builder.() -> Unit = {}, - itemBuilder: Builder.() -> Unit = {} -) : KPrefItemBase(builder, title, coreBuilder, itemBuilder) { +class KPrefCheckbox(adapterBuilder: KPrefAdapterBuilder, + builder: BaseContract +) : KPrefItemBase(adapterBuilder, builder) { override fun defaultOnClick(itemView: View, innerContent: View?): Boolean { pref = !pref diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefColorPicker.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefColorPicker.kt index 3d1ad21..7877b52 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefColorPicker.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefColorPicker.kt @@ -1,9 +1,10 @@ package ca.allanwang.kau.kpref.items -import android.support.annotation.StringRes import android.view.View import ca.allanwang.kau.R import ca.allanwang.kau.dialogs.color.CircleView +import ca.allanwang.kau.dialogs.color.ColorBuilder +import ca.allanwang.kau.dialogs.color.ColorContract import ca.allanwang.kau.dialogs.color.colorPickerDialog import ca.allanwang.kau.kpref.KPrefAdapterBuilder @@ -13,39 +14,50 @@ import ca.allanwang.kau.kpref.KPrefAdapterBuilder * ColorPicker preference * When a color is successfully selected in the dialog, it will be saved as an int */ -class KPrefColorPicker(builder: KPrefAdapterBuilder, - @StringRes title: Int, - coreBuilder: KPrefItemCore.Builder.() -> Unit = {}, - itemBuilder: KPrefItemBase.Builder.() -> Unit = {}, - val colorBuilder: ca.allanwang.kau.dialogs.color.Builder.() -> Unit = {}, - val showPreview: Boolean = false -) : KPrefItemBase(builder, title, coreBuilder, itemBuilder) { +class KPrefColorPicker(adapterBuilder: KPrefAdapterBuilder, + val builder: KPrefColorContract +) : KPrefItemBase(adapterBuilder, builder) { override fun onPostBindView(viewHolder: ViewHolder, textColor: Int?, accentColor: Int?) { super.onPostBindView(viewHolder, textColor, accentColor) - //TODO add color circle view - if (showPreview) { + builder.apply { + titleRes = core.titleRes + colorCallback = { + pref = it + } + } + if (builder.showPreview) { val preview = viewHolder.bindInnerView(R.layout.kau_preference_color_preview) preview.setBackgroundColor(pref) preview.withBorder = true + builder.apply { + colorCallback = { + pref = it + if (builder.showPreview) + preview.setBackgroundColor(it) + } + } } } override fun defaultOnClick(itemView: View, innerContent: View?): Boolean { - itemView.context.colorPickerDialog { - titleRes = this@KPrefColorPicker.title - defaultColor = pref - colorCallbacks.add { - pref = it - if (showPreview) - (innerContent as CircleView).setBackgroundColor(it) - } - applyNestedBuilder(colorBuilder) - }.show() + builder.apply { + defaultColor = pref //update color + } + itemView.context.colorPickerDialog(builder).show() return true } + class KPrefColorBuilder : KPrefColorContract, BaseContract by BaseBuilder(), ColorContract by ColorBuilder() { + override var showPreview: Boolean = true + override var titleRes: Int = -1 + } + + interface KPrefColorContract : BaseContract, ColorContract { + var showPreview: Boolean + } + override fun getType(): Int = R.id.kau_item_pref_color_picker } \ No newline at end of file diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt index 94ef745..7abb631 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt @@ -1,6 +1,5 @@ package ca.allanwang.kau.kpref.items -import android.support.annotation.StringRes import android.view.View import ca.allanwang.kau.R import ca.allanwang.kau.kpref.KPrefAdapterBuilder @@ -9,9 +8,9 @@ import ca.allanwang.kau.kpref.KPrefAdapterBuilder * Created by Allan Wang on 2017-06-07. * * Header preference - * This view just holds a title and is not clickable. It is styled using the accent color + * This view just holds a titleRes and is not clickable. It is styled using the accent color */ -class KPrefHeader(builder: KPrefAdapterBuilder, @StringRes title: Int) : KPrefItemCore(builder, title = title) { +class KPrefHeader(adapterBuilder: KPrefAdapterBuilder, builder: CoreContract) : KPrefItemCore(adapterBuilder, builder) { override fun getLayoutRes(): Int = R.layout.kau_preference_header diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemBase.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemBase.kt index 3300f37..1b04e76 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemBase.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemBase.kt @@ -1,7 +1,6 @@ package ca.allanwang.kau.kpref.items import android.support.annotation.CallSuper -import android.support.annotation.StringRes import android.view.View import ca.allanwang.kau.R import ca.allanwang.kau.kpref.KPrefAdapterBuilder @@ -15,24 +14,19 @@ import ca.allanwang.kau.utils.string * Base class for pref setters that include the Shared Preference hooks */ -abstract class KPrefItemBase(builder: KPrefAdapterBuilder, - @StringRes title: Int, - coreBuilder: KPrefItemCore.Builder.() -> Unit = {}, - itemBuilder: Builder.() -> Unit = {}) : KPrefItemCore(builder, title, coreBuilder) { +abstract class KPrefItemBase(adapterBuilder: KPrefAdapterBuilder, val base: BaseContract +) : KPrefItemCore(adapterBuilder, base) { var pref: T - get() = itemBase.getter!!.invoke() + get() = base.getter!!.invoke() set(value) { - itemBase.setter!!.invoke(value) + base.setter!!.invoke(value) } var enabled: Boolean = true - val itemBase: Builder init { - itemBase = Builder() - itemBase.itemBuilder() - if (itemBase.onClick == null) itemBase.onClick = { + if (base.onClick == null) base.onClick = { itemView, innerContent, _ -> defaultOnClick(itemView, innerContent) } @@ -43,9 +37,9 @@ abstract class KPrefItemBase(builder: KPrefAdapterBuilder, @CallSuper override fun onPostBindView(viewHolder: ViewHolder, textColor: Int?, accentColor: Int?) { val c = viewHolder.itemView.context - if (itemBase.getter == null) throw KPrefException("getter not set for ${c.string(title)}") - if (itemBase.setter == null) throw KPrefException("setter not set for ${c.string(title)}") - enabled = itemBase.enabler.invoke() + if (base.getter == null) throw KPrefException("getter not set for ${c.string(core.titleRes)}") + if (base.setter == null) throw KPrefException("setter not set for ${c.string(core.titleRes)}") + enabled = base.enabler.invoke() with(viewHolder) { if (!enabled) container?.background = null container?.alpha = if (enabled) 1.0f else 0.3f @@ -53,8 +47,8 @@ abstract class KPrefItemBase(builder: KPrefAdapterBuilder, } override final fun onClick(itemView: View, innerContent: View?): Boolean { - return if (enabled) itemBase.onClick?.invoke(itemView, innerContent, this) ?: false - else itemBase.onDisabledClick?.invoke(itemView, innerContent, this) ?: false + return if (enabled) base.onClick?.invoke(itemView, innerContent, this) ?: false + else base.onDisabledClick?.invoke(itemView, innerContent, this) ?: false } override fun unbindView(holder: ViewHolder) { @@ -68,11 +62,22 @@ abstract class KPrefItemBase(builder: KPrefAdapterBuilder, override final fun getLayoutRes(): Int = R.layout.kau_preference - open class Builder { - var enabler: () -> Boolean = { true } - var onClick: ((itemView: View, innerContent: View?, item: KPrefItemBase) -> Boolean)? = null - var onDisabledClick: ((itemView: View, innerContent: View?, item: KPrefItemBase) -> Boolean)? = null - var getter: (() -> T)? = null - var setter: ((value: T) -> Unit)? = null + open class BaseBuilder : CoreBuilder(), BaseContract { + override var enabler: () -> Boolean = { true } + override var onClick: ((itemView: View, innerContent: View?, item: KPrefItemBase) -> Boolean)? = null + override var onDisabledClick: ((itemView: View, innerContent: View?, item: KPrefItemBase) -> Boolean)? = null + override var getter: (() -> T)? = null + override var setter: ((value: T) -> Unit)? = null + } + + /** + * Mandatory values: [getter], [setter] + */ + interface BaseContract : CoreContract { + var enabler: () -> Boolean + var onClick: ((itemView: View, innerContent: View?, item: KPrefItemBase) -> Boolean)? + var onDisabledClick: ((itemView: View, innerContent: View?, item: KPrefItemBase) -> Boolean)? + var getter: (() -> T)? + var setter: ((value: T) -> Unit)? } } \ No newline at end of file diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemCore.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemCore.kt index b5741b0..adcf005 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemCore.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefItemCore.kt @@ -3,7 +3,6 @@ package ca.allanwang.kau.kpref.items import android.support.annotation.CallSuper import android.support.annotation.IdRes import android.support.annotation.LayoutRes -import android.support.annotation.StringRes import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View @@ -25,38 +24,30 @@ import com.mikepenz.iconics.typeface.IIcon * Core class containing nothing but the view items */ -abstract class KPrefItemCore(val builder: KPrefAdapterBuilder, - @StringRes val title: Int, - coreBuilder: Builder.() -> Unit = {}) : AbstractItem() { +abstract class KPrefItemCore(val adapterBuilder: KPrefAdapterBuilder, + val core: CoreContract) : AbstractItem() { override final fun getViewHolder(v: View) = ViewHolder(v) - val core: Builder - - init { - core = Builder() - core.coreBuilder() - } - @CallSuper override fun bindView(viewHolder: ViewHolder, payloads: List) { super.bindView(viewHolder, payloads) with(viewHolder) { val context = itemView.context - title.text = context.string(this@KPrefItemCore.title) - if (core.description > 0) - desc?.visible()?.setText(core.description) + title.text = context.string(core.titleRes) + if (core.descRes > 0) + desc?.visible()?.setText(core.descRes) else desc?.gone() if (core.iicon != null) icon?.visible()?.setIcon(core.iicon, 24) else icon?.gone() innerFrame?.removeAllViews() - val textColor = builder.textColor?.invoke() + val textColor = adapterBuilder.textColor?.invoke() if (textColor != null) { title.setTextColor(textColor) desc?.setTextColor(textColor) } - val accentColor = builder.accentColor?.invoke() + val accentColor = adapterBuilder.accentColor?.invoke() if (accentColor != null) { icon?.drawable?.setTint(accentColor) } @@ -78,9 +69,19 @@ abstract class KPrefItemCore(val builder: KPrefAdapterBuilder, } } - class Builder { - var description: Int = -1 - var iicon: IIcon? = null + open class CoreBuilder : CoreContract { + override var titleRes: Int = -1 + override var descRes: Int = -1 + override var iicon: IIcon? = null + } + + /** + * Mandatory values: [titleRes] + */ + interface CoreContract { + var titleRes: Int + var descRes: Int + var iicon: IIcon? } class ViewHolder(v: View) : RecyclerView.ViewHolder(v) { diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefText.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefText.kt index 52e9614..b7091a6 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefText.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefText.kt @@ -15,12 +15,10 @@ import ca.allanwang.kau.utils.toast * This is still a generic preference * */ -class KPrefText(builder: KPrefAdapterBuilder, +class KPrefText(adapterBuilder: KPrefAdapterBuilder, @StringRes title: Int, - coreBuilder: KPrefItemCore.Builder.() -> Unit = {}, - itemBuilder: Builder.() -> Unit = {}, - val textGetter: (T) -> String? = { it?.toString() } -) : KPrefItemBase(builder, title, coreBuilder, itemBuilder) { + val builder: KPrefTextContract +) : KPrefItemBase(adapterBuilder, title, builder) { override fun defaultOnClick(itemView: View, innerContent: View?): Boolean { itemView.context.toast("No click function set") @@ -31,7 +29,15 @@ class KPrefText(builder: KPrefAdapterBuilder, super.onPostBindView(viewHolder, textColor, accentColor) val textview = viewHolder.bindInnerView(R.layout.kau_preference_text) if (textColor != null) textview.setTextColor(textColor) - textview.text = textGetter.invoke(pref) + textview.text = builder.textGetter.invoke(pref) + } + + class KPrefTextBuilder : KPrefTextContract, BaseContract by BaseBuilder() { + override var textGetter: (T) -> String? = { it?.toString() } + } + + interface KPrefTextContract : BaseContract { + var textGetter: (T) -> String? } override fun getType(): Int = R.id.kau_item_pref_checkbox diff --git a/library/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt b/library/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt index 77238f1..cc72921 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt @@ -141,7 +141,7 @@ fun Context.showChangelog(@XmlRes xmlRes: Int, customize: MaterialDialog.Builder } /** - * Wrapper function for the MaterialDialog builder + * Wrapper function for the MaterialDialog adapterBuilder * There is no need to call build() or show() as those are done by default */ fun Context.materialDialog(action: MaterialDialog.Builder.() -> Unit): MaterialDialog { -- cgit v1.2.3