Fixed status bar coloring and cleaned up some code.
This commit is contained in:
parent
9ce4a757b0
commit
9e306b3f91
6 changed files with 10 additions and 13 deletions
|
|
@ -78,7 +78,8 @@ public class ColorUtil {
|
|||
float[] hsv = new float[3];
|
||||
Color.colorToHSV(color, hsv);
|
||||
hsv[2] *= by; // value component
|
||||
return getColorWithAlpha(alpha, Color.HSVToColor(hsv));
|
||||
// don't use getColorWithAlpha(float alpha, int baseColor) here
|
||||
return (alpha << 24) + (0x00ffffff & Color.HSVToColor(hsv));
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResourceType")
|
||||
|
|
|
|||
|
|
@ -57,12 +57,6 @@ public class ViewUtil {
|
|||
return animator;
|
||||
}
|
||||
|
||||
public static void setBackgroundAlpha(@NonNull View view, float alpha, int baseColor) {
|
||||
int a = Math.min(255, Math.max(0, (int) (alpha * 255))) << 24;
|
||||
int rgb = 0x00ffffff & baseColor;
|
||||
view.setBackgroundColor(a + rgb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Should be called in {@link android.app.Activity#onPrepareOptionsMenu(Menu)} and {@link android.app.Activity#onOptionsItemSelected(MenuItem)}
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue