mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-18 16:03:12 +00:00
re-use holo background drawable
This commit is contained in:
parent
a757b00922
commit
ee5fd241ac
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue