Bug 1383736 - Use full size icons in top sites (and highlights). r=mcomella
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 07 Aug 2017 19:15:48 +0200
changeset 642636 b9e3f9520cf424ced4b7bf567ca2b45d577ee327
parent 642635 e38283010bb39d702a5301ae127b842c54908ba6
child 642637 c9f1712d723df619689fffe77a3dd4f57183e0e5
push id72833
push userbmo:emilio+bugs@crisal.io
push dateTue, 08 Aug 2017 16:50:16 +0000
reviewersmcomella
bugs1383736
milestone57.0a1
Bug 1383736 - Use full size icons in top sites (and highlights). r=mcomella MozReview-Commit-ID: 39ri4ah1ned
mobile/android/app/src/australis/res/values/dimens.xml
mobile/android/app/src/main/res/layout/activity_stream_card_history_item.xml
mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
mobile/android/app/src/photon/res/values/dimens.xml
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightItem.java
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanel.java
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPageAdapter.java
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPagerAdapter.java
mobile/android/base/java/org/mozilla/gecko/icons/loader/IconGenerator.java
mobile/android/tests/background/junit4/src/org/mozilla/gecko/icons/TestIconRequestBuilder.java
--- a/mobile/android/app/src/australis/res/values/dimens.xml
+++ b/mobile/android/app/src/australis/res/values/dimens.xml
@@ -51,25 +51,25 @@
     <dimen name="tablet_browser_toolbar_menu_item_width">56dp</dimen>
     <!-- Padding combines with an 18dp image to form the menu item width and height. -->
     <dimen name="tablet_browser_toolbar_menu_item_padding_horizontal">19dp</dimen>
     <dimen name="tablet_browser_toolbar_menu_item_inset_vertical">5dp</dimen>
     <dimen name="tablet_browser_toolbar_menu_item_inset_horizontal">3dp</dimen>
     <dimen name="tablet_tab_strip_button_inset">5dp</dimen>
 
     <!-- Dimensions used by Favicons and FaviconView -->
-    <dimen name="favicon_bg">32dp</dimen>
+    <dimen name="favicon_bg">112dp</dimen>
     <dimen name="favicon_corner_radius">2dp</dimen>
     <!-- Set the upper limit on the size of favicon that will be processed. Favicons larger than
          this will be downscaled to this value. If you need to use larger Favicons (Due to a UI
          redesign sometime after this is written) you should increase this value to the largest
          commonly-used size of favicon and, performance permitting, fetch the remainder from the
          database. The largest available size is always stored in the database, regardless of this
          value.-->
-    <dimen name="favicon_largest_interesting_size">32dp</dimen>
+    <dimen name="favicon_largest_interesting_size">112dp</dimen>
     <!-- Small favicon used in about:home(TopsitesPanel, BookmarksPanel and CombinedHistoryPanel) -->
     <dimen name="favicon_small_size">25dp</dimen>
 
     <dimen name="firstrun_content_width">300dp</dimen>
     <dimen name="firstrun_min_height">120dp</dimen>
     <dimen name="firstrun_background_height">120dp</dimen>
 
     <dimen name="overlay_prompt_content_width">260dp</dimen>
@@ -232,17 +232,16 @@
     <item name="tab_strip_content_start" type="dimen">12dp</item>
     <item name="firstrun_tab_strip_content_start" type="dimen">15dp</item>
 
     <item name="notification_media_cover" type="dimen">128dp</item>
 
     <item name="activity_stream_base_margin" type="dimen">8dp</item>
     <item name="activity_stream_desired_tile_width" type="dimen">90dp</item>
     <item name="activity_stream_desired_tile_height" type="dimen">70dp</item>
-    <item name="activity_stream_top_sites_text_height" type="dimen">30dp</item>
 
     <!-- Default touch target size for buttons/imageviews that might be of small size -->
     <item name="touch_target_size" type="dimen">48dp</item>
 
     <!-- Custom tabs -->
     <dimen name="custom_tab_action_button_size">56dp</dimen>
     <dimen name="custom_tab_action_button_padding">16dp</dimen>
 
--- a/mobile/android/app/src/main/res/layout/activity_stream_card_history_item.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_card_history_item.xml
@@ -21,16 +21,18 @@
             android:id="@+id/icon"
             android:layout_width="@dimen/favicon_bg"
             android:layout_height="@dimen/favicon_bg"
             android:layout_marginBottom="@dimen/activity_stream_base_margin"
             android:layout_marginLeft="@dimen/activity_stream_base_margin"
             android:layout_marginStart="@dimen/activity_stream_base_margin"
             android:layout_marginTop="@dimen/activity_stream_base_margin"
             gecko:enableRoundCorners="false"
+            gecko:overrideScaleType="false"
+            android:scaleType="fitCenter"
             tools:background="@drawable/favicon_globe" />
 
     </FrameLayout>
 
     <ImageView
         android:id="@+id/menu"
         android:layout_width="32dp"
         android:layout_height="48dp"
--- a/mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
@@ -7,17 +7,18 @@
     android:layout_height="match_parent">
 
     <org.mozilla.gecko.widget.FaviconView
         android:id="@+id/favicon"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         gecko:enableRoundCorners="false"
         tools:background="@drawable/favicon_globe"
-        android:layout_marginTop="0dp" />
+        android:scaleType="centerInside"
+        gecko:overrideScaleType="false" />
 
     <TextView
         android:id="@+id/title"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="#66000000"
         android:padding="5dp"
         android:drawablePadding="2dp"
--- a/mobile/android/app/src/photon/res/values/dimens.xml
+++ b/mobile/android/app/src/photon/res/values/dimens.xml
@@ -60,25 +60,25 @@
     <dimen name="tablet_browser_toolbar_menu_item_width">56dp</dimen>
     <!-- Padding combines with an 18dp image to form the menu item width and height. -->
     <dimen name="tablet_browser_toolbar_menu_item_padding_horizontal">19dp</dimen>
     <dimen name="tablet_browser_toolbar_menu_item_inset_vertical">5dp</dimen>
     <dimen name="tablet_browser_toolbar_menu_item_inset_horizontal">3dp</dimen>
     <dimen name="tablet_tab_strip_button_inset">5dp</dimen>
 
     <!-- Dimensions used by Favicons and FaviconView -->
-    <dimen name="favicon_bg">32dp</dimen>
+    <dimen name="favicon_bg">112dp</dimen>
     <dimen name="favicon_corner_radius">2dp</dimen>
     <!-- Set the upper limit on the size of favicon that will be processed. Favicons larger than
          this will be downscaled to this value. If you need to use larger Favicons (Due to a UI
          redesign sometime after this is written) you should increase this value to the largest
          commonly-used size of favicon and, performance permitting, fetch the remainder from the
          database. The largest available size is always stored in the database, regardless of this
          value.-->
-    <dimen name="favicon_largest_interesting_size">32dp</dimen>
+    <dimen name="favicon_largest_interesting_size">112dp</dimen>
     <!-- Small favicon used in about:home(TopsitesPanel, BookmarksPanel, CombinedHistoryPanel and BrowserSearch) -->
     <dimen name="favicon_small_size">24dp</dimen>
 
     <dimen name="firstrun_content_width">300dp</dimen>
     <dimen name="firstrun_min_height">120dp</dimen>
     <dimen name="firstrun_background_height">120dp</dimen>
 
     <dimen name="overlay_prompt_content_width">260dp</dimen>
@@ -247,17 +247,16 @@
     <item name="tab_strip_content_start" type="dimen">12dp</item>
     <item name="firstrun_tab_strip_content_start" type="dimen">15dp</item>
 
     <item name="notification_media_cover" type="dimen">128dp</item>
 
     <item name="activity_stream_base_margin" type="dimen">10dp</item>
     <item name="activity_stream_desired_tile_width" type="dimen">90dp</item>
     <item name="activity_stream_desired_tile_height" type="dimen">70dp</item>
-    <item name="activity_stream_top_sites_text_height" type="dimen">30dp</item>
 
     <!-- Default touch target size for buttons/imageviews that might be of small size -->
     <item name="touch_target_size" type="dimen">48dp</item>
 
     <!-- Custom tabs -->
     <dimen name="custom_tab_action_button_size">56dp</dimen>
     <dimen name="custom_tab_action_button_padding">16dp</dimen>
 
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java
@@ -117,21 +117,19 @@ public class ActivityStreamPanel extends
             int padding = (w - needed) / 2;
             w = needed;
 
             setPadding(padding, 0, padding, 0);
         } else {
             setPadding(0, 0, 0, 0);
         }
 
-        final float ratio = (float) desiredTilesHeight / (float) desiredTileWidth;
-        final int tilesWidth = (w - (tiles * tileMargin) - tileMargin) / tiles;
-        final int tilesHeight = (int) (ratio * tilesWidth);
+        final int tilesSize = (w - (tiles * tileMargin) - tileMargin) / tiles;
 
-        adapter.setTileSize(tiles, tilesWidth, tilesHeight);
+        adapter.setTileSize(tiles, tilesSize);
     }
 
     private class HighlightsCallbacks implements LoaderManager.LoaderCallbacks<List<Highlight>> {
         @Override
         public Loader<List<Highlight>> onCreateLoader(int id, Bundle args) {
             return new HighlightsLoader(getContext(), HIGHLIGHTS_CANDIDATES, HIGHLIGHTS_LIMIT);
         }
 
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
@@ -33,35 +33,33 @@ public class StreamRecyclerAdapter exten
     private static final String LOGTAG = StringUtils.safeSubstring("Gecko" + StreamRecyclerAdapter.class.getSimpleName(), 0, 23);
 
     private Cursor topSitesCursor;
 
     private HomePager.OnUrlOpenListener onUrlOpenListener;
     private HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener;
 
     private int tiles;
-    private int tilesWidth;
-    private int tilesHeight;
+    private int tilesSize;
 
     private List<Highlight> highlights;
 
     public StreamRecyclerAdapter() {
         setHasStableIds(true);
 
         highlights = Collections.emptyList();
     }
 
     void setOnUrlOpenListeners(HomePager.OnUrlOpenListener onUrlOpenListener, HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener) {
         this.onUrlOpenListener = onUrlOpenListener;
         this.onUrlOpenInBackgroundListener = onUrlOpenInBackgroundListener;
     }
 
-    public void setTileSize(int tiles, int tilesWidth, int tilesHeight) {
-        this.tilesWidth = tilesWidth;
-        this.tilesHeight = tilesHeight;
+    public void setTileSize(int tiles, int tilesSize) {
+        this.tilesSize = tilesSize;
         this.tiles = tiles;
 
         notifyDataSetChanged();
     }
 
     @Override
     public int getItemViewType(int position) {
         if (position == 0) {
@@ -107,19 +105,19 @@ public class StreamRecyclerAdapter exten
     public void onBindViewHolder(StreamItem holder, int position) {
         int type = getItemViewType(position);
 
         if (type == HighlightItem.LAYOUT_ID) {
             final int actualPosition = translatePositionToCursor(position);
 
             final Highlight highlight = highlights.get(actualPosition);
 
-            ((HighlightItem) holder).bind(highlight, actualPosition, tilesWidth,  tilesHeight);
+            ((HighlightItem) holder).bind(highlight, actualPosition, tilesSize);
         } else if (type == TopPanel.LAYOUT_ID) {
-            ((TopPanel) holder).bind(topSitesCursor, tiles, tilesWidth, tilesHeight);
+            ((TopPanel) holder).bind(topSitesCursor, tiles, tilesSize);
         }
     }
 
     @Override
     public void onItemClicked(RecyclerView recyclerView, int position, View v) {
         if (getItemViewType(position) != HighlightItem.LAYOUT_ID) {
             // Headers (containing topsites and/or the highlights title) do their own click handling as needed
             return;
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightItem.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/HighlightItem.java
@@ -33,16 +33,17 @@ import org.mozilla.gecko.widget.FaviconV
 import java.lang.ref.WeakReference;
 import java.util.UUID;
 import java.util.concurrent.Future;
 
 public class HighlightItem extends StreamItem implements IconCallback {
     private static final String LOGTAG = "GeckoHighlightItem";
 
     public static final int LAYOUT_ID = R.layout.activity_stream_card_history_item;
+    private static final double SIZE_RATIO = 0.75;
 
     private Highlight highlight;
     private int position;
 
     private final FaviconView pageIconView;
     private final TextView pageTitleView;
     private final TextView pageSourceView;
     private final TextView pageDomainView;
@@ -93,27 +94,27 @@ public class HighlightItem extends Strea
                         extras.build()
                 );
             }
         });
 
         ViewUtil.enableTouchRipple(menuButton);
     }
 
-    public void bind(Highlight highlight, int position, int tilesWidth, int tilesHeight) {
+    public void bind(Highlight highlight, int position, int tilesWidth) {
         this.highlight = highlight;
         this.position = position;
 
         final String backendHightlightTitle = highlight.getTitle();
         final String uiHighlightTitle = !TextUtils.isEmpty(backendHightlightTitle) ? backendHightlightTitle : highlight.getUrl();
         pageTitleView.setText(uiHighlightTitle);
 
         ViewGroup.LayoutParams layoutParams = pageIconView.getLayoutParams();
-        layoutParams.width = tilesWidth - tilesMargin;
-        layoutParams.height = tilesHeight;
+        layoutParams.width = tilesWidth;
+        layoutParams.height = (int) Math.floor(tilesWidth * SIZE_RATIO);
         pageIconView.setLayoutParams(layoutParams);
 
         updateUiForSource(highlight.getSource());
         updatePageDomain();
 
         if (ongoingIconLoad != null) {
             ongoingIconLoad.cancel(true);
         }
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanel.java
@@ -48,27 +48,26 @@ public class TopPanel extends StreamItem
     public TopPanel(View itemView, HomePager.OnUrlOpenListener onUrlOpenListener, HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener) {
         super(itemView);
 
         topSitesPager = (ViewPager) itemView.findViewById(R.id.topsites_pager);
         topSitesPager.setAdapter(new TopSitesPagerAdapter(itemView.getContext(), onUrlOpenListener, onUrlOpenInBackgroundListener));
         topSitesPager.addOnPageChangeListener(swipeListener);
     }
 
-    public void bind(Cursor cursor, int tiles, int tilesWidth, int tilesHeight) {
+    public void bind(Cursor cursor, int tiles, int tilesSize) {
         final TopSitesPagerAdapter adapter = (TopSitesPagerAdapter) topSitesPager.getAdapter();
-        adapter.setTilesSize(tiles, tilesWidth, tilesHeight);
+        adapter.setTilesSize(tiles, tilesSize);
         adapter.swapCursor(cursor);
 
         final Resources resources = itemView.getResources();
         final int tilesMargin = resources.getDimensionPixelSize(R.dimen.activity_stream_base_margin);
-        final int textHeight = resources.getDimensionPixelSize(R.dimen.activity_stream_top_sites_text_height);
 
         ViewGroup.LayoutParams layoutParams = topSitesPager.getLayoutParams();
-        layoutParams.height = tilesHeight + tilesMargin + textHeight;
+        layoutParams.height = tilesSize + tilesMargin * 2;
         topSitesPager.setLayoutParams(layoutParams);
 
         // Reset the page position: binding a new Cursor means that topsites reverts to the first page,
         // no event is sent in that case, but we need to know the right page number to send correct
         // page swipe events
         swipeListener.currentPosition = 0;
     }
 }
\ No newline at end of file
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPageAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPageAdapter.java
@@ -25,33 +25,29 @@ import org.mozilla.gecko.widget.Recycler
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.List;
 
 /* package-local */ class TopSitesPageAdapter extends RecyclerView.Adapter<TopSitesCard> implements RecyclerViewClickSupport.OnItemClickListener {
     private List<TopSite> topSites;
     private final int pageNumber;
     private int tiles;
-    private int tilesWidth;
-    private int tilesHeight;
-    private int textHeight;
+    private int tilesSize;
 
     private final HomePager.OnUrlOpenListener onUrlOpenListener;
     private final HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener;
 
-    /* package-local */ TopSitesPageAdapter(Context context, int pageNumber, int tiles, int tilesWidth, int tilesHeight,
+    /* package-local */ TopSitesPageAdapter(Context context, int pageNumber, int tiles, int tilesSize,
                                HomePager.OnUrlOpenListener onUrlOpenListener, HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener) {
         setHasStableIds(true);
 
         this.topSites = new ArrayList<>();
         this.pageNumber = pageNumber;
         this.tiles = tiles;
-        this.tilesWidth = tilesWidth;
-        this.tilesHeight = tilesHeight;
-        this.textHeight = context.getResources().getDimensionPixelSize(R.dimen.activity_stream_top_sites_text_height);
+        this.tilesSize = tilesSize;
 
         this.onUrlOpenListener = onUrlOpenListener;
         this.onUrlOpenInBackgroundListener = onUrlOpenInBackgroundListener;
     }
 
     /**
      * @param startIndex The first item that this topsites group should show. This item, and the following
      * 3 items will be displayed by this adapter.
@@ -96,20 +92,21 @@ import java.util.List;
         holder.bind(topSites.get(position), getTopSiteAbsolutePosition(position));
     }
 
     @Override
     public TopSitesCard onCreateViewHolder(ViewGroup parent, int viewType) {
         final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
 
         final FrameLayout card = (FrameLayout) inflater.inflate(R.layout.activity_stream_topsites_card, parent, false);
+        final int tilesMargin = parent.getResources().getDimensionPixelSize(R.dimen.activity_stream_base_margin);
 
         ViewGroup.LayoutParams layoutParams = card.getLayoutParams();
-        layoutParams.width = tilesWidth;
-        layoutParams.height = tilesHeight + textHeight;
+        layoutParams.width = tilesSize;
+        layoutParams.height = tilesSize;
         card.setLayoutParams(layoutParams);
 
         return new TopSitesCard(card, onUrlOpenListener, onUrlOpenInBackgroundListener);
     }
 
     @Override
     public int getItemCount() {
         return topSites.size();
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPagerAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPagerAdapter.java
@@ -23,18 +23,17 @@ import java.util.List;
  * The primary / top-level TopSites adapter: it handles the ViewPager, and also handles
  * all lower-level Adapters that populate the individual topsite items.
  */
 public class TopSitesPagerAdapter extends PagerAdapter {
     public static final int PAGES = 4;
     public static final int SUGGESTED_SITES_MAX_PAGES = 2;
 
     private int tiles;
-    private int tilesWidth;
-    private int tilesHeight;
+    private int tilesSize;
 
     private final List<TopSitesPage> pages;
 
     private final Context context;
     private final HomePager.OnUrlOpenListener onUrlOpenListener;
     private final HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener;
 
     private int count = 0;
@@ -44,19 +43,18 @@ public class TopSitesPagerAdapter extend
                                 HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener) {
         pages = new ArrayList<>(PAGES);
 
         this.context = context;
         this.onUrlOpenListener = onUrlOpenListener;
         this.onUrlOpenInBackgroundListener = onUrlOpenInBackgroundListener;
     }
 
-    public void setTilesSize(int tiles, int tilesWidth, int tilesHeight) {
-        this.tilesWidth = tilesWidth;
-        this.tilesHeight = tilesHeight;
+    public void setTilesSize(int tiles, int tilesSize) {
+        this.tilesSize = tilesSize;
         this.tiles = tiles;
     }
 
     @Override
     public int getCount() {
         return Math.min(count, 4);
     }
 
@@ -109,18 +107,17 @@ public class TopSitesPagerAdapter extend
 
         if (pageDelta > 0) {
             final LayoutInflater inflater = LayoutInflater.from(context);
             for (int i = 0; i < pageDelta; i++) {
                 final TopSitesPage page = (TopSitesPage) inflater.inflate(R.layout.activity_stream_topsites_page, null, false);
 
                 page.setTiles(tiles);
                 final TopSitesPageAdapter adapter = new TopSitesPageAdapter(
-                        context, i, tiles, tilesWidth, tilesHeight,
-                        onUrlOpenListener, onUrlOpenInBackgroundListener);
+                        context, i, tiles, tilesSize, onUrlOpenListener, onUrlOpenInBackgroundListener);
                 page.setAdapter(adapter);
                 RecyclerViewClickSupport.addTo(page).setOnItemClickListener(adapter);
                 pages.add(page);
             }
         } else if (pageDelta < 0) {
             for (int i = 0; i > pageDelta; i--) {
                 final TopSitesPage page = pages.get(pages.size() - 1);
 
--- a/mobile/android/base/java/org/mozilla/gecko/icons/loader/IconGenerator.java
+++ b/mobile/android/base/java/org/mozilla/gecko/icons/loader/IconGenerator.java
@@ -36,17 +36,16 @@ public class IconGenerator implements Ic
             0xFF4C009C,
             0xFF002E9C,
             0xFF009EC2,
             0xFF009D02,
             0xFF51AB00,
             0xFF36385A,
     };
 
-    private static final int TEXT_SIZE_DP = 12;
     @Override
     public IconResponse load(IconRequest request) {
         if (request.getIconCount() > 1) {
             // There are still other icons to try. We will only generate an icon if there's only one
             // icon left and all previous loaders have failed (assuming this is the last one).
             return null;
         }
 
@@ -70,17 +69,19 @@ public class IconGenerator implements Ic
         paint.setColor(color);
 
         canvas.drawRoundRect(new RectF(0, 0, widthAndHeight, widthAndHeight), roundedCorners, roundedCorners, paint);
 
         paint.setColor(Color.WHITE);
 
         final String character = getRepresentativeCharacter(pageURL);
 
-        final float textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, TEXT_SIZE_DP, context.getResources().getDisplayMetrics());
+        // The text size is calculated dynamically based on the target icon size (1/8th). For an icon
+        // size of 112dp we'd use a text size of 14dp (112 / 8).
+        final float textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, widthAndHeight / 8, context.getResources().getDisplayMetrics());
 
         paint.setTextAlign(Paint.Align.CENTER);
         paint.setTextSize(textSize);
         paint.setAntiAlias(true);
 
         canvas.drawText(character,
                 canvas.getWidth() / 2,
                 (int) ((canvas.getHeight() / 2) - ((paint.descent() + paint.ascent()) / 2)),
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/icons/TestIconRequestBuilder.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/icons/TestIconRequestBuilder.java
@@ -169,17 +169,17 @@ public class TestIconRequestBuilder {
     public void testForLauncherIcon() {
         // This code will call into GeckoAppShell to determine the launcher icon size for this configuration
         GeckoAppShell.setApplicationContext(RuntimeEnvironment.application);
 
         IconRequest request = Icons.with(RuntimeEnvironment.application)
                 .pageUrl(TEST_PAGE_URL_1)
                 .build();
 
-        Assert.assertEquals(32, request.getTargetSize());
+        Assert.assertEquals(112, request.getTargetSize());
 
         request.modify()
                 .forLauncherIcon()
                 .deferBuild();
 
         Assert.assertEquals(48, request.getTargetSize());
     }