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

Commit 8a0a3b4c 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

Change-Id: If5623acae1efbd4b0db4bcd3989762a194fe4361
parents 74291541 406f8ac4
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() {