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

Commit 749a81c6 authored by Yvonne Jiang's avatar Yvonne Jiang Committed by Android (Google) Code Review
Browse files

Merge "Load trailing icon drawable from the correct package in...

Merge "Load trailing icon drawable from the correct package in SupervisionPromoFooterPreference." into main
parents 1eb67f97 45e0e09b
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -72,16 +72,17 @@ class SupervisionPromoFooterPreference(
            preference.title = preferenceData?.title ?: preference.title
            preference.summary = preferenceData?.summary ?: preference.summary
            preference.icon = leadingIcon ?: preference.icon
            val trailingIcon: Int? = preferenceData?.trailingIcon
            if (trailingIcon != null) {
            val trailingIcon =
                preferenceData?.trailingIcon?.let {
                    val resourcePackage = preferenceDataProvider.packageName
                    Icon.createWithResource(resourcePackage, it).loadDrawable(context)
                }
            (preference as CardPreference).setAdditionalAction(
                trailingIcon,
                // TODO(b/411279121): add content description once we have the finalized string.
                contentDescription = "",
            ) {
                    @SuppressLint("RestrictedApi")
                    it.performClick()
                }
                @SuppressLint("RestrictedApi") it.performClick()
            }
        }