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

Commit abe36814 authored by Amin Shaikh's avatar Amin Shaikh Committed by android-build-merger
Browse files

Merge "Add battery estimate to content description." into qt-dev am: 0fbcf57e am: 406f8ac4

am: 8a0a3b4c

Change-Id: I16764c0c71fdea474a2d356588acfb395e366a24
parents bff38997 8a0a3b4c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -322,9 +322,6 @@ public class BatteryMeterView extends LinearLayout implements
        mCharging = pluggedIn;
        mLevel = level;
        updatePercentText();
        setContentDescription(
                getContext().getString(charging ? R.string.accessibility_battery_level_charging
                        : R.string.accessibility_battery_level, level));
    }

    @Override
@@ -358,6 +355,9 @@ public class BatteryMeterView extends LinearLayout implements
                mBatteryController.getEstimatedTimeRemainingString((String estimate) -> {
                    if (estimate != null) {
                        mBatteryPercentView.setText(estimate);
                        setContentDescription(getContext().getString(
                                R.string.battery_low_percent_format_hybrid, mLevel, estimate));

                    } else {
                        setPercentTextAtCurrentLevel();
                    }
@@ -371,6 +371,9 @@ public class BatteryMeterView extends LinearLayout implements
    private void setPercentTextAtCurrentLevel() {
        mBatteryPercentView.setText(
                NumberFormat.getPercentInstance().format(mLevel / 100f));
        setContentDescription(
                getContext().getString(mCharging ? R.string.accessibility_battery_level_charging
                        : R.string.accessibility_battery_level, mLevel));
    }

    private void updateShowPercent() {