Browse Source

Fixing bug where icon could be the wrong color

Without mutating icon could be the wrong color after theme change
master
anthony restaino 8 years ago
parent
commit
5f222e2d5b
  1. 16
      app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java

16
app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java

@ -131,11 +131,17 @@ public class ReadingActivity extends AppCompatActivity {
getMenuInflater().inflate(R.menu.reading, menu); getMenuInflater().inflate(R.menu.reading, menu);
MenuItem invert = menu.findItem(R.id.invert_item); MenuItem invert = menu.findItem(R.id.invert_item);
MenuItem textSize = menu.findItem(R.id.text_size_item); MenuItem textSize = menu.findItem(R.id.text_size_item);
int iconColor = mInvert ? ThemeUtils.getIconDarkThemeColor(this) : ThemeUtils.getIconLightThemeColor(this);
if (invert != null && invert.getIcon() != null) int iconColor = ThemeUtils.getIconThemeColor(this, mInvert);
invert.getIcon().setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
if (textSize != null && textSize.getIcon() != null) if (invert != null && invert.getIcon() != null) {
textSize.getIcon().setColorFilter(iconColor, PorterDuff.Mode.SRC_IN); invert.getIcon().mutate().setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
}
if (textSize != null && textSize.getIcon() != null) {
textSize.getIcon().mutate().setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
}
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);
} }

Loading…
Cancel
Save