fixes refl theme

This commit is contained in:
gdlbo
2022-06-21 20:38:10 +03:00
parent 9fd973c496
commit 20bae023d9
2 changed files with 24 additions and 1 deletions
@@ -0,0 +1,22 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getCenterScreenCoords;
import android.app.Activity;
import com.vk.core.ui.themes.VKTheme;
import com.vk.core.ui.themes.VKThemeHelper;
import java.lang.reflect.Method;
public class ReflectionUtils {
public static void invokeThemeChanging(Activity activity, VKTheme theme) {
try {
Method declaredMethod = VKThemeHelper.class.getDeclaredMethod("a");
declaredMethod.setAccessible(true);
declaredMethod.invoke("a", activity, theme, getCenterScreenCoords());
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -13,6 +13,7 @@ import static ru.vtosters.lite.utils.Preferences.navbar;
import static ru.vtosters.lite.utils.Preferences.systemtheme;
import static ru.vtosters.lite.utils.Preferences.vkme;
import static ru.vtosters.lite.utils.Preferences.vksans;
import static ru.vtosters.lite.utils.ReflectionUtils.*;
import android.annotation.SuppressLint;
import android.app.Activity;
@@ -60,7 +61,7 @@ public class Themes {
}
public static void setSelectedTheme(Activity paramActivity, VKTheme theme) {
VKThemeHelper.k.a(paramActivity, theme, getCenterScreenCoords());
invokeThemeChanging(paramActivity, theme);
}
public static int getAccentColor() {