@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
super.addView(child, index, params);
if (child instanceof AppCompatImageButton) {
mThemeComponent.addColorProperty(R.attr.actionBarTextColorPrimary, (c) ->
ImageViewCompat.setImageTintList((ImageView) child, ColorStateList.valueOf(c)));
} else if (child instanceof ActionMenuView) {
mThemeComponent.addColorProperty(R.attr.actionBarTextColorPrimary, (c) -> {
ActionMenuView ch = (ActionMenuView) child;
Drawable d = DrawableCompat.wrap(ch.getOverflowIcon()).mutate();
DrawableCompat.setTint(d, c);
ch.setOverflowIcon(d);
});
}
}