Bug 1025812 - Part 2: Refresh TopSitesGridItemView's drawable state when type changes. r=rnewman, a=lmandel
authorLucas Rocha <lucasr@mozilla.com>
Mon, 07 Jul 2014 14:41:54 +0100
changeset 208935 534d0fd2f00882799d525e445dd6ec3dd15ed858
parent 208934 a2ee1d8b0f0ce10140a0f42ed041108133baf16f
child 208936 5353e53b7bc0583d1f51483e76f2d21d9c12a28f
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, lmandel
bugs1025812
milestone32.0a2
Bug 1025812 - Part 2: Refresh TopSitesGridItemView's drawable state when type changes. r=rnewman, a=lmandel
mobile/android/base/home/TopSitesGridItemView.java
--- a/mobile/android/base/home/TopSitesGridItemView.java
+++ b/mobile/android/base/home/TopSitesGridItemView.java
@@ -290,16 +290,17 @@ public class TopSitesGridItemView extend
      * the type has changed, false otherwise.
      */
     private boolean updateType(int type) {
         if (mType == type) {
             return false;
         }
 
         mType = type;
+        refreshDrawableState();
 
         int pinResourceId = (type == TopSites.TYPE_PINNED ? R.drawable.pin : 0);
         mTitleView.setCompoundDrawablesWithIntrinsicBounds(pinResourceId, 0, 0, 0);
 
         return true;
     }
 
     /**
@@ -308,18 +309,15 @@ public class TopSitesGridItemView extend
      */
     private void updateTitleView() {
         String title = getTitle();
         if (!TextUtils.isEmpty(title)) {
             mTitleView.setText(title);
         } else {
             mTitleView.setText(R.string.home_top_sites_add);
         }
-
-        // Refresh for state change.
-        refreshDrawableState();
     }
 
     public void setLoadId(int aLoadId) {
         Favicons.cancelFaviconLoad(mLoadId);
         mLoadId = aLoadId;
     }
 }