R.drawable.divider_horizontal for API 21

This commit is contained in:
Benoit Marty 2020-08-05 18:19:20 +02:00
parent 7fe30e464d
commit 0a775444dd
5 changed files with 2 additions and 15 deletions

View File

@ -23,7 +23,6 @@ import androidx.recyclerview.widget.RecyclerView
import com.airbnb.epoxy.EpoxyController
import com.airbnb.epoxy.EpoxyVisibilityTracker
import im.vector.app.R
import im.vector.app.features.themes.ThemeUtils
/**
* Apply a Vertical LinearLayout Manager to the recyclerView and set the adapter from the epoxy controller
@ -46,7 +45,7 @@ fun RecyclerView.configureWith(epoxyController: EpoxyController,
if (showDivider) {
addItemDecoration(
DividerItemDecoration(context, DividerItemDecoration.VERTICAL).apply {
ContextCompat.getDrawable(context, ThemeUtils.getResourceId(context, R.drawable.divider_horizontal_light))?.let {
ContextCompat.getDrawable(context, R.drawable.divider_horizontal)?.let {
setDrawable(it)
}
}

View File

@ -182,7 +182,6 @@ object ThemeUtils {
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
R.drawable.vector_label_background_light -> R.drawable.vector_label_background_dark
R.drawable.divider_horizontal_light -> R.drawable.divider_horizontal_dark
else -> {
Timber.w("Warning, missing case for wanted drawable in dark theme")
resourceId
@ -194,7 +193,6 @@ object ThemeUtils {
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
R.drawable.vector_label_background_light -> R.drawable.vector_label_background_black
R.drawable.divider_horizontal_light -> R.drawable.divider_horizontal_black
else -> {
Timber.w("Warning, missing case for wanted drawable in black theme")
resourceId

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="1dp" />
<solid android:color="@color/riotx_header_panel_border_mobile_dark" />
<solid android:color="?riotx_header_panel_border_mobile" />
</shape>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="1dp" />
<solid android:color="@color/riotx_header_panel_border_mobile_black" />
</shape>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="1dp" />
<solid android:color="@color/riotx_header_panel_border_mobile_light" />
</shape>