From 29321bb91f5adda3c7572d621a067af3263d6856 Mon Sep 17 00:00:00 2001 From: DrDisagree Date: Tue, 10 Oct 2023 17:37:54 +0600 Subject: [PATCH] Battery Style Manager: Rescale battery size in landscape mode --- .../iconify/xposed/mods/BatteryStyleManager.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/drdisagree/iconify/xposed/mods/BatteryStyleManager.java b/app/src/main/java/com/drdisagree/iconify/xposed/mods/BatteryStyleManager.java index 737f1b905..700e90db9 100644 --- a/app/src/main/java/com/drdisagree/iconify/xposed/mods/BatteryStyleManager.java +++ b/app/src/main/java/com/drdisagree/iconify/xposed/mods/BatteryStyleManager.java @@ -392,7 +392,7 @@ protected void afterHookedMethod(MethodHookParam param) { mBatteryPercentView.setVisibility(mShowPercentInside ? View.GONE : View.VISIBLE); } - scaleBatteryMeterViews(view); + scaleBatteryMeterView(view); updateChargingIconView(view, mIsCharging); }); } catch (Throwable ignored) { @@ -584,6 +584,7 @@ private void updateBatteryResources(XC_MethodHook.MethodHookParam param) { callMethod(getObjectField(param.thisObject, "iconManager"), "setTint", textColorPrimary); } callMethod(batteryIcon, "updateColors", textColorPrimary, textColorSecondary, textColorPrimary); + scaleBatteryMeterView((Object) batteryIcon); } catch (Throwable throwable) { log(TAG + throwable); } @@ -603,7 +604,7 @@ private void refreshBatteryIcons() { } if (CustomBatteryEnabled) { - scaleBatteryMeterViews(mBatteryIconView); + scaleBatteryMeterView(mBatteryIconView); try { BatteryDrawable mBatteryDrawable = (BatteryDrawable) getAdditionalInstanceField(view, "mBatteryDrawable"); @@ -619,12 +620,12 @@ private void refreshBatteryIcons() { } } - public static void scaleBatteryMeterViews(Object thisObject) { + public static void scaleBatteryMeterView(Object thisObject) { ImageView mBatteryIconView = (ImageView) getObjectField(thisObject, "mBatteryIconView"); - scaleBatteryMeterViews(mBatteryIconView); + scaleBatteryMeterView(mBatteryIconView); } - public static void scaleBatteryMeterViews(ImageView mBatteryIconView) { + public static void scaleBatteryMeterView(ImageView mBatteryIconView) { if (mBatteryIconView == null) { return; }