mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Fix issue in theme
This commit is contained in:
parent
e2d36aa213
commit
dd563ec9ae
9 changed files with 37 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
|
||||
<corners android:radius="40dp" />
|
||||
|
||||
<!-- Note: the 3 theme have the same color for now -->
|
||||
<solid android:color="@color/riotx_unread_room_indent_light" />
|
||||
<solid android:color="@color/riotx_unread_room_badge_black" />
|
||||
</shape>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="40dp" />
|
||||
|
||||
<solid android:color="@color/riotx_unread_room_badge_dark" />
|
||||
</shape>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="40dp" />
|
||||
|
||||
<solid android:color="@color/riotx_unread_room_badge_light" />
|
||||
</shape>
|
|
@ -116,4 +116,11 @@
|
|||
<color name="riotx_line_break_mobile_dark">#FF61708B</color>
|
||||
<color name="riotx_line_break_mobile_black">#FF22262E</color>
|
||||
|
||||
<!-- Other colors, which are not in the pallette -->
|
||||
<attr name="riotx_unread_room_badge" format="color" />
|
||||
<color name="riotx_unread_room_badge_light">#FF61708B</color>
|
||||
<color name="riotx_unread_room_badge_dark">#FF181B21</color>
|
||||
<color name="riotx_unread_room_badge_black">#FF61708B</color>
|
||||
|
||||
|
||||
</resources>
|
|
@ -24,6 +24,7 @@
|
|||
<item name="riotx_unread_room_indent">@color/riotx_unread_room_indent_black</item>
|
||||
<item name="riotx_android_status_bar">@color/riotx_android_status_bar_black</item>
|
||||
<item name="riotx_line_break_mobile">@color/riotx_line_break_mobile_black</item>
|
||||
<item name="riotx_unread_room_badge">@color/riotx_unread_room_badge_black</item>
|
||||
|
||||
<!-- Material color: Note: this block should be the same in all theme because it references only common colors and ?riotx attributes -->
|
||||
<item name="colorPrimary">@color/riotx_accent</item>
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<item name="riotx_unread_room_indent">@color/riotx_unread_room_indent_dark</item>
|
||||
<item name="riotx_android_status_bar">@color/riotx_android_status_bar_dark</item>
|
||||
<item name="riotx_line_break_mobile">@color/riotx_line_break_mobile_dark</item>
|
||||
<item name="riotx_unread_room_badge">@color/riotx_unread_room_badge_dark</item>
|
||||
|
||||
<!-- Material color: Note: this block should be the same in all theme because it references only common colors and ?riotx attributes -->
|
||||
<item name="colorPrimary">@color/riotx_accent</item>
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<item name="riotx_unread_room_indent">@color/riotx_unread_room_indent_light</item>
|
||||
<item name="riotx_android_status_bar">@color/riotx_android_status_bar_light</item>
|
||||
<item name="riotx_line_break_mobile">@color/riotx_line_break_mobile_light</item>
|
||||
<item name="riotx_unread_room_badge">@color/riotx_unread_room_badge_light</item>
|
||||
|
||||
<!-- Material color: Note: this block should be the same in all theme because it references only common colors and ?riotx attributes -->
|
||||
<item name="colorPrimary">@color/riotx_accent</item>
|
||||
|
|
Loading…
Reference in a new issue