aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-01-24 22:04:37 -0800
committerGitHub <noreply@github.com>2021-01-24 22:04:37 -0800
commit94aa2dd8125f474570f366408645e5a81236c573 (patch)
tree2952e3ca17872ef10545081a100f16b720f0072a /app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt
parent68db99597b68c87f1e0eb2d1feb6b6c63bbff1e9 (diff)
parent35adc9529f1466e3ae45ee1934536f696bc24547 (diff)
downloadfrost-94aa2dd8125f474570f366408645e5a81236c573.tar.gz
frost-94aa2dd8125f474570f366408645e5a81236c573.tar.bz2
frost-94aa2dd8125f474570f366408645e5a81236c573.zip
Merge pull request #1742 from AllanWang/messenger
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt
index d160bee4..8003cb2e 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt
@@ -33,9 +33,11 @@ import ca.allanwang.kau.utils.bindViewResettable
import ca.allanwang.kau.utils.setOnSingleTapListener
import com.pitchedapps.frost.R
import com.pitchedapps.frost.activities.IntroActivity
+import com.pitchedapps.frost.injectors.ThemeProvider
import com.pitchedapps.frost.prefs.Prefs
import kotlin.math.abs
import org.koin.android.ext.android.inject
+import org.koin.core.component.inject
/**
* Created by Allan Wang on 2017-07-28.
@@ -49,6 +51,7 @@ import org.koin.android.ext.android.inject
abstract class BaseIntroFragment(val layoutRes: Int) : Fragment() {
protected val prefs: Prefs by inject()
+ protected val themeProvider: ThemeProvider by inject()
val screenWidth
get() = resources.displayMetrics.widthPixels
@@ -105,7 +108,7 @@ abstract class BaseIntroFragment(val layoutRes: Int) : Fragment() {
}
protected open fun themeFragmentImpl() {
- (view as? ViewGroup)?.children?.forEach { (it as? TextView)?.setTextColor(prefs.textColor) }
+ (view as? ViewGroup)?.children?.forEach { (it as? TextView)?.setTextColor(themeProvider.textColor) }
}
protected val viewArray: Array<Array<out View>> by lazyResettableRegistered { viewArray() }
@@ -134,7 +137,7 @@ class IntroFragmentWelcome : BaseIntroFragment(R.layout.intro_welcome) {
override fun themeFragmentImpl() {
super.themeFragmentImpl()
- image.imageTintList = ColorStateList.valueOf(prefs.textColor)
+ image.imageTintList = ColorStateList.valueOf(themeProvider.textColor)
}
}
@@ -146,7 +149,7 @@ class IntroFragmentEnd : BaseIntroFragment(R.layout.intro_end) {
override fun themeFragmentImpl() {
super.themeFragmentImpl()
- image.imageTintList = ColorStateList.valueOf(prefs.textColor)
+ image.imageTintList = ColorStateList.valueOf(themeProvider.textColor)
}
@SuppressLint("ClickableViewAccessibility")