Bug 1214602 - Bring back single column layout for tabs tray. r=margaret
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 19 Oct 2015 11:23:43 +0200
changeset 303492 cd5a178c7a85b916cdaa26876d1439363938b58d
parent 303491 429dbd2ac169941477d588b75f6f98c3db616b38
child 303493 c8ec00c5d04fab4dfc576dde62536272ff29e4fd
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1214602, 1204917
milestone44.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 1214602 - Bring back single column layout for tabs tray. r=margaret This patch will use the single column list on phones in portrait mode again. In landscape mode the multi column grid will be used. In addition to that this patch removes the Nightly flag (Bug 1204917).
mobile/android/base/tabs/TabsPanel.java
--- a/mobile/android/base/tabs/TabsPanel.java
+++ b/mobile/android/base/tabs/TabsPanel.java
@@ -21,16 +21,17 @@ import org.mozilla.gecko.lwt.Lightweight
 import org.mozilla.gecko.lwt.LightweightThemeDrawable;
 import org.mozilla.gecko.restrictions.Restriction;
 import org.mozilla.gecko.util.ColorUtils;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.widget.GeckoPopupMenu;
 import org.mozilla.gecko.widget.IconTabWidget;
 
 import android.content.Context;
+import android.content.res.Configuration;
 import android.content.res.Resources;
 import android.graphics.Rect;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
@@ -69,17 +70,19 @@ public class TabsPanel extends LinearLay
     }
 
     public interface TabsLayoutChangeListener {
         void onTabsLayoutChange(int width, int height);
     }
 
 
     public static View createTabsLayout(final Context context, final AttributeSet attrs) {
-        if (HardwareUtils.isTablet() || AppConstants.NIGHTLY_BUILD) {
+        final boolean isLandscape = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
+
+        if (HardwareUtils.isTablet() || isLandscape) {
             return new TabsGridLayout(context, attrs);
         } else {
             return new TabsListLayout(context, attrs);
         }
     }
 
     private final Context mContext;
     private final GeckoApp mActivity;