diff options
author | Allan Wang <me@allanwang.ca> | 2021-01-12 21:15:08 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-01-12 21:15:08 -0800 |
commit | e01e51574613459a036c1d60383bfb229799a407 (patch) | |
tree | 4214c9803638fcc1b9d9e19159651f7115c846c4 /app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt | |
parent | 0e5c1ab2dd2b574970883576e18f9a119b058788 (diff) | |
download | frost-e01e51574613459a036c1d60383bfb229799a407.tar.gz frost-e01e51574613459a036c1d60383bfb229799a407.tar.bz2 frost-e01e51574613459a036c1d60383bfb229799a407.zip |
Convert all theme access to themeprovider
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt index 47a362b4..0c53a2b1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt @@ -28,6 +28,7 @@ import com.mikepenz.fastadapter.IAdapter import com.mikepenz.fastadapter.select.selectExtension import com.pitchedapps.frost.R import com.pitchedapps.frost.facebook.FbCookie +import com.pitchedapps.frost.injectors.ThemeProvider import com.pitchedapps.frost.prefs.Prefs import com.pitchedapps.frost.utils.launchWebOverlay import org.koin.core.component.KoinComponent @@ -79,14 +80,14 @@ open class HeaderIItem( class ViewHolder(itemView: View) : FastAdapter.ViewHolder<HeaderIItem>(itemView), KoinComponent { - private val prefs: Prefs by inject() + private val themeProvider: ThemeProvider by inject() val text: TextView by bindView(R.id.item_header_text) override fun bindView(item: HeaderIItem, payloads: List<Any>) { - text.setTextColor(prefs.accentColor) + text.setTextColor(themeProvider.accentColor) text.text = item.text - text.setBackgroundColor(prefs.nativeBgColor) + text.setBackgroundColor(themeProvider.nativeBgColor) } override fun unbindView(item: HeaderIItem) { @@ -108,14 +109,14 @@ open class TextIItem( class ViewHolder(itemView: View) : FastAdapter.ViewHolder<TextIItem>(itemView), KoinComponent { - private val prefs: Prefs by inject() + private val themeProvider: ThemeProvider by inject() val text: TextView by bindView(R.id.item_text_view) override fun bindView(item: TextIItem, payloads: List<Any>) { - text.setTextColor(prefs.textColor) + text.setTextColor(themeProvider.textColor) text.text = item.text - text.background = createSimpleRippleDrawable(prefs.bgColor, prefs.nativeBgColor) + text.background = createSimpleRippleDrawable(themeProvider.bgColor, themeProvider.nativeBgColor) } override fun unbindView(item: TextIItem) { |