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

Commit e0b13553 authored by LuK1337's avatar LuK1337
Browse files

SystemUI: Fix battery meter view blacklist handling

* Fixes /weird padding/ after adding any icon while
  using battery level icon set to text or hidden.

Change-Id: If3468d25d961169b87f43d2c5f7f2e7d2f8dc12f
parent 40d132c2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -83,7 +83,12 @@ public class BatteryMeterView extends ImageView implements
    public void onTuningChanged(String key, String newValue) {
        if (StatusBarIconController.ICON_BLACKLIST.equals(key)) {
            ArraySet<String> icons = StatusBarIconController.getIconBlacklist(newValue);
            setVisibility(icons.contains(mSlotBattery) ? View.GONE : View.VISIBLE);
            int batteryStyle = CMSettings.System.getInt(mContext.getContentResolver(),
                    CMSettings.System.STATUS_BAR_BATTERY_STYLE, 0);
            setVisibility(icons.contains(mSlotBattery) ||
                    batteryStyle == BatteryMeterDrawable.BATTERY_STYLE_TEXT ||
                    batteryStyle == BatteryMeterDrawable.BATTERY_STYLE_HIDDEN
                    ? View.GONE : View.VISIBLE);
        } else if (STATUS_BAR_BATTERY_STYLE.equals(key)) {
            updateBatteryStyle(newValue);
        }