From 1c6fd7050d20aba0186fe240ea1cf9098c0781b1 Mon Sep 17 00:00:00 2001
From: gdlbo <41114720+gdlbo@users.noreply.github.com>
Date: Wed, 22 Jun 2022 23:09:05 +0300
Subject: [PATCH] fixed auto detect theme + fixes of debug
---
.../java/ru/vtosters/lite/utils/Globals.java | 1 +
.../ru/vtosters/lite/utils/Preferences.java | 5 +++-
smali/res/xml/preferences_debug.xml | 30 +++++++++----------
smali/res/xml/preferences_feed.xml | 5 ----
4 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/app/src/main/java/ru/vtosters/lite/utils/Globals.java b/app/src/main/java/ru/vtosters/lite/utils/Globals.java
index 970485656..d871bafc5 100644
--- a/app/src/main/java/ru/vtosters/lite/utils/Globals.java
+++ b/app/src/main/java/ru/vtosters/lite/utils/Globals.java
@@ -70,6 +70,7 @@ public class Globals {
Start.alert(activity);
InstallGMS.alert(activity);
DisableBattery.alert(activity);
+ edit().putBoolean("isdark", isDarkTheme()).commit();
// VKIDProtection.alert(activity);
}
diff --git a/app/src/main/java/ru/vtosters/lite/utils/Preferences.java b/app/src/main/java/ru/vtosters/lite/utils/Preferences.java
index 4e576d96e..e7424225b 100644
--- a/app/src/main/java/ru/vtosters/lite/utils/Preferences.java
+++ b/app/src/main/java/ru/vtosters/lite/utils/Preferences.java
@@ -5,7 +5,7 @@ import static java.lang.Long.MAX_VALUE;
import static ru.vtosters.lite.f0x1d.VTVerifications.hasPrometheus;
import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified;
import static ru.vtosters.lite.utils.CacheUtils.getInstance;
-//import static ru.vtosters.lite.utils.DeletedMessagesHandler.reloadMessagesList;
+import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.fixGapps;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
@@ -18,6 +18,7 @@ import static ru.vtosters.lite.utils.Newsfeed.setupFilters;
import static ru.vtosters.lite.utils.OpusLoader.LoadLibrary;
import static ru.vtosters.lite.utils.Proxy.setProxy;
import static ru.vtosters.lite.utils.SignatureChecker.validateAppSignature;
+import static ru.vtosters.lite.utils.Themes.isDarkTheme;
import static ru.vtosters.lite.utils.Themes.systemThemeChanger;
import android.annotation.SuppressLint;
@@ -65,6 +66,8 @@ public class Preferences {
setupFilters();
getInstance().autoCleaningCache();
+ edit().putBoolean("isdark", isDarkTheme()).commit();
+
if (setoffline() && !offline()) {
Users.a();
}
diff --git a/smali/res/xml/preferences_debug.xml b/smali/res/xml/preferences_debug.xml
index fbdd26547..ec046b3d5 100644
--- a/smali/res/xml/preferences_debug.xml
+++ b/smali/res/xml/preferences_debug.xml
@@ -143,7 +143,7 @@
-
@@ -160,38 +160,38 @@
-
-
-
-
-
-
-
-
@@ -235,11 +235,11 @@
-
-
@@ -263,7 +263,7 @@
android:defaultValue="https://static.vk.com/demo"
android:key="__dbg_spa_uri"
android:title="Открыть VK UI Container" />
-
@@ -281,15 +281,15 @@
-
-
-
diff --git a/smali/res/xml/preferences_feed.xml b/smali/res/xml/preferences_feed.xml
index 7965a1ac2..1a25e8505 100644
--- a/smali/res/xml/preferences_feed.xml
+++ b/smali/res/xml/preferences_feed.xml
@@ -91,11 +91,6 @@
android:entryValues="@array/newsupdate"
android:key="newsupdate"
android:title="@string/feed_other_update" />
-