mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Fix color of conversation theme checkmark
This commit is contained in:
@@ -47,6 +47,12 @@ class ThemeAdapter @Inject constructor(
|
||||
private val colors: Colors
|
||||
) : QkAdapter<List<Int>>() {
|
||||
|
||||
var threadId: Long = 0
|
||||
set(value) {
|
||||
field = value
|
||||
threadIdChanged()
|
||||
}
|
||||
|
||||
val colorSelected: Subject<Int> = PublishSubject.create()
|
||||
|
||||
var selectedColor: Int = -1
|
||||
@@ -113,9 +119,11 @@ class ThemeAdapter @Inject constructor(
|
||||
.forEach { theme -> view.palette.addView(theme) }
|
||||
}
|
||||
|
||||
override fun onAttachedToRecyclerView(recyclerView: RecyclerView) {
|
||||
disposables += colors.textPrimaryOnTheme
|
||||
private fun threadIdChanged() {
|
||||
disposables.clear()
|
||||
disposables += colors.textPrimaryOnThemeForConversation(threadId)
|
||||
.subscribe { color -> iconTint = color }
|
||||
|
||||
}
|
||||
|
||||
override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) {
|
||||
|
||||
@@ -67,6 +67,7 @@ class ThemePickerActivity : QkThemedActivity<ThemePickerViewModel>(), ThemePicke
|
||||
rgbPicker.alpha = state.rgbAlpha
|
||||
rgbPicker.setBackgroundColor(state.selectedColor)
|
||||
|
||||
themeAdapter.threadId = state.threadId
|
||||
themeAdapter.selectedColor = state.selectedColor
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package presentation.feature.themepicker
|
||||
|
||||
data class ThemePickerState(
|
||||
val threadId: Long = 0,
|
||||
val selectedColor: Int = -1,
|
||||
val rgbAlpha: Float = 0f
|
||||
)
|
||||
@@ -39,6 +39,8 @@ class ThemePickerViewModel(intent: Intent) : QkViewModel<ThemePickerView, ThemeP
|
||||
init {
|
||||
appComponent.inject(this)
|
||||
|
||||
newState { it.copy(threadId = threadId) }
|
||||
|
||||
theme = prefs.theme(threadId)
|
||||
|
||||
disposables += theme.asObservable()
|
||||
|
||||
Reference in New Issue
Block a user