fix: respect day-night board detail filter/search icons
This commit is contained in:
@@ -517,13 +517,15 @@ class BoardDetailActivity : AppCompatActivity() {
|
||||
R.id.actionSearch -> R.drawable.ic_search_24
|
||||
else -> null
|
||||
} ?: return
|
||||
if (!isActive) {
|
||||
item?.icon = AppCompatResources.getDrawable(this, drawableRes)
|
||||
item?.iconTintList = null
|
||||
return
|
||||
}
|
||||
|
||||
val icon = AppCompatResources.getDrawable(this, drawableRes)?.mutate() ?: return
|
||||
val wrapped = DrawableCompat.wrap(icon)
|
||||
val tintColor = if (isActive) {
|
||||
MaterialColors.getColor(this, com.google.android.material.R.attr.colorPrimary, ContextCompat.getColor(this, android.R.color.holo_blue_light))
|
||||
} else {
|
||||
MaterialColors.getColor(this, com.google.android.material.R.attr.colorOnSurfaceVariant, ContextCompat.getColor(this, android.R.color.black))
|
||||
}
|
||||
val tintColor = MaterialColors.getColor(this, com.google.android.material.R.attr.colorPrimary, ContextCompat.getColor(this, android.R.color.holo_blue_light))
|
||||
DrawableCompat.setTint(wrapped, tintColor)
|
||||
item?.icon = wrapped
|
||||
item?.iconTintList = android.content.res.ColorStateList.valueOf(tintColor)
|
||||
|
||||
12
app/src/main/res/drawable-night/ic_filter_list_24.xml
Normal file
12
app/src/main/res/drawable-night/ic_filter_list_24.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M4,7h16v2H4zM7,11h10v2H7zM10,15h4v2h-4z" />
|
||||
|
||||
</vector>
|
||||
12
app/src/main/res/drawable-night/ic_search_24.xml
Normal file
12
app/src/main/res/drawable-night/ic_search_24.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27a6,6 0,1 0,-1.41,1.41l0.27,0.28v0.79L20,21.5L21.5,20zM10,14a4,4 0,1 1,0 -8a4,4 0,0 1,0 8z" />
|
||||
|
||||
</vector>
|
||||
Reference in New Issue
Block a user