From 8c03ab60fce18e37cc68c115ac036412dde00e96 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:00:02 +0300 Subject: [PATCH] updated attrs and some swipe coloring --- .../ru/vtosters/lite/themes/ThemesCore.java | 7 +++++ .../ru/vtosters/lite/utils/ThemesUtils.java | 28 ++++++++----------- .../viewcontrollers/msg_list/MsgListVc.smali | 4 +++ .../SwipeToReplyItemTouchCallback.smali | 4 +++ 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/themes/ThemesCore.java b/app/src/main/java/ru/vtosters/lite/themes/ThemesCore.java index 9424084f8..5bf652d42 100644 --- a/app/src/main/java/ru/vtosters/lite/themes/ThemesCore.java +++ b/app/src/main/java/ru/vtosters/lite/themes/ThemesCore.java @@ -56,6 +56,7 @@ public class ThemesCore { ACCENT_THEME_ONLY_MILK_LIGHT.put(com.vtosters.lite.R.attr.header_tint_alternate, false); ACCENT_THEME_ONLY_MILK_LIGHT.put(com.vtosters.lite.R.attr.toolbarIconsColor, false); ACCENT_THEME_ONLY_MILK_LIGHT.put(com.vtosters.lite.R.attr.header_tab_active_indicator, false); + ACCENT_THEME_ONLY_MILK_LIGHT.put(com.vtosters.lite.R.attr.header_alternate_tab_active_indicator, false); ACCENT_THEME_ONLY_MILK_LIGHT.put(com.vtosters.lite.R.attr.im_dropdown_arrow_tint, false); ACCENT_THEME_ONLY_NOMILK.put(com.vtosters.lite.R.attr.im_dropdown_icon_color, false); @@ -85,6 +86,7 @@ public class ThemesCore { themedColors.put(com.vtosters.lite.R.attr.button_outline_border, accentColor); themedColors.put(com.vtosters.lite.R.attr.button_muted_foreground, accentColor); themedColors.put(com.vtosters.lite.R.attr.header_tab_active_indicator, accentColor); + themedColors.put(com.vtosters.lite.R.attr.header_alternate_tab_active_indicator, accentColor); themedColors.put(com.vtosters.lite.R.attr.im_dropdown_icon_color, accentColor); themedColors.put(com.vtosters.lite.R.attr.im_dropdown_arrow_tint, accentColor); @@ -99,12 +101,17 @@ public class ThemesCore { themedColors.put(com.vtosters.lite.R.attr.newsfeed_action_color, accentColor); themedColors.put(com.vtosters.lite.R.attr.counter_primary_background, accentColor); + themedColors.put(com.vtosters.lite.R.attr.dynamic_blue, accentColor); + themedColors.put(com.vtosters.lite.R.attr.action_sheet_action_foreground, accentColor); // messages wallDarkColor = ThemesUtils.darken(accentColor, 0.25f); wallLightColor = ThemesUtils.lighten(accentColor, 0.25f); + themedColors.put(com.vtosters.lite.R.attr.im_reply_separator, accentColor); + themedColors.put(com.vtosters.lite.R.attr.im_text_name, accentColor); + //themedColors.put(com.vtosters.lite.R.attr.im_ic_send_msg, accentColor); themedColors.put(com.vtosters.lite.R.attr.im_bubble_wallpaper_outgoing, accentColor); themedColors.put(com.vtosters.lite.R.attr.im_bubble_outgoing, accentColor); diff --git a/app/src/main/java/ru/vtosters/lite/utils/ThemesUtils.java b/app/src/main/java/ru/vtosters/lite/utils/ThemesUtils.java index 503960c5c..62bb94c32 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/ThemesUtils.java +++ b/app/src/main/java/ru/vtosters/lite/utils/ThemesUtils.java @@ -1,19 +1,5 @@ package ru.vtosters.lite.utils; -import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; -import static ru.vtosters.lite.hooks.VKUIHook.isLoaded; -import static ru.vtosters.lite.ui.wallpapers.WallpapersHooks.getWallpaper; -import static ru.vtosters.lite.utils.AndroidUtils.getCenterScreenCoords; -import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; -import static ru.vtosters.lite.utils.AndroidUtils.getPrefsValue; -import static ru.vtosters.lite.utils.AndroidUtils.getResources; -import static ru.vtosters.lite.utils.LifecycleUtils.getCurrentActivity; -import static ru.vtosters.lite.utils.Preferences.color_grishka; -import static ru.vtosters.lite.utils.Preferences.dockbar_accent; -import static ru.vtosters.lite.utils.Preferences.milkshake; -import static ru.vtosters.lite.utils.Preferences.navbar; -import static ru.vtosters.lite.utils.Preferences.vkme; - import android.app.Activity; import android.content.Context; import android.content.res.ColorStateList; @@ -25,11 +11,9 @@ import android.view.View; import android.view.Window; import android.webkit.WebView; import android.widget.ImageButton; - import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.widget.Toolbar; import androidx.core.graphics.ColorUtils; - import com.vk.articles.preload.WebCachePreloader; import com.vk.core.drawable.RecoloredDrawable; import com.vk.core.preference.Preference; @@ -38,9 +22,15 @@ import com.vk.core.ui.themes.VKTheme; import com.vk.core.ui.themes.VKThemeHelper; import com.vtosters.lite.R; import com.vtosters.lite.data.ThemeTracker; - import ru.vtosters.lite.themes.ColorReferences; +import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; +import static ru.vtosters.lite.hooks.VKUIHook.isLoaded; +import static ru.vtosters.lite.ui.wallpapers.WallpapersHooks.getWallpaper; +import static ru.vtosters.lite.utils.AndroidUtils.*; +import static ru.vtosters.lite.utils.LifecycleUtils.getCurrentActivity; +import static ru.vtosters.lite.utils.Preferences.*; + public class ThemesUtils { public static void applyTheme(VKTheme theme) { var currentActivity = LifecycleUtils.getCurrentActivity(); @@ -198,6 +188,10 @@ public class ThemesUtils { return false; } // Accent colors + public static int replaceColor(int i){ + return ColorReferences.isAccentedColor(i) ? getAccentColor() : i; + } + public static void themeMonetToolbar(ImageButton imageButton, Toolbar toolbar) { imageButton.setImageTintList(ColorStateList.valueOf(getHeaderText())); toolbar.setElevation(0.0f); diff --git a/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/MsgListVc.smali b/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/MsgListVc.smali index a6371a6e6..fb3a0c6fb 100644 --- a/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/MsgListVc.smali +++ b/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/MsgListVc.smali @@ -1873,6 +1873,10 @@ if-eqz p1, :cond_2 + invoke-static {p1}, Lru/vtosters/lite/utils/ThemesUtils;->recolorDrawable(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable; + + move-result-object p1 + .line 7 :goto_0 invoke-virtual {v0, p1}, Lcom/vk/im/ui/components/viewcontrollers/msg_list/SwipeToReplyItemTouchCallback;->a(Landroid/graphics/drawable/Drawable;)V diff --git a/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/SwipeToReplyItemTouchCallback.smali b/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/SwipeToReplyItemTouchCallback.smali index f5528f9e8..50f90ce1f 100644 --- a/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/SwipeToReplyItemTouchCallback.smali +++ b/smali/smali_classes3/com/vk/im/ui/components/viewcontrollers/msg_list/SwipeToReplyItemTouchCallback.smali @@ -172,6 +172,10 @@ if-eqz p1, :cond_0 + invoke-static {p1}, Lru/vtosters/lite/utils/ThemesUtils;->recolorDrawable(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable; + + move-result-object p1 + iput-object p1, p0, Lcom/vk/im/ui/components/viewcontrollers/msg_list/SwipeToReplyItemTouchCallback;->l:Landroid/graphics/drawable/Drawable; return-void