Bug 787765 - Retheme about:home thumbnails. r=sriram
authorWes Johnston <wjohnston@mozilla.com>
Mon, 15 Oct 2012 11:11:43 -0700
changeset 110300 a7702d5a483455f593a2de99e750ee95ed2207af
parent 110299 c350c6f28dd17652e01908cf38ab82f19029efb7
child 110301 53146375872f42822c71cebf44159a6821b38be3
push id16453
push userwjohnston@mozilla.com
push dateMon, 15 Oct 2012 18:11:57 +0000
treeherdermozilla-inbound@a7702d5a4834 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram
bugs787765
milestone19.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 787765 - Retheme about:home thumbnails. r=sriram
mobile/android/base/AboutHomeContent.java.in
mobile/android/base/GeckoApp.java
mobile/android/base/GeckoViewsFactory.java
mobile/android/base/Makefile.in
mobile/android/base/Tab.java
mobile/android/base/Tabs.java
mobile/android/base/resources/drawable-hdpi/abouthome_thumbnail_bg.png
mobile/android/base/resources/drawable-xhdpi/abouthome_thumbnail_bg.png
mobile/android/base/resources/drawable/abouthome_thumbnail_bg.png
mobile/android/base/resources/layout-xlarge-land-v11/abouthome_content.xml.in
mobile/android/base/resources/layout-xlarge-v11/tabs_row.xml
mobile/android/base/resources/layout/abouthome_content.xml.in
mobile/android/base/resources/layout/abouthome_topsite_item.xml
mobile/android/base/resources/layout/tabs_row.xml
mobile/android/base/resources/values-large-v11/styles.xml
mobile/android/base/resources/values-xlarge-v11/styles.xml
mobile/android/base/resources/values/colors.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/AboutHomeContent.java.in
+++ b/mobile/android/base/AboutHomeContent.java.in
@@ -16,31 +16,40 @@ import org.json.JSONObject;
 
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.accounts.OnAccountsUpdateListener;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
+import android.content.res.Resources;
 import android.database.Cursor;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
+import android.graphics.Path;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.RectF;
 import android.os.SystemClock;
 import android.text.SpannableString;
 import android.text.TextUtils;
 import android.text.style.StyleSpan;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.AdapterView;
+import android.widget.AbsListView;
 import android.widget.GridView;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.ScrollView;
 import android.widget.SimpleCursorAdapter;
 import android.widget.TextView;
 
@@ -80,17 +89,17 @@ public class AboutHomeContent extends Sc
     UriLoadCallback mUriLoadCallback = null;
     VoidCallback mLoadCompleteCallback = null;
     private LayoutInflater mInflater;
 
     private AccountManager mAccountManager;
     private OnAccountsUpdateListener mAccountListener = null;
 
     protected SimpleCursorAdapter mTopSitesAdapter;
-    protected GridView mTopSitesGrid;
+    protected TopSitesGridView mTopSitesGrid;
 
     private AboutHomePromoBox mPromoBox;
     private AboutHomePromoBox.Type mPrelimPromoBoxType;
     protected AboutHomeSection mAddons;
     protected AboutHomeSection mLastTabs;
     protected AboutHomeSection mRemoteTabs;
 
     private View.OnClickListener mRemoteTabClickListener;
@@ -147,17 +156,17 @@ public class AboutHomeContent extends Sc
         mPrelimPromoBoxType = (new Random()).nextFloat() < 0.5 ? AboutHomePromoBox.Type.SYNC :
                 AboutHomePromoBox.Type.APPS;
     }
 
     private void inflate() {
         mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         mInflater.inflate(R.layout.abouthome_content, this);
 
-        mTopSitesGrid = (GridView)findViewById(R.id.top_sites_grid);
+        mTopSitesGrid = (TopSitesGridView)findViewById(R.id.top_sites_grid);
         mTopSitesGrid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                 Cursor c = (Cursor) parent.getItemAtPosition(position);
 
                 String spec = c.getString(c.getColumnIndex(URLColumns.URL));
                 Log.i(LOGTAG, "clicked: " + spec);
 
                 if (mUriLoadCallback != null)
@@ -608,43 +617,138 @@ public class AboutHomeContent extends Sc
             mRemoteTabs.addItem(row);
             row.setOnClickListener(mRemoteTabClickListener);
         }
         
         mRemoteTabs.setSubtitle(client);
         mRemoteTabs.show();
     }
 
+    // On Gingerbread TopSitesThumbnail doesn't receive onConfigurationChanged events
+    // Since the thumbnail size might change when orientation does, invalidate the
+    // thumbnail mask here
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        super.onConfigurationChanged(newConfig);
+        TopSitesThumbnail.mRoundedCorners = null;
+    }
+
+    public static class TopSitesThumbnail extends RelativeLayout {
+        static private int sRadius = 0;
+        static private int sShadowOffset = 0;
+        static public Bitmap mRoundedCorners = null;
+        static private Paint mClipPaint = null;
+        static private Paint mShadowPaint = null;
+
+        public TopSitesThumbnail(Context context, AttributeSet attrs) {
+            super(context, attrs);
+
+            Resources res = context.getResources();
+            if (sRadius <= 0) {
+                sRadius = (int) (res.getDimension(R.dimen.abouthome_icon_radius));
+            }
+            if (sShadowOffset <= 0) {
+                sShadowOffset = (int) (res.getDimension(R.dimen.abouthome_topsite_shadow_offset));
+            }
+
+            if (mShadowPaint == null) {
+                mShadowPaint = new Paint();
+                mShadowPaint.setColor(res.getColor(R.color.abouthome_topsite_shadow));
+            }
+        }
+
+        // Override drawChild to mask the child nodes with a rounded rect
+        @Override
+        protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
+            // draw a shadow behind the thumbnail
+            canvas.drawRoundRect(new RectF(getPaddingLeft(),
+                                           getHeight() - getPaddingBottom() - 2*sShadowOffset,
+                                           getWidth() - getPaddingRight(),
+                                           getHeight()- getPaddingBottom()),
+                                 sRadius, sRadius,
+                                 mShadowPaint);
+
+            int count = canvas.saveLayer(0, 0, getWidth(), getHeight(), null,
+                                         Canvas.MATRIX_SAVE_FLAG |
+                                         Canvas.CLIP_SAVE_FLAG |
+                                         Canvas.HAS_ALPHA_LAYER_SAVE_FLAG |
+                                         Canvas.FULL_COLOR_LAYER_SAVE_FLAG |
+                                         Canvas.CLIP_TO_LAYER_SAVE_FLAG);
+
+            // cache the mask rect in a static variable so that we only have to draw it once
+            if (mRoundedCorners == null) {
+                Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);
+                p.setColor(Color.WHITE);
+                mRoundedCorners = Bitmap.createBitmap(getWidth(),getHeight(),Bitmap.Config.ARGB_8888);
+                Canvas c2 = new Canvas(mRoundedCorners);
+                
+                c2.drawRoundRect(new RectF(getPaddingLeft(),
+                                           getPaddingTop(),
+                                           getWidth() - getPaddingRight(),
+                                           getHeight() - getPaddingBottom() - sShadowOffset), sRadius, sRadius, p);
+            }
+
+            if (mClipPaint == null) {
+                mClipPaint = new Paint();
+                mClipPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
+            }
+
+            super.drawChild(canvas, child, drawingTime);
+            canvas.drawBitmap(mRoundedCorners, 0, 0, mClipPaint);
+
+            canvas.restoreToCount(count);
+            return false;
+        }
+
+    }
+
     public static class TopSitesGridView extends GridView {
         public TopSitesGridView(Context context, AttributeSet attrs) {
             super(context, attrs);
         }
 
+        public int getColumnWidth() {
+            return getColumnWidth(getWidth());
+        }
+
+        public int getColumnWidth(int width) {
+            int s = -1;
+            if (android.os.Build.VERSION.SDK_INT >= 16)
+                s= super.getColumnWidth();
+            else
+                s = width / mNumberOfCols;
+
+            return s;
+        }
+
         @Override
         protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+            int measuredWidth = View.MeasureSpec.getSize(widthMeasureSpec);
             int numRows;
 
             SimpleCursorAdapter adapter = (SimpleCursorAdapter) getAdapter();
             int nSites = Integer.MAX_VALUE;
 
             if (adapter != null) {
                 Cursor c = adapter.getCursor();
                 if (c != null)
                     nSites = c.getCount();
             }
 
             nSites = Math.min(nSites, mNumberOfTopSites);
             numRows = (int) Math.round((double) nSites / mNumberOfCols);
             setNumColumns(mNumberOfCols);
 
-            int expandedHeightSpec = MeasureSpec.makeMeasureSpec(numRows * getResources().
-                    getDimensionPixelSize(R.dimen.abouthome_content_top_sites_item_height),
-                    MeasureSpec.EXACTLY);
-
-            super.onMeasure(widthMeasureSpec, expandedHeightSpec);
+            // Just using getWidth() will use incorrect values during onMeasure when rotating the device
+            // Instead we pass in the measuredWidth, which is correct
+            int w = getColumnWidth(measuredWidth);
+            Tabs.setThumbnailWidth(w);
+            heightMeasureSpec = MeasureSpec.makeMeasureSpec((int)(w*Tabs.getThumbnailAspectRatio()*numRows) + getPaddingTop() + getPaddingBottom(),
+                                                                 MeasureSpec.EXACTLY);
+            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
         }
     }
 
     public class TopSitesCursorAdapter extends SimpleCursorAdapter {
         public TopSitesCursorAdapter(Context context, int layout, Cursor c,
                                      String[] from, int[] to) {
             super(context, layout, c, from, to);
         }
@@ -655,32 +759,42 @@ public class AboutHomeContent extends Sc
         }
 
         @Override
         protected void onContentChanged () {
             // Don't do anything. We don't want to regenerate every time
             // our history database is updated.
             return;
         }
+
+        @Override
+        public void bindView(View view, Context context, Cursor cursor) {
+            super.bindView(view, context, cursor);
+            view.setLayoutParams(new AbsListView.LayoutParams(mTopSitesGrid.getColumnWidth(),
+                                                            Math.round(mTopSitesGrid.getColumnWidth()*Tabs.getThumbnailAspectRatio())));
+        }
     }
 
     class TopSitesViewBinder implements SimpleCursorAdapter.ViewBinder {
         private boolean updateThumbnail(View view, Cursor cursor, int thumbIndex) {
             byte[] b = cursor.getBlob(thumbIndex);
             ImageView thumbnail = (ImageView) view;
 
             if (b == null) {
-                thumbnail.setImageResource(R.drawable.tab_thumbnail_default);
+                thumbnail.setImageResource(R.drawable.abouthome_thumbnail_bg);
+                thumbnail.setScaleType(ImageView.ScaleType.FIT_CENTER);
             } else {
                 try {
                     Bitmap bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
                     thumbnail.setImageBitmap(bitmap);
+                    thumbnail.setScaleType(ImageView.ScaleType.CENTER_CROP);
                 } catch (OutOfMemoryError oom) {
                     Log.e(LOGTAG, "Unable to load thumbnail bitmap", oom);
-                    thumbnail.setImageResource(R.drawable.tab_thumbnail_default);
+                    thumbnail.setImageResource(R.drawable.abouthome_thumbnail_bg);
+                    thumbnail.setScaleType(ImageView.ScaleType.FIT_CENTER);
                 }
             }
 
             return true;
         }
 
         private boolean updateTitle(View view, Cursor cursor, int titleIndex) {
             String title = cursor.getString(titleIndex);
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -721,18 +721,18 @@ abstract public class GeckoApp
 
         if (tab.getState() == Tab.STATE_DELAYED) {
             byte[] thumbnail = BrowserDB.getThumbnailForUrl(getContentResolver(), tab.getURL());
             if (thumbnail != null)
                 processThumbnail(tab, null, thumbnail);
             return;
         }
 
-        int dw = tab.getThumbnailWidth();
-        int dh = tab.getThumbnailHeight();
+        int dw = Tabs.getThumbnailWidth();
+        int dh = Tabs.getThumbnailHeight();
         GeckoAppShell.sendEventToGecko(GeckoEvent.createScreenshotEvent(tab.getId(), 0, 0, 0, 0, 0, 0, dw, dh, dw, dh, ScreenshotHandler.SCREENSHOT_THUMBNAIL, tab.getThumbnailBuffer()));
     }
 
     void handleThumbnailData(Tab tab, ByteBuffer data) {
         if (shouldUpdateThumbnail(tab)) {
             Bitmap b = tab.getThumbnailBitmap();
             b.copyPixelsFromBuffer(data);
             processThumbnail(tab, b, null);
--- a/mobile/android/base/GeckoViewsFactory.java
+++ b/mobile/android/base/GeckoViewsFactory.java
@@ -39,16 +39,18 @@ public final class GeckoViewsFactory imp
             Log.i(LOGTAG, "Creating custom Gecko view: " + viewName);
 
             if (TextUtils.equals(viewName, "AboutHomePromoBox"))
                 return new AboutHomePromoBox(context, attrs);
             else if (TextUtils.equals(viewName, "AboutHomeContent"))
                 return new AboutHomeContent(context, attrs);
             else if (TextUtils.equals(viewName, "AboutHomeContent$TopSitesGridView"))
                 return new AboutHomeContent.TopSitesGridView(context, attrs);
+            else if (TextUtils.equals(viewName, "AboutHomeContent$TopSitesThumbnail"))
+                return new AboutHomeContent.TopSitesThumbnail(context, attrs);
             else if (TextUtils.equals(viewName, "AboutHomeSection"))
                 return new AboutHomeSection(context, attrs);
             else if (TextUtils.equals(viewName, "AwesomeBarTabs"))
                 return new AwesomeBarTabs(context, attrs);
             else if (TextUtils.equals(viewName, "BrowserToolbarBackground"))
                 return new BrowserToolbarBackground(context, attrs);
             else if (TextUtils.equals(viewName, "FormAssistPopup"))
                 return new FormAssistPopup(context, attrs);
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -419,16 +419,17 @@ RES_VALUES_V11 = \
   res/values-v11/dimens.xml \
   res/values-v11/styles.xml \
   res/values-v11/themes.xml \
   $(NULL)
 
 RES_VALUES_LARGE_V11 = \
   $(SYNC_RES_VALUES_LARGE_V11) \
   res/values-large-v11/dimens.xml \
+  res/values-large-v11/styles.xml \
   $(NULL)
 
 RES_VALUES_XLARGE_V11 = \
   res/values-xlarge-v11/dimens.xml \
   res/values-xlarge-v11/integers.xml \
   res/values-xlarge-v11/styles.xml \
   $(NULL)
 
@@ -457,16 +458,17 @@ RES_DRAWABLE_BASE = \
   res/drawable/folder.png \
   res/drawable/abouthome_icon.png \
   res/drawable/abouthome_logo.png \
   res/drawable/abouthome_promo_box_bg.9.png \
   res/drawable/abouthome_promo_box_pressed_bg.9.png \
   res/drawable/abouthome_promo_logo_apps.png \
   res/drawable/abouthome_promo_logo_sync.png \
   res/drawable/abouthome_thumbnail.png \
+  res/drawable/abouthome_thumbnail_bg.png \
   res/drawable/address_bar_bg_shadow.png \
   res/drawable/alert_addon.png \
   res/drawable/alert_app.png \
   res/drawable/alert_download.png \
   res/drawable/awesomebar_tab_center.9.png \
   res/drawable/awesomebar_tab_left.9.png \
   res/drawable/awesomebar_tab_right.9.png \
   res/drawable/ic_addons_empty.png \
@@ -537,16 +539,17 @@ RES_DRAWABLE_HDPI = \
   res/drawable-hdpi/home_star.png \
   res/drawable-hdpi/abouthome_icon.png \
   res/drawable-hdpi/abouthome_logo.png \
   res/drawable-hdpi/abouthome_promo_box_bg.9.png \
   res/drawable-hdpi/abouthome_promo_box_pressed_bg.9.png \
   res/drawable-hdpi/abouthome_promo_logo_apps.png \
   res/drawable-hdpi/abouthome_promo_logo_sync.png \
   res/drawable-hdpi/abouthome_thumbnail.png \
+  res/drawable-hdpi/abouthome_thumbnail_bg.png \
   res/drawable-hdpi/address_bar_bg_shadow.png \
   res/drawable-hdpi/alert_addon.png \
   res/drawable-hdpi/alert_app.png \
   res/drawable-hdpi/alert_download.png \
   res/drawable-hdpi/awesomebar_tab_center.9.png \
   res/drawable-hdpi/awesomebar_tab_left.9.png \
   res/drawable-hdpi/awesomebar_tab_right.9.png \
   res/drawable-hdpi/ic_addons_empty.png \
@@ -599,16 +602,17 @@ RES_DRAWABLE_XHDPI = \
   res/drawable-xhdpi/folder.png \
   res/drawable-xhdpi/abouthome_icon.png \
   res/drawable-xhdpi/abouthome_logo.png \
   res/drawable-xhdpi/abouthome_promo_box_bg.9.png \
   res/drawable-xhdpi/abouthome_promo_box_pressed_bg.9.png \
   res/drawable-xhdpi/abouthome_promo_logo_apps.png \
   res/drawable-xhdpi/abouthome_promo_logo_sync.png \
   res/drawable-xhdpi/abouthome_thumbnail.png \
+  res/drawable-xhdpi/abouthome_thumbnail_bg.png \
   res/drawable-xhdpi/address_bar_bg_shadow.png \
   res/drawable-xhdpi/address_bar_texture_port.png \
   res/drawable-xhdpi/address_bar_url_default.9.png \
   res/drawable-xhdpi/address_bar_url_pressed.9.png \
   res/drawable-xhdpi/alert_addon.png \
   res/drawable-xhdpi/alert_app.png \
   res/drawable-xhdpi/alert_download.png \
   res/drawable-xhdpi/awesomebar_tab_center.9.png \
--- a/mobile/android/base/Tab.java
+++ b/mobile/android/base/Tab.java
@@ -149,49 +149,39 @@ public class Tab {
         return mFavicon;
     }
 
     public Drawable getThumbnail() {
         return mThumbnail;
     }
 
     synchronized public ByteBuffer getThumbnailBuffer() {
-        int capacity = getThumbnailWidth() * getThumbnailHeight() * 2 /* 16 bpp */;
+        int capacity = Tabs.getThumbnailWidth() * Tabs.getThumbnailHeight() * 2 /* 16 bpp */;
         if (mThumbnailBuffer != null && mThumbnailBuffer.capacity() == capacity)
             return mThumbnailBuffer;
         freeBuffer();
         mThumbnailBuffer = DirectBufferAllocator.allocate(capacity);
         return mThumbnailBuffer;
     }
 
     public Bitmap getThumbnailBitmap() {
         if (mThumbnailBitmap != null)
             return mThumbnailBitmap;
-        return mThumbnailBitmap = Bitmap.createBitmap(getThumbnailWidth(), getThumbnailHeight(), Bitmap.Config.RGB_565);
+        return mThumbnailBitmap = Bitmap.createBitmap(Tabs.getThumbnailWidth(), Tabs.getThumbnailHeight(), Bitmap.Config.RGB_565);
     }
 
     public void finalize() {
         freeBuffer();
     }
 
     synchronized void freeBuffer() {
         DirectBufferAllocator.free(mThumbnailBuffer);
         mThumbnailBuffer = null;
     }
 
-    int getThumbnailWidth() {
-        int desiredWidth = (int) (GeckoApp.mAppContext.getResources().getDimension(R.dimen.tab_thumbnail_width));
-        return desiredWidth & ~0x1;
-    }
-
-    int getThumbnailHeight() {
-        int desiredHeight = (int) (GeckoApp.mAppContext.getResources().getDimension(R.dimen.tab_thumbnail_height));
-        return desiredHeight & ~0x1;
-    }
-
     public void updateThumbnail(final Bitmap b) {
         final Tab tab = this;
         GeckoAppShell.getHandler().post(new Runnable() {
             public void run() {
                 if (b != null) {
                     try {
                         mThumbnail = new BitmapDrawable(b);
                         if (mState == Tab.STATE_SUCCESS)
--- a/mobile/android/base/Tabs.java
+++ b/mobile/android/base/Tabs.java
@@ -43,16 +43,18 @@ public class Tabs implements GeckoEventL
     private static final int SCORE_INCREMENT_TAB_LOCATION_CHANGE = 5;
     private static final int SCORE_INCREMENT_TAB_SELECTED = 10;
     private static final int SCORE_THRESHOLD = 30;
 
     private static AtomicInteger sTabId = new AtomicInteger(0);
 
     private GeckoApp mActivity;
 
+    static private int sThumbnailWidth = -1;
+
     private Tabs() {
         registerEventListener("SessionHistory:New");
         registerEventListener("SessionHistory:Back");
         registerEventListener("SessionHistory:Forward");
         registerEventListener("SessionHistory:Goto");
         registerEventListener("SessionHistory:Purge");
         registerEventListener("Tab:Added");
         registerEventListener("Tab:Close");
@@ -60,16 +62,35 @@ public class Tabs implements GeckoEventL
         registerEventListener("Content:LocationChange");
         registerEventListener("Session:RestoreBegin");
         registerEventListener("Session:RestoreEnd");
         registerEventListener("Reader:Added");
         registerEventListener("Reader:Removed");
         registerEventListener("Reader:Share");
     }
 
+    static public void setThumbnailWidth(int val) {
+      // Round this to the next highest power of two
+      sThumbnailWidth = (int)(Math.pow( 2, Math.ceil(Math.log(val)/Math.log(2) )));
+    }
+
+    static public int getThumbnailWidth() {
+        if (sThumbnailWidth < 0) {
+            sThumbnailWidth = (int) (GeckoApp.mAppContext.getResources().getDimension(R.dimen.tab_thumbnail_width));
+            return sThumbnailWidth & ~0x1;
+        }
+        return sThumbnailWidth;
+    }
+
+    static public int getThumbnailHeight() {
+        return Math.round(getThumbnailWidth() * getThumbnailAspectRatio());
+    }
+
+    static public float getThumbnailAspectRatio() { return 0.714f; }
+
     public void attachToActivity(GeckoApp activity) {
         mActivity = activity;
     }
 
     public int getCount() {
         return mTabs.size();
     }
 
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b92c28fc25d36e08289cc75a72757a9989347946
GIT binary patch
literal 1215
zc$@*h1VH<VP)<h;3K|Lk000e1NJLTq001@s005Q<1^@s6m05c;00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyt;
z5eOA*ra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KnAw9fj1G2ufjZf?Xa?XPDpgFeSKvK5<5%*q_`uih{|g!
zW+6?kwbnYu3mt&cXX=sSSleQni0EVhGG?xOqV)ja;JL0CxaYH-rXLfc>RUv$)`H8e
zBSX<IUm`<9H8Xb;3!mX>z}!R2)!LMam9q-VBc^y`<-6?b<kD*L7z3Nqo=4P*8o;lC
z5^s#1jzqj0Tj|BNhHswPwF^x9iHJ&{m<@nWGrbeLl{uJFkU0IL?OBoCOUSD=aN=ob
zrI~8~K}Zv{iDTxyY)h7=7N4|HJ4$BGWbd?;hhFUlrfhFFB4}=t9NlXL{|g~e+DEK?
z?5Y1`rte~ZiCCh{akCn%smkWFm9(@_6h%=KMNt$*Q4~c{6h*l=e*t%c0s?nK;Y0uc
N002ovPDHLkV1kDDQwjh8
--- a/mobile/android/base/resources/layout-xlarge-land-v11/abouthome_content.xml.in
+++ b/mobile/android/base/resources/layout-xlarge-land-v11/abouthome_content.xml.in
@@ -33,24 +33,17 @@
                       android:paddingLeft="12dip"
                       android:textSize="12sp"
                       android:textColor="#000000"
                       android:textStyle="bold"
                       android:gravity="left|center_vertical"/>
 
             <view class="org.mozilla.gecko.AboutHomeContent$TopSitesGridView"
                   android:id="@+id/top_sites_grid"
-                  android:layout_width="fill_parent"
-                  android:layout_height="wrap_content"
-                  android:layout_marginTop="12dp"
-                  android:verticalSpacing="8dip"
-                  android:horizontalSpacing="0dip"
-                  android:isScrollContainer="false"
-                  android:gravity="center"
-                  android:listSelector="@drawable/action_bar_button"/>
+                  style="@style/AboutHome.Thumbnail.Grid"/>
 
             <org.mozilla.gecko.LinkTextView android:id="@+id/all_top_sites_text"
                                             android:text="@string/abouthome_top_sites_browse"
                                             android:layout_width="fill_parent"
                                             android:layout_height="30dip"
                                             android:layout_marginTop="7dip"
                                             android:textColor="#22629e"
                                             android:textSize="12sp"
--- a/mobile/android/base/resources/layout-xlarge-v11/tabs_row.xml
+++ b/mobile/android/base/resources/layout-xlarge-v11/tabs_row.xml
@@ -25,17 +25,17 @@
             <ImageView android:id="@+id/thumbnail"
                        android:layout_width="@dimen/tab_thumbnail_width"
                        android:layout_height="@dimen/tab_thumbnail_height"
                        android:layout_marginLeft="1dip"
                        android:layout_marginTop="1dip"
                        android:layout_alignParentLeft="true"
                        android:layout_centerVertical="true"
                        android:src="@drawable/tab_thumbnail_default"
-                       android:scaleType="fitCenter"/>
+                       android:scaleType="centerCrop"/>
 
             <ImageView android:id="@+id/shadow"
                        android:layout_width="138dip"
                        android:layout_height="80dip"
                        android:layout_alignParentLeft="true"
                        android:layout_centerVertical="true"
                        android:src="@drawable/tab_thumbnail_shadow"
                        android:scaleType="fitCenter"/>
--- a/mobile/android/base/resources/layout/abouthome_content.xml.in
+++ b/mobile/android/base/resources/layout/abouthome_content.xml.in
@@ -44,24 +44,17 @@
 
         <LinearLayout android:orientation="vertical"
                       android:layout_width="fill_parent"
                       android:layout_height="fill_parent"
                       android:layout_below="@id/top_sites_title">
 
             <view class="org.mozilla.gecko.AboutHomeContent$TopSitesGridView"
                   android:id="@+id/top_sites_grid"
-                  android:layout_width="fill_parent"
-                  android:layout_height="wrap_content"
-                  android:layout_marginTop="12dp"
-                  android:verticalSpacing="8dip"
-                  android:horizontalSpacing="0dip"
-                  android:isScrollContainer="false"
-                  android:gravity="center"
-                  android:listSelector="@drawable/action_bar_button"/>
+                  style="@style/AboutHome.Thumbnail.Grid"/>
 
             <org.mozilla.gecko.LinkTextView android:id="@+id/all_top_sites_text"
                                             android:text="@string/abouthome_top_sites_browse"
                                             android:layout_width="fill_parent"
                                             android:layout_height="30dip"
                                             android:layout_marginTop="7dip"
                                             android:textColor="#22629e"
                                             android:textSize="12sp"
--- a/mobile/android/base/resources/layout/abouthome_topsite_item.xml
+++ b/mobile/android/base/resources/layout/abouthome_topsite_item.xml
@@ -1,38 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="146dip"
-                android:layout_height="wrap_content"
-                android:paddingTop="4dip">
-
-    <ImageView android:id="@+id/thumbnail"
-               android:layout_width="@dimen/tab_thumbnail_width"
-               android:layout_height="@dimen/tab_thumbnail_height"
-               android:layout_centerHorizontal="true"
-               android:paddingTop="2dip"
-               android:layout_alignParentTop="true"
-               android:src="@drawable/tab_thumbnail_default"
-               android:scaleType="fitCenter"/>
+<view class="org.mozilla.gecko.AboutHomeContent$TopSitesThumbnail"
+                xmlns:android="http://schemas.android.com/apk/res/android"
+                style="@style/AboutHome.Thumbnail">
 
-    <ImageView android:id="@+id/shadow"
-               android:layout_width="138dip"
-               android:layout_height="80dip"
-               android:layout_centerHorizontal="true"
-               android:layout_alignParentTop="true"
-               android:src="@drawable/tab_thumbnail_shadow"
-               android:scaleType="fitCenter"/>
+    <ImageView
+          android:id="@+id/thumbnail"
+          style="@style/AboutHome.Thumbnail.Image"/>
 
-   <TextView android:id="@+id/title"
-             android:layout_width="fill_parent"
-             android:layout_height="15dip"
-             android:layout_marginTop="3dip"
-             android:layout_below="@id/shadow"
-             android:singleLine="true"
-             android:textColor="#000000"
-             android:textSize="9sp"
-             android:gravity="center_horizontal"/>
+    <TextView android:id="@+id/title"
+              style="@style/AboutHome.Thumbnail.Label"/>
 
-</RelativeLayout>
+</view>
--- a/mobile/android/base/resources/layout/tabs_row.xml
+++ b/mobile/android/base/resources/layout/tabs_row.xml
@@ -20,17 +20,17 @@
         <ImageView android:id="@+id/thumbnail"
                    android:layout_width="@dimen/tab_thumbnail_width"
                    android:layout_height="@dimen/tab_thumbnail_height"
                    android:layout_marginLeft="1dip"
                    android:layout_marginTop="1dip"
                    android:layout_alignParentLeft="true"
                    android:layout_centerVertical="true"
                    android:src="@drawable/tab_thumbnail_default"
-                   android:scaleType="fitCenter"/>
+                   android:scaleType="centerCrop"/>
 
         <ImageView android:id="@+id/shadow"
                    android:layout_width="138dip"
                    android:layout_height="80dip"
                    android:layout_alignParentLeft="true"
                    android:layout_centerVertical="true"
                    android:src="@drawable/tab_thumbnail_shadow"
                    android:scaleType="fitCenter"/>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/values-large-v11/styles.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<resources>
+
+    <style name="AboutHome.Thumbnail">
+      <item name="android:layout_width">fill_parent</item>
+      <item name="android:layout_height">fill_parent</item>
+      <item name="android:paddingTop">12dip</item>
+      <item name="android:paddingBottom">12dip</item>
+      <item name="android:paddingLeft">12dip</item>
+      <item name="android:paddingRight">12dip</item>
+    </style>
+
+    <style name="AboutHome.Thumbnail.Grid">
+      <item name="android:layout_width">fill_parent</item>
+      <item name="android:layout_height">wrap_content</item>
+      <!-- Use padding instead of grid spacing to split up items so that
+           tap highlight will extend outside the thumbnail -->
+      <item name="android:verticalSpacing">0dip</item>
+      <item name="android:horizontalSpacing">0dip</item>
+      <item name="android:isScrollContainer">false</item>
+      <item name="android:gravity">center</item>
+      <item name="android:listSelector">@drawable/action_bar_button</item>
+      <item name="android:paddingTop">0dip</item>
+      <item name="android:paddingBottom">0dip</item>
+      <!-- Increase the padding on left and right on large screen sizes -->
+      <item name="android:paddingLeft">60dip</item>
+      <item name="android:paddingRight">60dip</item>
+    </style>
+
+</resources>
--- a/mobile/android/base/resources/values-xlarge-v11/styles.xml
+++ b/mobile/android/base/resources/values-xlarge-v11/styles.xml
@@ -27,9 +27,21 @@
     </style>
 
     <!-- TabWidget --> 
     <style name="TabWidget">
         <item name="android:layout_width">300dip</item>
         <item name="android:layout_height">48dip</item>
     </style>
 
+    <style name="AboutHome.Thumbnail.Grid">
+      <item name="android:layout_width">wrap_content</item>
+      <item name="android:layout_height">wrap_content</item>
+      <item name="android:verticalSpacing">0dip</item>
+      <item name="android:horizontalSpacing">0dip</item>
+      <item name="android:isScrollContainer">false</item>
+      <item name="android:gravity">center</item>
+      <item name="android:listSelector">@drawable/action_bar_button</item>
+      <item name="android:paddingLeft">0dip</item>
+      <item name="android:paddingRight">0dip</item>
+    </style>
+
 </resources>
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -12,10 +12,11 @@
   <color name="validation_message_text">#ffffff</color>
   <color name="identity_verified">#77BAFF</color>
   <color name="identity_identified">#B7D46A</color>
   <color name="tabs_counter_color">#C7D1DB</color>
   <color name="url_bar_text_highlight">#FF9500</color>
   <color name="suggestion_primary">#dddddd</color>
   <color name="suggestion_pressed">#bbbbbb</color>
   <color name="private_browsing_color">#993399</color>
+  <color name="abouthome_topsite_shadow">#1000</color>
 </resources>
 
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -4,16 +4,18 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
 
     <dimen name="abouthome_content_top_sites_item_height">110dp</dimen>
     <dimen name="abouthome_gutter_small">0dp</dimen>
     <dimen name="abouthome_gutter_large">0dp</dimen>
     <dimen name="abouthome_icon_crop">-14dp</dimen>
+    <dimen name="abouthome_icon_radius">2dp</dimen>
+    <dimen name="abouthome_topsite_shadow_offset">2dp</dimen>
     <dimen name="autocomplete_min_width">200dp</dimen>
     <dimen name="autocomplete_row_height">32dp</dimen>
     <dimen name="awesomebar_header_row_height">20dp</dimen>
     <dimen name="awesomebar_row_height">48dp</dimen>
     <dimen name="awesomebar_tab_transparency_height">38dp</dimen>
     <dimen name="browser_toolbar_height">48dp</dimen>
     <dimen name="browser_toolbar_icon_width">36dp</dimen>
     <dimen name="browser_toolbar_lock_width">21.33dp</dimen>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -173,9 +173,67 @@
     <style name="WebView.Titlebar">
         <item name="android:background">@drawable/webapp_titlebar_bg</item>
         <item name="android:padding">2dp</item>
     </style>
 
     <style name="WebView.Titlebar.Title">
         <item name="android:textColor">#ff222222</item>
     </style>
+
+    <style name="AboutHome">
+    </style>
+
+    <style name="AboutHome.Thumbnail">
+      <item name="android:layout_width">fill_parent</item>
+      <item name="android:layout_height">fill_parent</item>
+      <item name="android:paddingTop">5dip</item>
+      <item name="android:paddingBottom">5dip</item>
+      <item name="android:paddingLeft">5dip</item>
+      <item name="android:paddingRight">5dip</item>
+    </style>
+
+    <style name="AboutHome.Thumbnail.Grid">
+      <item name="android:layout_width">fill_parent</item>
+      <item name="android:layout_height">wrap_content</item>
+      <!-- Use padding instead of grid spacing to split up items so that
+           tap highlight will extend outside the thumbnail -->
+      <item name="android:verticalSpacing">0dip</item>
+      <item name="android:horizontalSpacing">0dip</item>
+      <item name="android:isScrollContainer">false</item>
+      <item name="android:gravity">center</item>
+      <item name="android:listSelector">@drawable/action_bar_button</item>
+      <item name="android:paddingTop">0dip</item>
+      <item name="android:paddingBottom">0dip</item>
+      <item name="android:paddingLeft">0dip</item>
+      <item name="android:paddingRight">0dip</item>
+    </style>
+
+    <style name="AboutHome.Thumbnail.Image">
+      <item name="android:layout_width">fill_parent</item>
+      <item name="android:layout_height">fill_parent</item>
+      <item name="android:layout_centerHorizontal">true</item>
+      <item name="android:layout_alignParentTop">true</item>
+      <item name="android:src">@drawable/abouthome_thumbnail_bg</item>
+      <item name="android:background">#5FFF</item>
+      <item name="android:paddingTop">0dip</item>
+      <item name="android:paddingBottom">@dimen/abouthome_icon_radius</item>
+      <item name="android:paddingLeft">0dip</item>
+      <item name="android:paddingRight">0dip</item>
+      <item name="android:scaleType">centerCrop</item>
+    </style>
+
+    <style name="AboutHome.Thumbnail.Label">
+      <item name="android:layout_width">fill_parent</item>
+      <item name="android:layout_height">18dip</item>
+      <item name="android:layout_alignBottom">@id/thumbnail</item>
+      <item name="android:background">#EFFF</item>
+      <item name="android:singleLine">true</item>
+      <item name="android:textColor">#222</item>
+      <item name="android:paddingTop">0dip</item>
+      <item name="android:paddingBottom">1dip</item>
+      <item name="android:paddingLeft">5dip</item>
+      <item name="android:paddingRight">5dip</item>
+      <item name="android:textSize">10sp</item>
+      <item name="android:gravity">center|left</item>
+    </style>
+
 </resources>