Bug 1227120 - Filled bookmark star does not easily convey bookmarked state. r=mcomella

MozReview-Commit-ID: 8fSQiEycSGl
This commit is contained in:
Chenxia Liu 2016-03-02 18:00:03 -08:00
parent 908cea1259
commit 1fc441daa8
16 changed files with 6 additions and 3 deletions

View File

@ -3154,6 +3154,7 @@ public class BrowserApp extends GeckoApp
} }
Tab tab = Tabs.getInstance().getSelectedTab(); Tab tab = Tabs.getInstance().getSelectedTab();
// Unlike other menu items, the bookmark star is not tinted. See {@link ThemedImageButton#setTintedDrawable}.
final MenuItem bookmark = aMenu.findItem(R.id.bookmark); final MenuItem bookmark = aMenu.findItem(R.id.bookmark);
final MenuItem reader = aMenu.findItem(R.id.reading_list); final MenuItem reader = aMenu.findItem(R.id.reading_list);
final MenuItem back = aMenu.findItem(R.id.back); final MenuItem back = aMenu.findItem(R.id.back);
@ -3387,7 +3388,7 @@ public class BrowserApp extends GeckoApp
private int resolveBookmarkIconID(final boolean isBookmark) { private int resolveBookmarkIconID(final boolean isBookmark) {
if (isBookmark) { if (isBookmark) {
return R.drawable.ic_menu_bookmark_remove; return R.drawable.star_blue;
} else { } else {
return R.drawable.ic_menu_bookmark_add; return R.drawable.ic_menu_bookmark_add;
} }

View File

@ -177,9 +177,11 @@ public class ThemedImageButton extends android.widget.ImageButton
private void setTintedImageDrawable(final Drawable drawable) { private void setTintedImageDrawable(final Drawable drawable) {
final Drawable tintedDrawable; final Drawable tintedDrawable;
if (drawableColors == null) { if (drawableColors == null || R.id.bookmark == getId()) {
// If we tint a drawable with a null ColorStateList, it will override // NB: If we tint a drawable with a null ColorStateList, it will override
// any existing colorFilters and tint... so don't! // any existing colorFilters and tint... so don't!
// NB: The bookmarked state uses a blue star, so this is a hack to keep it from being tinted.
tintedDrawable = drawable; tintedDrawable = drawable;
} else if (drawable == null) { } else if (drawable == null) {
tintedDrawable = null; tintedDrawable = null;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB