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

Commit e0e8d6be authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

systemui: Fix hidden battery icon style



Change-Id: I52a13f4945e2ea654221f73ca1357dc72b4f4cf9
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent 33dcac30
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -89,8 +89,10 @@ public class BatteryMeterView extends View implements DemoMode {

                setContentDescription(
                        context.getString(R.string.accessibility_battery_level, level));
                if (mBatteryMeterDrawable != null) {
                    setVisibility(View.VISIBLE);
                    invalidateIfVisible();
                }
            } else if (action.equals(ACTION_LEVEL_TEST)) {
                testmode = true;
                post(new Runnable() {
@@ -245,9 +247,11 @@ public class BatteryMeterView extends View implements DemoMode {
        mHeight = h;
        mWidth = w;
        synchronized (mLock) {
            if (mBatteryMeterDrawable != null) {
                mBatteryMeterDrawable.onSizeChanged(w, h, oldw, oldh);
            }
        }
    }

    protected void invalidateIfVisible() {
        if (getVisibility() == View.VISIBLE && mAttached) {
@@ -284,6 +288,9 @@ public class BatteryMeterView extends View implements DemoMode {
        mMeterMode = mode;
        if (mode == BatteryMeterMode.BATTERY_METER_GONE) {
            setVisibility(View.GONE);
            synchronized (mLock) {
                mBatteryMeterDrawable = null;
            }
        } else {
            synchronized (mLock) {
                if (mBatteryMeterDrawable != null) {
@@ -305,9 +312,11 @@ public class BatteryMeterView extends View implements DemoMode {
    @Override
    public void draw(Canvas c) {
        synchronized (mLock) {
            if (mBatteryMeterDrawable != null) {
                mBatteryMeterDrawable.onDraw(c);
            }
        }
    }

    @Override
    public void dispatchDemoCommand(String command, Bundle args) {