forked from GitHub-Mirror/riotX-android
Fix issue in theme
This commit is contained in:
@ -20,6 +20,7 @@ import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import im.vector.riotredesign.R
|
||||
import im.vector.riotredesign.features.themes.ThemeUtils
|
||||
|
||||
class UnreadCounterBadgeView : AppCompatTextView {
|
||||
|
||||
@ -37,7 +38,7 @@ class UnreadCounterBadgeView : AppCompatTextView {
|
||||
val bgRes = if (state.highlighted) {
|
||||
R.drawable.bg_unread_highlight
|
||||
} else {
|
||||
R.drawable.bg_unread_notification
|
||||
ThemeUtils.getResourceId(context, R.drawable.bg_unread_notification_light)
|
||||
}
|
||||
setBackgroundResource(bgRes)
|
||||
text = RoomSummaryFormatter.formatUnreadMessagesCounter(state.count)
|
||||
|
@ -184,8 +184,9 @@ object ThemeUtils {
|
||||
THEME_LIGHT_VALUE -> resourceId
|
||||
THEME_DARK_VALUE -> {
|
||||
return when (resourceId) {
|
||||
R.drawable.bg_search_edit_text_light -> R.drawable.bg_search_edit_text_dark
|
||||
else -> {
|
||||
R.drawable.bg_search_edit_text_light -> R.drawable.bg_search_edit_text_dark
|
||||
R.drawable.bg_unread_notification_light -> R.drawable.bg_unread_notification_dark
|
||||
else -> {
|
||||
Timber.w("Warning, missing case for wanted drawable in dark theme")
|
||||
resourceId
|
||||
}
|
||||
@ -193,8 +194,9 @@ object ThemeUtils {
|
||||
}
|
||||
THEME_BLACK_VALUE -> {
|
||||
return when (resourceId) {
|
||||
R.drawable.bg_search_edit_text_light -> R.drawable.bg_search_edit_text_black
|
||||
else -> {
|
||||
R.drawable.bg_search_edit_text_light -> R.drawable.bg_search_edit_text_black
|
||||
R.drawable.bg_unread_notification_light -> R.drawable.bg_unread_notification_black
|
||||
else -> {
|
||||
Timber.w("Warning, missing case for wanted drawable in black theme")
|
||||
resourceId
|
||||
}
|
||||
|
Reference in New Issue
Block a user