Merge changes I93d4d089,I4f09f9e5 into tm-qpr-dev

* changes:
  Fix b/248686898: Battery Usage list renders items on top of each other after swiping back from an app
  Fix broken battery usage Robolectric tests
This commit is contained in:
Zaiyue Xue
2022-10-27 08:36:46 +00:00
committed by Android (Google) Code Review
3 changed files with 60 additions and 15 deletions

View File

@@ -108,6 +108,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
private boolean mIs24HourFormat;
private boolean mIsFooterPrefAdded = false;
private boolean mHourlyChartVisible = true;
private View mBatteryChartViewGroup;
private View mCategoryTitleView;
private PreferenceScreen mPreferenceScreen;
@@ -690,9 +691,10 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
}
private void animateBatteryHourlyChartView(final boolean visible) {
if (mHourlyChartView == null) {
if (mHourlyChartView == null || mHourlyChartVisible == visible) {
return;
}
mHourlyChartVisible = visible;
if (visible) {
mHourlyChartView.setVisibility(View.VISIBLE);