Improve battery tips cards.

- Updated Card UI
- Set thumb-up/down feedback preference to be GONE
- Add basic button action

[Screenshots] https://screenshot.googleplex.com/925MEzRyUCxZCi8

Test: manual
Change-Id: I356648d0fcec5dd1ea724297187ecafb5be55fd8
Merged-In: I356648d0fcec5dd1ea724297187ecafb5be55fd8
Bug: 291689623
This commit is contained in:
mxyyiyi
2023-07-26 15:21:08 +08:00
committed by Xinyi Mao
parent 0ca2e98773
commit 2148988cae
12 changed files with 434 additions and 112 deletions

View File

@@ -105,10 +105,9 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
public interface OnBatteryTipsUpdatedListener {
/**
* The callback function for the battery tips card is updated.
* @param title the title of the battery tip card
* @param summary the summary of the battery tip card
* @param powerAnomalyEvent the power anomaly event with highest score
*/
void onBatteryTipsUpdated(String title, String summary);
void onBatteryTipsUpdated(PowerAnomalyEvent powerAnomalyEvent);
}
@@ -365,7 +364,8 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
slotUsageData, getSlotInformation(), isBatteryUsageMapNullOrEmpty());
if (mOnBatteryTipsUpdatedListener != null) {
mOnBatteryTipsUpdatedListener.onBatteryTipsUpdated(null, null);
// TODO: replace with a selected powerAnomalyEvent with highest score
mOnBatteryTipsUpdatedListener.onBatteryTipsUpdated(null);
}
}
return true;