fix readFullArticleButton icon color

This commit is contained in:
Chumva 2018-05-02 17:18:41 +03:00
parent 516dc06012
commit bebc2c0604

View file

@ -121,7 +121,7 @@ public class WikipediaDialogFragment extends BaseOsmAndDialogFragment {
readFullArticleButton = (TextView) mainView.findViewById(R.id.read_full_article);
readFullArticleButton.setBackgroundResource(darkMode ? R.drawable.bt_round_long_night : R.drawable.bt_round_long_day);
readFullArticleButton.setTextColor(buttonColorStateList);
readFullArticleButton.setCompoundDrawablesWithIntrinsicBounds(getActiveIcon(R.drawable.ic_world_globe_dark), null, null, null);
readFullArticleButton.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_world_globe_dark), null, null, null);
readFullArticleButton.setCompoundDrawablePadding((int) getResources().getDimension(R.dimen.content_padding_small));
int paddingLeft = (int) getResources().getDimension(R.dimen.wikipedia_button_left_padding);
int paddingRight = (int) getResources().getDimension(R.dimen.dialog_content_margin);
@ -270,6 +270,11 @@ public class WikipediaDialogFragment extends BaseOsmAndDialogFragment {
optionsMenu.show();
}
private Drawable getIcon(int resId) {
int colorId = darkMode ? R.color.ctx_menu_controller_button_text_color_dark_n : R.color.ctx_menu_controller_button_text_color_light_n;
return getIcon(resId, colorId);
}
private Drawable getActiveIcon(int resId) {
int colorId = darkMode ? R.color.wikivoyage_active_dark : R.color.wikivoyage_active_light;
return getIcon(resId, colorId);