fix action menu icons color
This commit is contained in:
@@ -7,6 +7,7 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import com.vk.core.drawable.RecoloredDrawable;
|
||||
import ru.vtosters.lite.R;
|
||||
import ru.vtosters.lite.themes.ColorReferences;
|
||||
import ru.vtosters.lite.utils.AndroidUtils;
|
||||
import ru.vtosters.lite.utils.ThemesUtils;
|
||||
@@ -18,13 +19,18 @@ public class RecolorUtils {
|
||||
return new RecoloredDrawable(drawable, ThemesUtils.getHeaderText());
|
||||
} // Recolor toolbar drawable to accent color
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
public static Drawable recolorDrawableInt(int drawable) {
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables") Drawable res = AndroidUtils.getResources().getDrawable(drawable);
|
||||
return new RecoloredDrawable(res, ThemesUtils.getAccentColor());
|
||||
return recolorDrawable(drawable, ThemesUtils.getAccentColor());
|
||||
} // Get res drawable via id and coloring to accent
|
||||
|
||||
public static Drawable recolorDrawable(int drawable, int color) {
|
||||
return new RecoloredDrawable(AndroidUtils.getResources().getDrawable(drawable), color);
|
||||
} // Get res drawable via id and coloring to accent
|
||||
|
||||
public static Drawable fixActionMenuIcons(int drawable) {
|
||||
return recolorDrawable(drawable, ThemesUtils.isDarkTheme() ? ThemesUtils.getColor(com.vtosters.lite.R.color.gray_100) : ThemesUtils.getColorFromAttr(com.vtosters.lite.R.attr.header_tint));
|
||||
}
|
||||
|
||||
public static int recolorHexColor(int i) {
|
||||
if (!ThemesUtils.isCustomAccentEnabled()) return i;
|
||||
var accented = ColorReferences.isAccentedColor(i);
|
||||
|
||||
Reference in New Issue
Block a user