Reputation: 717
I have some phones android <= 9 which applies last color for all list items in submenu.
How to fix this?
.subscribe(labels -> labels.forEach(label -> {
Drawable drawable = getContext().getResources().getDrawable(R.drawable.ic_circle_outline);
DrawableCompat.setTint(drawable, Color.parseColor(label.getLabelColor());
subMenu.add(LABEL_GROUP, label.get_id(), label.get_id(), label.getName()).setIcon(drawable);
}
), error -> Log.e(TAG, "", error)
));
Upvotes: 0
Views: 20
Reputation: 717
works for me
drawable.mutate().setColorFilter(Color.parseColor(label.getLabelColor()), PorterDuff.Mode.MULTIPLY);
Upvotes: 0