From 692e7cefade99803d221ba6c868790f80211454e Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Thu, 2 Mar 2023 18:06:08 +0300 Subject: [PATCH] Update VerifyInfoHelper.java --- .../com/vk/core/utils/VerifyInfoHelper.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/vk/core/utils/VerifyInfoHelper.java b/app/src/main/java/com/vk/core/utils/VerifyInfoHelper.java index 717bb9ecd..c858347d9 100644 --- a/app/src/main/java/com/vk/core/utils/VerifyInfoHelper.java +++ b/app/src/main/java/com/vk/core/utils/VerifyInfoHelper.java @@ -13,23 +13,21 @@ import com.vk.core.ui.themes.MilkshakeHelper; import com.vk.core.ui.themes.VKThemeHelper; import com.vk.dto.common.VerifyInfo; import com.vk.extensions.ViewExtKt; +import com.vtosters.lite.R; import ru.vtosters.lite.utils.ThemesUtils; -import java.util.HashMap; -import java.util.Map; - public final class VerifyInfoHelper { public static final VerifyInfoHelper h; + public static int devIcon = R.drawable.ic_ghost_16; public static Integer enumSwitchMapping(VerifyInfoHelper.ColorTheme color) { - Map enumSwitchMapping = new HashMap<>(); - enumSwitchMapping.put(VerifyInfoHelper.ColorTheme.normal, 1); - enumSwitchMapping.put(VerifyInfoHelper.ColorTheme.light, 2); - enumSwitchMapping.put(VerifyInfoHelper.ColorTheme.ultraLight, 3); - enumSwitchMapping.put(VerifyInfoHelper.ColorTheme.white, 4); - - return enumSwitchMapping.get(color); + return switch (color) { + case normal -> 1; + case light -> 2; + case ultraLight -> 3; + case white -> 4; + }; } public enum ColorTheme { @@ -55,19 +53,19 @@ public final class VerifyInfoHelper { } private int c() { - return ThemesUtils.getColor(com.vtosters.lite.R.color.fire_orange); + return ThemesUtils.getColor(R.color.fire_orange); } private int d() { - return ThemesUtils.getColor(com.vtosters.lite.R.color.light_blue); + return ThemesUtils.getColor(R.color.light_blue); } private int e() { - return ThemesUtils.getColor(com.vtosters.lite.R.color.white_alpha60); + return ThemesUtils.getColor(R.color.white_alpha60); } private int f() { - return ThemesUtils.getColor(com.vtosters.lite.R.color.white); + return ThemesUtils.getColor(R.color.white); } public int a(ColorTheme colorTheme) { @@ -109,7 +107,7 @@ public final class VerifyInfoHelper { public Drawable b(Context context, VerifyInfo verifyInfo) { if (verifyInfo.dev()) { - return new RecoloredDrawable(ContextCompat.getDrawable(context, e.ic_bug_24), c(ColorTheme.normal)); + return new RecoloredDrawable(ContextCompat.getDrawable(context, devIcon), c(ColorTheme.normal)); } else if (verifyInfo.t1() && verifyInfo.u1()) { return ContextCompat.getDrawable(context, e.ic_fire_verified_border_composite_20_xml); } else if (verifyInfo.t1()) { @@ -142,7 +140,7 @@ public final class VerifyInfoHelper { public Drawable a(Context context, VerifyInfo verifyInfo) { if (verifyInfo.dev()) { - return new RecoloredDrawable(ContextCompat.getDrawable(context, e.ic_bug_24), c(ColorTheme.normal)); + return new RecoloredDrawable(ContextCompat.getDrawable(context, devIcon), c(ColorTheme.normal)); } else if (verifyInfo.t1() && verifyInfo.u1()) { return ContextCompat.getDrawable(context, e.ic_fire_verified_border_composite_20_xml); } else if (verifyInfo.t1()) { @@ -165,7 +163,7 @@ public final class VerifyInfoHelper { int c2 = 0; if (dev) { - i = e.ic_bug_24; + i = devIcon; c2 = c(colorTheme); } else if (z2 && z) { i = e.ic_fire_verified_16; @@ -214,7 +212,7 @@ public final class VerifyInfoHelper { int c2 = 0; if (dev) { - i = e.ic_bug_24; + i = devIcon; c2 = c(colorTheme); } else if (z2 && z) { i = e.ic_fire_verified_12;