|
5 | 5 | import static it.dhd.oxygencustomizer.xposed.ResourceManager.modRes;
|
6 | 6 | import static it.dhd.oxygencustomizer.xposed.hooks.systemui.ControllersProvider.getActivityStarterExternal;
|
7 | 7 | import static it.dhd.oxygencustomizer.xposed.utils.SystemUtils.PackageManager;
|
| 8 | +import static it.dhd.oxygencustomizer.xposed.utils.ViewHelper.dp2px; |
8 | 9 |
|
9 | 10 | import android.annotation.SuppressLint;
|
10 | 11 | import android.app.Notification;
|
@@ -341,24 +342,21 @@ private boolean checkChange(int newIconStyle, int iconSize, int backgroundColor,
|
341 | 342 | boolean requireUpdate = false;
|
342 | 343 | PeekIconStyle iconStyle = mCurrentPeekStyle.getPeekIconStyle();
|
343 | 344 | if (newIconStyle == 2) { // Custom icon selected
|
344 |
| - if (iconStyle.getStyle() == 2) { //old |
345 |
| - // Custom old and before |
346 |
| - boolean shouldUpdate = PEEK_STYLE_ICON_CUSTOM.getIconBackgroundColor() != iconStyle.getIconBackgroundColor() || |
347 |
| - (PEEK_STYLE_ICON_CUSTOM.getIconSize() != iconStyle.getIconSize()) || |
348 |
| - (PEEK_STYLE_ICON_CUSTOM.getIconSpacing() != iconStyle.getIconSpacing()) || |
349 |
| - (PEEK_STYLE_ICON_CUSTOM.getIconPadding() != iconStyle.getIconPadding()); |
350 |
| - if (shouldUpdate) { |
351 |
| - PEEK_STYLE_ICON_CUSTOM = new PeekIconStyle( |
352 |
| - PEEK_STYLE_ICON_CUSTOM.getName(), |
353 |
| - PEEK_STYLE_ICON_CUSTOM.getStyle(), |
354 |
| - iconSize, |
355 |
| - backgroundColor, |
356 |
| - iconMarginEnd, |
357 |
| - iconPadding |
358 |
| - ); |
359 |
| - mCurrentIconStyle = PEEK_STYLE_ICON_CUSTOM; |
360 |
| - return true; |
361 |
| - } |
| 345 | + boolean shouldUpdate = PEEK_STYLE_ICON_CUSTOM.getIconBackgroundColor() != backgroundColor || |
| 346 | + (PEEK_STYLE_ICON_CUSTOM.getIconSize() != iconSize) || |
| 347 | + (PEEK_STYLE_ICON_CUSTOM.getIconSpacing() != iconMarginEnd) || |
| 348 | + (PEEK_STYLE_ICON_CUSTOM.getIconPadding() != iconPadding); |
| 349 | + if (shouldUpdate) { |
| 350 | + PEEK_STYLE_ICON_CUSTOM = new PeekIconStyle( |
| 351 | + PEEK_STYLE_ICON_CUSTOM.getName(), |
| 352 | + PEEK_STYLE_ICON_CUSTOM.getStyle(), |
| 353 | + dp2px(mContext, iconSize), |
| 354 | + backgroundColor, |
| 355 | + dp2px(mContext, iconMarginEnd), |
| 356 | + dp2px(mContext, iconPadding) |
| 357 | + ); |
| 358 | + mCurrentIconStyle = PEEK_STYLE_ICON_CUSTOM; |
| 359 | + return true; |
362 | 360 | }
|
363 | 361 | }
|
364 | 362 | if (iconStyle.getStyle() != newIconStyle) {
|
|
0 commit comments