re-use holo background drawable

This commit is contained in:
Helium314 2023-09-04 09:46:12 +02:00
parent a757b00922
commit ee5fd241ac

View file

@ -4,6 +4,10 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
public class HoloColors extends Colors {
private final Drawable keyboardBackground = new GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM,
new int[] { background, adjustLuminosityAndKeepAlpha(background, -0.2f) }
);
protected HoloColors(int _accent, int _background, int _keyBackground, int _functionalKey, int _spaceBar, int _keyText, int _keyHintText) {
super(_accent, _background, _keyBackground, _functionalKey, _spaceBar, _keyText, _keyHintText);
@ -13,8 +17,7 @@ public class HoloColors extends Colors {
public Drawable getKeyboardBackground() {
// thanks a lot google for omitting something extremely exotic like a "subtract" color
// filter that could be simply applied on top of a brighter version of keyboard_background_holo
final int bottomColor = adjustLuminosityAndKeepAlpha(background, -0.2f); // does it need adjusting?
return new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] { background, bottomColor });
return keyboardBackground;
}
}