aboutsummaryrefslogtreecommitdiff
path: root/core-ui/src
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 /core-ui/src
parent91da44158d9aab832317a16fc0e63f48f3e5e940 (diff)
downloadkau-5388aabf0b581a69405125ec0cdaf05ae2455133.tar.gz
kau-5388aabf0b581a69405125ec0cdaf05ae2455133.tar.bz2
kau-5388aabf0b581a69405125ec0cdaf05ae2455133.zip
Add lazy ui
Diffstat (limited to 'core-ui/src')
-rw-r--r--core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt
index 726f5b6..91e6b67 100644
--- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt
+++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt
@@ -25,6 +25,7 @@ import android.view.animation.AnimationUtils
import android.widget.TextSwitcher
import android.widget.TextView
import androidx.core.widget.TextViewCompat
+import ca.allanwang.kau.kotlin.lazyUi
import ca.allanwang.kau.ui.R
import java.util.EmptyStackException
import java.util.Stack
@@ -66,10 +67,10 @@ class TextSlider @JvmOverloads constructor(
private val prevIn: Int,
private val prevOut: Int
) {
- val NEXT_IN: Animation by lazy { AnimationUtils.loadAnimation(context, nextIn) }
- val NEXT_OUT: Animation by lazy { AnimationUtils.loadAnimation(context, nextOut) }
- val PREV_IN: Animation by lazy { AnimationUtils.loadAnimation(context, prevIn) }
- val PREV_OUT: Animation by lazy { AnimationUtils.loadAnimation(context, prevOut) }
+ val NEXT_IN: Animation by lazyUi { AnimationUtils.loadAnimation(context, nextIn) }
+ val NEXT_OUT: Animation by lazyUi { AnimationUtils.loadAnimation(context, nextOut) }
+ val PREV_IN: Animation by lazyUi { AnimationUtils.loadAnimation(context, prevIn) }
+ val PREV_OUT: Animation by lazyUi { AnimationUtils.loadAnimation(context, prevOut) }
}
companion object {