From 1fdf8fb9fe5b42f6b30aa9ba1cfbe9f21d3e6ae8 Mon Sep 17 00:00:00 2001 From: lukstbit <52494258+lukstbit@users.noreply.github.com> Date: Mon, 7 Aug 2023 07:13:10 +0300 Subject: [PATCH] Fix attribute not found in vector drawable when referencing theme attribute Pass the theme to VectorDrawableCompat when loading a vector drawable in Reviewer so any direct theme attributes we have (like ?attr/iconColor) can be resolved. --- AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt b/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt index 0c0ca89d8ef7..5de4fe43f61f 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt @@ -798,7 +798,7 @@ open class Reviewer : } val whiteboardIcon = ContextCompat.getDrawable(this, R.drawable.ic_gesture_white)!!.mutate() val stylusIcon = ContextCompat.getDrawable(this, R.drawable.ic_gesture_stylus)!!.mutate() - val whiteboardColorPaletteIcon = VectorDrawableCompat.create(resources, R.drawable.ic_color_lens_white_24dp, null)!!.mutate() + val whiteboardColorPaletteIcon = VectorDrawableCompat.create(resources, R.drawable.ic_color_lens_white_24dp, this.theme)!!.mutate() if (mShowWhiteboard) { whiteboardIcon.alpha = Themes.ALPHA_ICON_ENABLED_LIGHT hideWhiteboardIcon.icon = whiteboardIcon