R.drawable.vector_label_background for API 21

This commit is contained in:
Benoit Marty 2020-08-05 18:27:59 +02:00
parent 20336af84e
commit 0ad059359f
10 changed files with 15 additions and 43 deletions

View file

@ -22,7 +22,6 @@ import androidx.constraintlayout.motion.widget.MotionLayout
import androidx.core.view.isVisible
import com.google.android.material.floatingactionbutton.FloatingActionButton
import im.vector.app.R
import im.vector.app.features.themes.ThemeUtils
import kotlinx.android.synthetic.main.motion_fab_menu_merge.view.*
class FabMenuView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
@ -37,12 +36,6 @@ class FabMenuView @JvmOverloads constructor(context: Context, attrs: AttributeSe
override fun onFinishInflate() {
super.onFinishInflate()
// Tint label background
listOf(createRoomItemChatLabel, createRoomItemGroupLabel)
.forEach {
it.setBackgroundResource(ThemeUtils.getResourceId(context, R.drawable.vector_label_background_light))
}
listOf(createRoomItemChat, createRoomItemChatLabel)
.forEach {
it.setOnClickListener {

View file

@ -180,7 +180,6 @@ object ThemeUtils {
THEME_DARK_VALUE -> {
return when (resourceId) {
R.drawable.bg_search_edit_text_light -> R.drawable.bg_search_edit_text_dark
R.drawable.vector_label_background_light -> R.drawable.vector_label_background_dark
else -> {
Timber.w("Warning, missing case for wanted drawable in dark theme")
resourceId
@ -190,7 +189,6 @@ object ThemeUtils {
THEME_BLACK_VALUE -> {
return when (resourceId) {
R.drawable.bg_search_edit_text_light -> R.drawable.bg_search_edit_text_black
R.drawable.vector_label_background_light -> R.drawable.vector_label_background_black
else -> {
Timber.w("Warning, missing case for wanted drawable in black theme")
resourceId

View file

@ -4,10 +4,10 @@
<corners android:radius="3dp" />
<solid android:color="@color/riotx_fab_label_bg_dark" />
<solid android:color="?riotx_fab_label_bg" />
<stroke
android:width="0.5dp"
android:color="@color/black" />
android:color="?riotx_fab_label_stroke" />
</shape>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="3dp" />
<solid android:color="@color/riotx_fab_label_bg_black" />
<stroke
android:width="0.5dp"
android:color="@color/black" />
</shape>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="3dp" />
<solid android:color="@color/riotx_fab_label_bg_light" />
<stroke
android:width="0.5dp"
android:color="#1EFFFFFF" />
</shape>

View file

@ -163,6 +163,11 @@
<color name="riotx_fab_label_bg_dark">#FF181B21</color>
<color name="riotx_fab_label_bg_black">#FF181B21</color>
<attr name="riotx_fab_label_stroke" format="color" />
<color name="riotx_fab_label_stroke_light">#1EFFFFFF</color>
<color name="riotx_fab_label_stroke_dark">@color/black</color>
<color name="riotx_fab_label_stroke_black">@color/black</color>
<attr name="riotx_fab_label_color" format="color" />
<color name="riotx_fab_label_color_light">#FF2E2F32</color>
<color name="riotx_fab_label_color_dark">#FFA1B2D1</color>

View file

@ -330,8 +330,7 @@
<item name="android:paddingBottom">4dp</item>
<item name="android:textSize">15sp</item>
<item name="android:textColor">?riotx_fab_label_color</item>
<!-- Note bg will be updated in the code -->
<item name="android:background">@drawable/vector_label_background_light</item>
<item name="android:background">@drawable/vector_label_background</item>
</style>
<style name="BottomSheetItemTextMain">

View file

@ -29,6 +29,7 @@
<item name="riotx_fab_secondary_bg">@color/riotx_fab_secondary_bg_black</item>
<item name="riotx_fab_secondary_color">@color/riotx_fab_secondary_color_black</item>
<item name="riotx_fab_label_bg">@color/riotx_fab_label_bg_black</item>
<item name="riotx_fab_label_stroke">@color/riotx_fab_label_stroke_black</item>
<item name="riotx_fab_label_color">@color/riotx_fab_label_color_black</item>
<item name="riotx_touch_guard_bg">@color/riotx_touch_guard_bg_black</item>
<item name="riotx_attachment_selector_background">@color/riotx_attachment_selector_background_black</item>

View file

@ -27,6 +27,7 @@
<item name="riotx_fab_secondary_bg">@color/riotx_fab_secondary_bg_dark</item>
<item name="riotx_fab_secondary_color">@color/riotx_fab_secondary_color_dark</item>
<item name="riotx_fab_label_bg">@color/riotx_fab_label_bg_dark</item>
<item name="riotx_fab_label_stroke">@color/riotx_fab_label_stroke_dark</item>
<item name="riotx_fab_label_color">@color/riotx_fab_label_color_dark</item>
<item name="riotx_touch_guard_bg">@color/riotx_touch_guard_bg_dark</item>
<item name="riotx_attachment_selector_background">@color/riotx_attachment_selector_background_dark</item>

View file

@ -27,6 +27,7 @@
<item name="riotx_fab_secondary_bg">@color/riotx_fab_secondary_bg_light</item>
<item name="riotx_fab_secondary_color">@color/riotx_fab_secondary_color_light</item>
<item name="riotx_fab_label_bg">@color/riotx_fab_label_bg_light</item>
<item name="riotx_fab_label_stroke">@color/riotx_fab_label_stroke_light</item>
<item name="riotx_fab_label_color">@color/riotx_fab_label_color_light</item>
<item name="riotx_touch_guard_bg">@color/riotx_touch_guard_bg_light</item>
<item name="riotx_keys_backup_banner_accent_color">@color/riotx_keys_backup_banner_accent_color_light</item>