Skip to content

Commit

Permalink
Fix attribute not found in vector drawable when referencing theme att…
Browse files Browse the repository at this point in the history
…ribute

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.
  • Loading branch information
lukstbit authored and BrayanDSO committed Aug 7, 2023
1 parent 98b40a6 commit 1fdf8fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1fdf8fb

Please sign in to comment.