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

Commit aad7bf5e authored by David Liu's avatar David Liu Committed by mxyyiyi
Browse files

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
parent 0ca6d534
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -36,8 +36,7 @@
        android:id="@+id/battery_chart_group"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:alpha="0">
        android:orientation="vertical">
        <com.android.settings.fuelgauge.batteryusage.BatteryChartView
            android:id="@+id/daily_battery_chart"
            android:layout_width="match_parent"
@@ -53,7 +52,7 @@
            android:layout_width="match_parent"
            android:layout_height="@dimen/chartview_layout_height"
            android:layout_marginBottom="16dp"
            android:visibility="visible"
            android:visibility="gone"
            android:contentDescription="@string/hourly_battery_usage_chart"
            android:textAppearance="?android:attr/textAppearanceSmall"
            settings:textColor="?android:attr/textColorSecondary" />
+0 −1
Original line number Diff line number Diff line
@@ -274,7 +274,6 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
        }
        if (mDailyChartView != dailyChartView || mHourlyChartView != hourlyChartView) {
            mHandler.post(() -> setBatteryChartViewInner(dailyChartView, hourlyChartView));
            animateBatteryChartViewGroup();
        }
        if (mBatteryChartViewGroup != null) {
            final View grandparentView = (View) mBatteryChartViewGroup.getParent();