Fix banner tip buttons visibility and update incompatible tip

Fix the battery settings banner tip buttons visibility not reset issue
and update the incompatible charging tip into the colored primary button

Bug: 246960554
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.widget.CardPreferenceTest
Change-Id: I9b72fccc7838d974d3b60d0f9684780841623cbb
This commit is contained in:
ykhung
2023-04-18 18:05:08 +08:00
committed by YK Hung
parent 2a0d6ead1a
commit ab07b53ea1
7 changed files with 81 additions and 36 deletions

View File

@@ -166,6 +166,10 @@ public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable {
if (iconTintColorId != View.NO_ID) {
preference.getIcon().setTint(context.getColor(iconTintColorId));
}
final CardPreference cardPreference = castToCardPreferenceSafely(preference);
if (cardPreference != null) {
cardPreference.resetLayoutState();
}
}
/** Returns the color resid for tinting {@link #getIconId()} or {@link View#NO_ID} if none. */