Fix disabled color for action bar view

pull/214/head
M66B 11 months ago
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…
Cancel
Save