updated attrs and some swipe coloring

This commit is contained in:
gdlbo
2022-11-24 15:00:02 +03:00
parent 985ced6e3c
commit 8c03ab60fc
4 changed files with 26 additions and 17 deletions
@@ -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);
@@ -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);
@@ -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
@@ -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