fixes refl theme
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user