reduced logging + reworked debug menu
This commit is contained in:
@@ -71,7 +71,7 @@ public class VKUIHook {
|
||||
}
|
||||
|
||||
public static void inject(WebView webView) {
|
||||
if (Preferences.dev()) {
|
||||
if (Preferences.getBoolValue("__dbg_webview", false)) {
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
webView.loadUrl("javascript:(function() {let parent = document.head || document.documentElement; let script = parent.appendChild(document.createElement('script')); script.src = 'https://cdn.jsdelivr.net/npm/eruda'; script.onload = () => eruda.init();})()");
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class ThemesCore {
|
||||
|
||||
public static boolean hasThemedAttr(Context context, int attrID) {
|
||||
if (ThemesUtils.isCustomAccentEnabled()) {
|
||||
if (Preferences.dev()) {
|
||||
if (Preferences.getBoolValue("logColors", false)) {
|
||||
try {
|
||||
Log.d(TAG, "Requesting color by attr " + context.getResources().getResourceName(attrID));
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
@@ -3,12 +3,14 @@ package ru.vtosters.lite.themes;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.*;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.vtosters.lite.R;
|
||||
import ru.vtosters.lite.themes.utils.RecolorUtils;
|
||||
import ru.vtosters.lite.utils.Preferences;
|
||||
import ru.vtosters.lite.utils.ThemesUtils;
|
||||
|
||||
public class ThemesHacks {
|
||||
@@ -23,6 +25,12 @@ public class ThemesHacks {
|
||||
public static int getHackedColor(@NonNull Context context, @ColorRes int color) {
|
||||
|
||||
if (ThemesUtils.isCustomAccentEnabled()) {
|
||||
if (Preferences.getBoolValue("logColors", false)) {
|
||||
try {
|
||||
Log.d("ThemesCore", "Requesting color by color " + context.getResources().getResourceName(color));
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
if (ThemesCore.isCachedAccents() && ColorReferences.isAccentedColor(context.getResources().getColor(color))) {
|
||||
return ThemesUtils.getAccentColor();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user