From 222709bc15ace77ebf03e5a8e17e0bf026520970 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 24 Oct 2021 17:45:09 -0700 Subject: Many version bumps --- .../allanwang/kau/kpref/activity/KPrefActivity.kt | 14 ++++---- .../ca/allanwang/kau/kpref/activity/KPrefBinder.kt | 42 ++++++++++++++-------- .../kau/kpref/activity/items/KPrefItemCore.kt | 4 ++- .../kau/kpref/activity/items/KPrefTimePicker.kt | 3 +- 4 files changed, 40 insertions(+), 23 deletions(-) (limited to 'kpref-activity/src') diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt index 70b40e7..15bb008 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt @@ -31,10 +31,10 @@ import ca.allanwang.kau.ui.views.RippleCanvas import ca.allanwang.kau.utils.* import com.mikepenz.fastadapter.adapters.FastItemAdapter import com.mikepenz.fastadapter.select.getSelectExtension -import java.util.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import java.util.* abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { @@ -52,14 +52,14 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { private val recyclerAnimatorNext: KauAnimator by lazyUi { KauAnimator( - SlideAnimatorAdd(KAU_RIGHT, itemDelayFactor = 0f), - SlideAnimatorRemove(KAU_LEFT, itemDelayFactor = 0f) + SlideAnimatorAdd(KAU_RIGHT, itemDelayFactor = 0f), + SlideAnimatorRemove(KAU_LEFT, itemDelayFactor = 0f) ) } private val recyclerAnimatorPrev: KauAnimator by lazyUi { KauAnimator( - SlideAnimatorAdd(KAU_LEFT, itemDelayFactor = 0f), - SlideAnimatorRemove(KAU_RIGHT, itemDelayFactor = 0f) + SlideAnimatorAdd(KAU_LEFT, itemDelayFactor = 0f), + SlideAnimatorRemove(KAU_RIGHT, itemDelayFactor = 0f) ) } @@ -94,7 +94,7 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { insets } window.decorView.systemUiVisibility = - View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN statusBarColor = 0x30000000 kauToolbarRipple.set(resolveColor(R.attr.colorPrimary)) kauRipple.set(resolveColor(android.R.attr.colorBackground)) @@ -115,7 +115,7 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { } override fun showNextPrefs(@StringRes toolbarTitleRes: Int, builder: KPrefAdapterBuilder.() -> Unit) = - binding.showNextPrefs(toolbarTitleRes, builder, false) + binding.showNextPrefs(toolbarTitleRes, builder, false) private fun KauPrefActivityBinding.showNextPrefs( @StringRes toolbarTitleRes: Int, diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt index 764831e..f349c33 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt @@ -86,8 +86,10 @@ class KPrefAdapterBuilder(val globalOptions: GlobalOptions) { setter: KPrefItemActions.(value: Boolean) -> Unit, builder: KPrefItemBase.BaseContract.() -> Unit = {} ) = list.add( - KPrefCheckbox(KPrefItemBase.BaseBuilder(globalOptions, title, getter, setter) - .apply { builder() }) + KPrefCheckbox( + KPrefItemBase.BaseBuilder(globalOptions, title, getter, setter) + .apply { builder() } + ) ) @KPrefMarker @@ -97,8 +99,10 @@ class KPrefAdapterBuilder(val globalOptions: GlobalOptions) { setter: KPrefItemActions.(value: Int) -> Unit, builder: KPrefColorPicker.KPrefColorContract.() -> Unit = {} ) = list.add( - KPrefColorPicker(KPrefColorPicker.KPrefColorBuilder(globalOptions, title, getter, setter) - .apply { builder() }) + KPrefColorPicker( + KPrefColorPicker.KPrefColorBuilder(globalOptions, title, getter, setter) + .apply { builder() } + ) ) @KPrefMarker @@ -108,8 +112,10 @@ class KPrefAdapterBuilder(val globalOptions: GlobalOptions) { setter: KPrefItemActions.(value: T) -> Unit, builder: KPrefText.KPrefTextContract.() -> Unit = {} ) = list.add( - KPrefText(KPrefText.KPrefTextBuilder(globalOptions, title, getter, setter) - .apply { builder() }) + KPrefText( + KPrefText.KPrefTextBuilder(globalOptions, title, getter, setter) + .apply { builder() } + ) ) @KPrefMarker @@ -118,8 +124,10 @@ class KPrefAdapterBuilder(val globalOptions: GlobalOptions) { itemBuilder: KPrefAdapterBuilder.() -> Unit, builder: KPrefSubItems.KPrefSubItemsContract.() -> Unit ) = list.add( - KPrefSubItems(KPrefSubItems.KPrefSubItemsBuilder(globalOptions, title, itemBuilder) - .apply { builder() }) + KPrefSubItems( + KPrefSubItems.KPrefSubItemsBuilder(globalOptions, title, itemBuilder) + .apply { builder() } + ) ) @KPrefMarker @@ -127,8 +135,10 @@ class KPrefAdapterBuilder(val globalOptions: GlobalOptions) { @StringRes title: Int, builder: KPrefItemBase.BaseContract.() -> Unit = {} ) = list.add( - KPrefPlainText(KPrefPlainText.KPrefPlainTextBuilder(globalOptions, title) - .apply { builder() }) + KPrefPlainText( + KPrefPlainText.KPrefPlainTextBuilder(globalOptions, title) + .apply { builder() } + ) ) @KPrefMarker @@ -138,8 +148,10 @@ class KPrefAdapterBuilder(val globalOptions: GlobalOptions) { setter: KPrefItemActions.(value: Int) -> Unit, builder: KPrefSeekbar.KPrefSeekbarContract.() -> Unit = {} ) = list.add( - KPrefSeekbar(KPrefSeekbar.KPrefSeekbarBuilder(globalOptions, title, getter, setter) - .apply { builder() }) + KPrefSeekbar( + KPrefSeekbar.KPrefSeekbarBuilder(globalOptions, title, getter, setter) + .apply { builder() } + ) ) @KPrefMarker @@ -149,8 +161,10 @@ class KPrefAdapterBuilder(val globalOptions: GlobalOptions) { setter: KPrefItemActions.(value: Int) -> Unit, builder: KPrefTimePicker.KPrefTimeContract.() -> Unit = {} ) = list.add( - KPrefTimePicker(KPrefTimePicker.KPrefTimeBuilder(globalOptions, title, getter, setter) - .apply { builder() }) + KPrefTimePicker( + KPrefTimePicker.KPrefTimeBuilder(globalOptions, title, getter, setter) + .apply { builder() } + ) ) @KPrefMarker diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt index 0aaa2d3..8e1d9db 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt @@ -48,7 +48,9 @@ import com.mikepenz.iconics.typeface.IIcon * Core class containing nothing but the view items */ -abstract class KPrefItemCore(val core: CoreContract) : AbstractItem(), KPrefItemActions by core, +abstract class KPrefItemCore(val core: CoreContract) : + AbstractItem(), + KPrefItemActions by core, ThemableIItem by ThemableIItemDelegate() { final override fun getViewHolder(v: View) = ViewHolder(v) diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefTimePicker.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefTimePicker.kt index 318b630..1270d78 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefTimePicker.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefTimePicker.kt @@ -33,7 +33,8 @@ import java.util.Locale */ open class KPrefTimePicker(override val builder: KPrefTimeContract) : KPrefText(builder) { - interface KPrefTimeContract : KPrefText.KPrefTextContract, + interface KPrefTimeContract : + KPrefText.KPrefTextContract, TimePickerDialog.OnTimeSetListener { var use24HourFormat: Boolean } -- cgit v1.2.3