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

Commit 2cd860ec authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Fix some battery icon issues"

parents e5a20ce3 5c404c8d
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);