Bug 1311555 - Use filled bookmark star in ActivityStream context menu r=sebastian
authorAndrzej Hunt <ahunt@mozilla.com>
Wed, 18 Jan 2017 12:20:50 +0100
changeset 377549 ef92919b4acabfb3ffd816a63ff93faa85d2057f
parent 377548 f560f0eef6be10a2e86ba9e5bcbfe6ad911d1969
child 377550 de03a86224cd02af7166f276554122f628504c10
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1311555
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1311555 - Use filled bookmark star in ActivityStream context menu r=sebastian Unfortunately tinting the bookmark star is highly complicated due to the tinting that NavigationView performs (i.e. we'd likely have to disable NavigationView tinting, and do manual tinting on every icon - alternatively we could hack the tint-list to use blue for "checked" items, and set the bookmark item as checked). Since it's unclear if we even want the star to be blue, we'll leave it grey (but filled) for now. MozReview-Commit-ID: DekRZJayKIz
mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java
mobile/android/base/resources/drawable/as_bookmark_filled.xml
--- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java
@@ -75,16 +75,17 @@ public abstract class ActivityStreamCont
      * <p/>
      * Your implementation must be ready to return items from getItemByID() before postInit() is
      * called, i.e. you should probably inflate your menu items before this call.
      */
     /* package-local */ void postInit() {
         final MenuItem bookmarkItem = getItemByID(R.id.bookmark);
         if (Boolean.TRUE.equals(item.isBookmarked())) {
             bookmarkItem.setTitle(R.string.bookmark_remove);
+            bookmarkItem.setIcon(R.drawable.as_bookmark_filled);
         }
 
         final MenuItem pinItem = getItemByID(R.id.pin);
         if (Boolean.TRUE.equals(item.isPinned())) {
             pinItem.setTitle(R.string.contextmenu_top_sites_unpin);
         }
 
         // Disable "dismiss" for topsites until we have decided on its behaviour for topsites
@@ -104,16 +105,17 @@ public abstract class ActivityStreamCont
                 protected Boolean doInBackground() {
                     return BrowserDB.from(context).isBookmark(context.getContentResolver(), item.getUrl());
                 }
 
                 @Override
                 protected void onPostExecute(Boolean hasBookmark) {
                     if (hasBookmark) {
                         bookmarkItem.setTitle(R.string.bookmark_remove);
+                        bookmarkItem.setIcon(R.drawable.as_bookmark_filled);
                     }
 
                     item.updateBookmarked(hasBookmark);
                     bookmarkItem.setEnabled(true);
                 }
             }).execute();
         }
 
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable/as_bookmark_filled.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M12.01,1C11.508,1.068 11.087,1.415 10.925,1.895L8.178,7.562L2.301,8.552C0.956,8.771 0.622,9.738 1.557,10.7L5.717,15.186L4.748,21.497C4.601,22.445 4.99,22.997 5.673,22.997C5.985,22.985 6.291,22.899 6.564,22.748L12.021,19.817L17.542,22.748C17.816,22.9 18.121,22.985 18.434,22.997C19.117,22.997 19.504,22.442 19.36,21.497L18.394,15.186L22.505,10.705C23.441,9.739 23.105,8.771 21.761,8.552L15.972,7.562L13.1,1.9C12.939,1.416 12.516,1.067 12.01,1L12.01,1Z"/>
+</vector>