fix colors issue

This commit is contained in:
gdlbo
2023-07-28 19:01:57 +03:00
parent fc9ccf66d1
commit 1b3896f4ca
3 changed files with 4 additions and 3 deletions
@@ -23,7 +23,7 @@ public class VKUIHook {
}
private static void applyVKUIStyles(WebView webView) {
if (getBoolValue("VKUI_INJ", true) && webView != null &&webView.getUrl() != null && !webView.getUrl().contains("static.vk.com/memories")) {
if (getBoolValue("VKUI_INJ", true) && webView != null && webView.getUrl() != null && !webView.getUrl().contains("static.vk.com/memories")) {
if (!WebViewColoringUtils.isLoaded) {
WebViewColoringUtils.load();
}
@@ -23,7 +23,7 @@ public class ThemesHacks {
}
public static int getHackedColor(@NonNull Context context, @ColorRes int color) {
if (ThemesUtils.isMonetTheme()) {
if (ThemesUtils.isMonetTheme() || ThemesManager.canApplyCustomAccent()) {
if (Preferences.getBoolValue("logColors", false)) {
try {
Log.d("ThemesCore", "Requesting color by color " + context.getResources().getResourceName(color));
@@ -11,6 +11,7 @@ import android.widget.TextView;
import com.vk.core.drawable.RecoloredDrawable;
import ru.vtosters.hooks.other.ThemesUtils;
import ru.vtosters.lite.themes.ColorReferences;
import ru.vtosters.lite.themes.ThemesManager;
import ru.vtosters.lite.utils.AndroidUtils;
public class RecolorUtils {
@@ -43,7 +44,7 @@ public class RecolorUtils {
}
public static int recolorHexColor(int i) {
if (!ThemesUtils.isMonetTheme()) return i;
if (!ThemesUtils.isMonetTheme() || !ThemesManager.canApplyCustomAccent()) return i;
var accented = ColorReferences.isAccentedColor(i);
var mutedaccented = ColorReferences.isMutedAccentedColor(i);
return (accented || mutedaccented) ? (accented ? ThemesUtils.getAccentColor() : ThemesUtils.getMutedAccentColor()) : i;