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

Commit 5c404c8d authored by Jason Monk's avatar Jason Monk
Browse files

Fix some battery icon issues

Bug: 26818515
Change-Id: I93f3fb19f82ba8c169b2d0c8d43f1c28b2e71ae9
parent 5eec7650
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ public class BatteryMeterDrawable extends Drawable implements DemoMode,
        mListening = true;
        mContext.getContentResolver().registerContentObserver(
                Settings.System.getUriFor(SHOW_PERCENT_SETTING), false, mSettingObserver);
        updateShowPercent();
        if (mDemoMode) return;
        mBatteryController.addStateChangedCallback(this);
    }
@@ -193,6 +194,11 @@ public class BatteryMeterDrawable extends Drawable implements DemoMode,
        mBatteryController.removeStateChangedCallback(this);
    }

    public void disableShowPercent() {
        mShowPercent = false;
        postInvalidate();
    }

    private void postInvalidate() {
        mHandler.post(new Runnable() {
            @Override
+1 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@ public class BatteryTile extends QSTile<QSTile.State> implements BatteryControll
        private void bindView() {
            mDrawable.onBatteryLevelChanged(100, false, false);
            mDrawable.onPowerSaveChanged(true);
            mDrawable.disableShowPercent();
            ((ImageView) mCurrentView.findViewById(android.R.id.icon)).setImageDrawable(mDrawable);
            Checkable checkbox = (Checkable) mCurrentView.findViewById(android.R.id.toggle);
            checkbox.setChecked(mPowerSave);