Bug 1204875 - Hide Tabs Panel thumbnail height change behind nightly flag; r=mfinkle
authorMartyn Haigh <mhaigh@mozilla.org>
Tue, 15 Sep 2015 15:46:23 +0100
changeset 262567 5afeefb4e7f1ff82551a08bdefb9d77b3f378840
parent 262566 576d864628975f7aa10566b7f3c9b6e2c4dae796
child 262568 6c8434091522526df255f1944151e263d8c93e80
push id29376
push userkwierso@gmail.com
push dateTue, 15 Sep 2015 23:44:10 +0000
treeherdermozilla-central@a88abc5e76ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1204875
milestone43.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 1204875 - Hide Tabs Panel thumbnail height change behind nightly flag; r=mfinkle
mobile/android/base/ThumbnailHelper.java
mobile/android/base/tabs/TabsPanelThumbnailView.java
--- a/mobile/android/base/ThumbnailHelper.java
+++ b/mobile/android/base/ThumbnailHelper.java
@@ -27,17 +27,17 @@ import java.util.concurrent.atomic.Atomi
  * applied between thumbnail processing. This allows a single thumbnail buffer to
  * be used for all thumbnails.
  */
 public final class ThumbnailHelper {
     private static final String LOGTAG = "GeckoThumbnailHelper";
 
     public static final float TABS_PANEL_THUMBNAIL_ASPECT_RATIO = 0.8333333f;
     public static final float TOP_SITES_THUMBNAIL_ASPECT_RATIO = 0.571428571f;  // this is a 4:7 ratio (as per UX decision)
-    private static final float THUMBNAIL_ASPECT_RATIO;
+    public static final float THUMBNAIL_ASPECT_RATIO;
 
     static {
       // As we only want to generate one thumbnail for each tab, we calculate the
       // largest aspect ratio required and create the thumbnail based off that.
       // Any views with a smaller aspect ratio will use a cropped version of the
       // same image.
       THUMBNAIL_ASPECT_RATIO = Math.max(TABS_PANEL_THUMBNAIL_ASPECT_RATIO, TOP_SITES_THUMBNAIL_ASPECT_RATIO);
     }
--- a/mobile/android/base/tabs/TabsPanelThumbnailView.java
+++ b/mobile/android/base/tabs/TabsPanelThumbnailView.java
@@ -1,15 +1,16 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * 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/. */
 
 package org.mozilla.gecko.tabs;
 
+import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.ThumbnailHelper;
 import org.mozilla.gecko.widget.CropImageView;
 
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.util.AttributeSet;
 
@@ -29,17 +30,21 @@ public class TabsPanelThumbnailView exte
     }
 
     public TabsPanelThumbnailView(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
     }
 
     @Override
     protected float getAspectRatio() {
-        return ThumbnailHelper.TABS_PANEL_THUMBNAIL_ASPECT_RATIO;
+        if (AppConstants.NIGHTLY_BUILD) {
+            return ThumbnailHelper.TABS_PANEL_THUMBNAIL_ASPECT_RATIO;
+        } else {
+            return ThumbnailHelper.TOP_SITES_THUMBNAIL_ASPECT_RATIO;
+        }
     }
 
     @Override
     public void setImageDrawable(Drawable drawable) {
         boolean resize = true;
 
         if (drawable == null) {
             drawable = getResources().getDrawable(R.drawable.tab_panel_tab_background);