ThemeChanging meme

This commit is contained in:
gdlbo
2022-09-15 23:57:20 +03:00
parent 80d2045fbb
commit 0efdefb207
3 changed files with 35 additions and 4 deletions
@@ -447,7 +447,7 @@ public class JsonInjectors {
}
public static JSONObject fetchCatalogId(String section) {
if (section == null) return null;
if (section.isEmpty()) return null;
var request = new Request.a()
.b("https://" + getApi() + "/method/catalog.getAudio"
@@ -0,0 +1,33 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.AndroidUtils.edit;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import com.vk.core.dialogs.alert.VkAlertDialog;
import com.vk.core.ui.themes.VKThemeHelper;
import ru.vtosters.lite.hooks.VKUIHook;
public class ThemeChanging{
public static void changeTheme(Activity activity, float[] f){
if (getBoolValue("systemtheme", true)) {
new VkAlertDialog.Builder(activity)
.setTitle("Внимание!")
.setMessage("У вас включена системная тема \n" +
"При переключении темы системная тема будет отключена \n\n" +
"Вы действительно хотите отключить её?")
.setCancelable(false)
.setPositiveButton("Отключить", (dialogInterface, i) -> {
edit().putBoolean("systemtheme", false).commit();
VKThemeHelper.b(activity, f);
VKUIHook.clearWebCache();
})
.setNeutralButton("Отмена", null)
.show();
} else {
VKThemeHelper.b(activity, f);
VKUIHook.clearWebCache();
}
}
}
@@ -242,9 +242,7 @@
if-eqz v0, :cond_0
.line 6
invoke-static {v0, p1}, Lcom/vk/core/ui/themes/VKThemeHelper;->b(Landroid/app/Activity;[F)V
invoke-static {}, Lru/vtosters/lite/hooks/VKUIHook;->clearWebCache()V
invoke-static {v0, p1}, Lru/vtosters/lite/ui/dialogs/ThemeChanging;->changeTheme(Landroid/app/Activity;[F)V
:cond_0
return-void