Fixed battery chart flickering
- Hide the hourly chart view by default to avoid the calculate the space. - Remove the alpha animation in chart group which causes the flickering when open the battery page. Bug: 378997970 Flag: EXEMPT bugfix Test: atest BatteryChartPreferenceControllerTest Change-Id: I1b7e5f74fe63ebcae9f9737b0797d870fd56b134
This commit is contained in:
@@ -36,8 +36,7 @@
|
|||||||
android:id="@+id/battery_chart_group"
|
android:id="@+id/battery_chart_group"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:alpha="0">
|
|
||||||
<com.android.settings.fuelgauge.batteryusage.BatteryChartView
|
<com.android.settings.fuelgauge.batteryusage.BatteryChartView
|
||||||
android:id="@+id/daily_battery_chart"
|
android:id="@+id/daily_battery_chart"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -53,7 +52,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/chartview_layout_height"
|
android:layout_height="@dimen/chartview_layout_height"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
android:contentDescription="@string/hourly_battery_usage_chart"
|
android:contentDescription="@string/hourly_battery_usage_chart"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
settings:textColor="?android:attr/textColorSecondary" />
|
settings:textColor="?android:attr/textColorSecondary" />
|
||||||
|
@@ -274,7 +274,6 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
|||||||
}
|
}
|
||||||
if (mDailyChartView != dailyChartView || mHourlyChartView != hourlyChartView) {
|
if (mDailyChartView != dailyChartView || mHourlyChartView != hourlyChartView) {
|
||||||
mHandler.post(() -> setBatteryChartViewInner(dailyChartView, hourlyChartView));
|
mHandler.post(() -> setBatteryChartViewInner(dailyChartView, hourlyChartView));
|
||||||
animateBatteryChartViewGroup();
|
|
||||||
}
|
}
|
||||||
if (mBatteryChartViewGroup != null) {
|
if (mBatteryChartViewGroup != null) {
|
||||||
final View grandparentView = (View) mBatteryChartViewGroup.getParent();
|
final View grandparentView = (View) mBatteryChartViewGroup.getParent();
|
||||||
|
Reference in New Issue
Block a user