|
@@ -30,6 +30,7 @@ import android.graphics.PorterDuff
|
|
import android.graphics.drawable.Drawable
|
|
import android.graphics.drawable.Drawable
|
|
import android.graphics.drawable.LayerDrawable
|
|
import android.graphics.drawable.LayerDrawable
|
|
import android.os.Build
|
|
import android.os.Build
|
|
|
|
+import android.view.MenuItem
|
|
import android.view.View
|
|
import android.view.View
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
import android.widget.CheckBox
|
|
import android.widget.CheckBox
|
|
@@ -120,6 +121,18 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ fun colorToolbarMenuIcon(context: Context, item: MenuItem) {
|
|
|
|
+ withScheme(context) { scheme ->
|
|
|
|
+ item.icon.setColorFilter(scheme.onSurface, PorterDuff.Mode.SRC_ATOP)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fun colorToolbarOverflowIcon(toolbar: MaterialToolbar) {
|
|
|
|
+ withScheme(toolbar) { scheme ->
|
|
|
|
+ toolbar.overflowIcon?.setColorFilter(scheme.onSurface, PorterDuff.Mode.SRC_ATOP)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
fun themeSearchView(searchView: SearchView) {
|
|
fun themeSearchView(searchView: SearchView) {
|
|
withScheme(searchView) { scheme ->
|
|
withScheme(searchView) { scheme ->
|
|
// hacky as no default way is provided
|
|
// hacky as no default way is provided
|
|
@@ -690,7 +703,8 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|
.mutate()
|
|
.mutate()
|
|
DrawableCompat.setTintList(
|
|
DrawableCompat.setTintList(
|
|
drawable,
|
|
drawable,
|
|
- ColorStateList.valueOf(scheme.primary))
|
|
|
|
|
|
+ ColorStateList.valueOf(scheme.primary)
|
|
|
|
+ )
|
|
emoji.background = drawable
|
|
emoji.background = drawable
|
|
}
|
|
}
|
|
}
|
|
}
|