fix 99% problems on android 11 and lower

This commit is contained in:
gdlbo
2022-06-17 14:19:27 +03:00
parent c63a31ddd8
commit ebf7a4070c
2 changed files with 21 additions and 10 deletions
@@ -1,7 +1,12 @@
package ru.vtosters.lite.utils;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
import static com.vk.im.ui.themes.ImTheme.*;
import static com.vk.im.ui.themes.ImTheme.VKAPP_AMOLED;
import static com.vk.im.ui.themes.ImTheme.VKAPP_DARK;
import static com.vk.im.ui.themes.ImTheme.VKAPP_LIGHT;
import static com.vk.im.ui.themes.ImTheme.VKME_AMOLED;
import static com.vk.im.ui.themes.ImTheme.VKME_DARK;
import static com.vk.im.ui.themes.ImTheme.VKME_LIGHT;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
@@ -184,33 +189,39 @@ public class Themes {
public static Drawable recolorVKIconMenu(Drawable drawable) {
int accent = R.color.white;
if(isAndroidMonet() || isDarkTheme()) accent = getAccentColor();
if (drawable == null) return null;
if(isAndroidMonet() || isDarkTheme()) accent = getAccentColor();
return new RecoloredDrawable(drawable, accent);
} // Recolor vk icon to accent color
public static Drawable recolorDrawableToolbar(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable == null) return null;
if(!isAndroidMonet()) return drawable;
return new RecoloredDrawable(drawable, getHeaderText());
} // Recolor toolbar drawable to accent color
@SuppressLint("UseCompatLoadingForDrawables")
public static Drawable recolorDrawableInt(int drawable) {
if(!isAndroidMonet()) return getResources().getDrawable(drawable);
@SuppressLint("UseCompatLoadingForDrawables") Drawable res = getResources().getDrawable(drawable);
return new RecoloredDrawable(res, getAccentColor());
} // Get res drawable via id and coloring to accent
public static ColorStateList recolorCSL(ColorStateList colorStateList) {
if (colorStateList == null) {
return null;
}
if (colorStateList == null) return null;
if(!isAndroidMonet()) return colorStateList;
return ColorStateList.valueOf(getAccentColor());
} // Recolor ColorStateList to accent color
@SuppressLint("UseCompatLoadingForColorStateLists")
public static ColorStateList themeCSL(Context context, int color) {
if (isColorRefAccented(color) && isAndroidMonet()) {
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="23" android:compileSdkVersionCodename="6.0-2438415" package="com.vtosters.lite" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="23" android:minSdkVersion="20" android:compileSdkVersionCodename="6.0-2438415" package="com.vtosters.lite" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAMERA"/>