Fixed status bar coloring and cleaned up some code.

This commit is contained in:
Karim Abou Zeid 2015-08-25 16:40:29 +02:00
commit 9e306b3f91
6 changed files with 10 additions and 13 deletions

View file

@ -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")

View file

@ -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)}
*