Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17dfdef8 authored by Stefan Maftei's avatar Stefan Maftei Committed by Android Build Coastguard Worker
Browse files

[Expressive design] Add stateful drawable for Expressive UI preferences

Bug: 445675341
Test: visual
Flag: EXEMPT BUGFIX
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:be8c982858c643dec7cbb051161e22fa3143dbdc
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:9f7c3a5c663ef60f56c3bd1f699dab4a1fa34e35
Merged-In: If5fd80726d30b83c68d71ec715c86cfeb5b68c6b
Change-Id: If5fd80726d30b83c68d71ec715c86cfeb5b68c6b
parent e3c8f2ad
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -183,6 +183,11 @@ open class SettingsPreferenceGroupAdapter(preferenceGroup: PreferenceGroup) :
        val v = holder.itemView
        val v = holder.itemView
        val drawableStateLayout = holder.itemView as? DrawableStateLayout
        val drawableStateLayout = holder.itemView as? DrawableStateLayout
        if (drawableStateLayout != null && mItemPositionStates[position] != 0) {
        if (drawableStateLayout != null && mItemPositionStates[position] != 0) {
            if (v.background == null) {
                // Make sure the stateful drawable is set for expressive UI
                v.setBackgroundResource(R.drawable.settingslib_round_background_stateful)
            }

            val background = v.background
            val background = v.background
            if (background != null) {
            if (background != null) {
                val backgroundPadding = Rect()
                val backgroundPadding = Rect()