mirror of https://github.com/M66B/FairEmail.git
Fix disabled color for action bar view
This commit is contained in:
parent
f7ad10d77c
commit
a6c14910c4
|
@ -7358,11 +7358,24 @@ public class FragmentMessages extends FragmentBase
|
|||
int color = args.getInt("color");
|
||||
bottom_navigation.setBackgroundColor(color);
|
||||
|
||||
Integer itemColor = null;
|
||||
float lum = (float) ColorUtils.calculateLuminance(color);
|
||||
if (lum > LUMINANCE_THRESHOLD)
|
||||
bottom_navigation.setItemIconTintList(ColorStateList.valueOf(Color.BLACK));
|
||||
itemColor = Color.BLACK;
|
||||
else if ((1.0f - lum) > LUMINANCE_THRESHOLD)
|
||||
bottom_navigation.setItemIconTintList(ColorStateList.valueOf(Color.WHITE));
|
||||
itemColor = Color.WHITE;
|
||||
|
||||
if (itemColor != null)
|
||||
bottom_navigation.setItemIconTintList(new ColorStateList(
|
||||
new int[][]{
|
||||
new int[]{android.R.attr.state_enabled},
|
||||
new int[]{}
|
||||
},
|
||||
new int[]{
|
||||
itemColor,
|
||||
Color.GRAY
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
bottom_navigation.setTag(data);
|
||||
|
|
Loading…
Reference in New Issue