aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-12-31 11:25:29 -0800
committerAllan Wang <me@allanwang.ca>2019-12-31 11:25:29 -0800
commit5388aabf0b581a69405125ec0cdaf05ae2455133 (patch)
tree17e2d344469b4cb7af5750880630ff7da31a32b4 /kpref-activity/src/main
parent91da44158d9aab832317a16fc0e63f48f3e5e940 (diff)
downloadkau-5388aabf0b581a69405125ec0cdaf05ae2455133.tar.gz
kau-5388aabf0b581a69405125ec0cdaf05ae2455133.tar.bz2
kau-5388aabf0b581a69405125ec0cdaf05ae2455133.zip
Add lazy ui
Diffstat (limited to 'kpref-activity/src/main')
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt5
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt3
2 files changed, 5 insertions, 3 deletions
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 90827d3..818a770 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
@@ -24,6 +24,7 @@ import ca.allanwang.kau.animators.KauAnimator
import ca.allanwang.kau.animators.SlideAnimatorAdd
import ca.allanwang.kau.animators.SlideAnimatorRemove
import ca.allanwang.kau.internal.KauBaseActivity
+import ca.allanwang.kau.kotlin.lazyUi
import ca.allanwang.kau.kpref.activity.items.KPrefItemCore
import ca.allanwang.kau.ui.views.RippleCanvas
import ca.allanwang.kau.utils.KAU_LEFT
@@ -53,13 +54,13 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract {
*/
var animate: Boolean = true
- private val recyclerAnimatorNext: KauAnimator by lazy {
+ private val recyclerAnimatorNext: KauAnimator by lazyUi {
KauAnimator(
SlideAnimatorAdd(KAU_RIGHT, itemDelayFactor = 0f),
SlideAnimatorRemove(KAU_LEFT, itemDelayFactor = 0f)
)
}
- private val recyclerAnimatorPrev: KauAnimator by lazy {
+ private val recyclerAnimatorPrev: KauAnimator by lazyUi {
KauAnimator(
SlideAnimatorAdd(KAU_LEFT, itemDelayFactor = 0f),
SlideAnimatorRemove(KAU_RIGHT, itemDelayFactor = 0f)
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt
index 9197057..16363e2 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt
@@ -17,6 +17,7 @@ package ca.allanwang.kau.kpref.activity.items
import android.view.View
import androidx.annotation.CallSuper
+import ca.allanwang.kau.kotlin.lazyUi
import ca.allanwang.kau.kpref.activity.GlobalOptions
import ca.allanwang.kau.kpref.activity.KClick
import ca.allanwang.kau.kpref.activity.KPrefItemActions
@@ -59,7 +60,7 @@ abstract class KPrefItemBase<T>(protected val base: BaseContract<T>) : KPrefItem
val kclick = object : KClick<T> {
override val context = itemView.context
override val itemView = itemView
- override val innerView: View? by lazy { itemView.findViewById<View>(R.id.kau_pref_inner_content) }
+ override val innerView: View? by lazyUi { itemView.findViewById<View>(R.id.kau_pref_inner_content) }
override val item = this@KPrefItemBase
}
if (_enabled) {