aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-02-23 16:06:45 -0800
committerAllan Wang <me@allanwang.ca>2020-02-23 16:06:45 -0800
commitc8b54fd10a08ed53eb7d21578a4fe990fe14e3bc (patch)
tree0841d112c8c00504ce10ca72ef39e403b69c595c /app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
parent4d5aaf541dbfa7d521ebbc5f011a642c83c4b9c5 (diff)
downloadfrost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.gz
frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.bz2
frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.zip
Move prefs to service locator
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
index 1f4e62ab..effa8ad4 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
@@ -38,18 +38,23 @@ import com.pitchedapps.frost.facebook.profilePictureUrl
import com.pitchedapps.frost.glide.FrostGlide
import com.pitchedapps.frost.glide.GlideApp
import com.pitchedapps.frost.utils.Prefs
+import org.koin.core.KoinComponent
+import org.koin.core.inject
/**
* Created by Allan Wang on 2017-06-05.
*/
-class AccountItem(val cookie: CookieEntity?) : KauIItem<AccountItem.ViewHolder>
- (R.layout.view_account, { ViewHolder(it) }, R.id.item_account) {
+class AccountItem(val cookie: CookieEntity?) :
+ KauIItem<AccountItem.ViewHolder>(R.layout.view_account, { ViewHolder(it) }, R.id.item_account) ,
+KoinComponent {
+
+ private val prefs: Prefs by inject()
override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) {
super.bindView(holder, payloads)
with(holder) {
text.invisible()
- text.setTextColor(Prefs.textColor)
+ text.setTextColor(prefs.textColor)
if (cookie != null) {
text.text = cookie.name
GlideApp.with(itemView).load(profilePictureUrl(cookie.id))
@@ -81,7 +86,7 @@ class AccountItem(val cookie: CookieEntity?) : KauIItem<AccountItem.ViewHolder>
GoogleMaterial.Icon.gmd_add_circle_outline.toDrawable(
itemView.context,
100,
- Prefs.textColor
+ prefs.textColor
)
)
text.text = itemView.context.getString(R.string.kau_add_account)