Bug 1386755 - Enable compact tabs by default. r?mcomella draft
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 02 Aug 2017 20:21:03 +0200
changeset 619847 fca155cbd2a0b9b23d93eef9ba0f46bf4eb771f9
parent 619581 52285ea5e54c73d3ed824544cef2ee3f195f05e6
child 640523 60dda95b37c63bbc07e68ce5fd3d6e7f2ab8667b
push id71847
push users.kaspari@gmail.com
push dateWed, 02 Aug 2017 18:21:33 +0000
reviewersmcomella
bugs1386755
milestone57.0a1
Bug 1386755 - Enable compact tabs by default. r?mcomella MozReview-Commit-ID: Eeue25LE8eJ
mobile/android/app/src/main/res/xml/preferences_general.xml
mobile/android/base/java/org/mozilla/gecko/Experiments.java
mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
--- a/mobile/android/app/src/main/res/xml/preferences_general.xml
+++ b/mobile/android/app/src/main/res/xml/preferences_general.xml
@@ -30,13 +30,13 @@
 
     <SwitchPreference android:key="android.not_a_preference.tab_queue"
                       android:title="@string/pref_tab_queue_title"
                       android:summary="@string/pref_tab_queue_summary"
                       android:defaultValue="false" />
 
     <SwitchPreference android:key="android.not_a_preference.compact_tabs"
                       android:title="@string/pref_compact_tabs"
-                      android:summary="@string/pref_compact_tabs_summary" />
-
+                      android:summary="@string/pref_compact_tabs_summary"
+                      android:defaultValue="true" />
 
 </PreferenceScreen>
 
--- a/mobile/android/base/java/org/mozilla/gecko/Experiments.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Experiments.java
@@ -63,19 +63,16 @@ public class Experiments {
     public static final String ACTIVITY_STREAM_SETTING = "activity-stream-setting";
 
     // Enable Activity stream by default for users in the "opt out" group.
     public static final String ACTIVITY_STREAM_OPT_OUT = "activity-stream-opt-out";
 
     // Show AddOns menu-item in top level menu
     public static final String TOP_ADDONS_MENU = "top-addons-menu";
 
-    // Tabs tray: Arrange tabs in two columns in portrait mode
-    public static final String COMPACT_TABS = "compact-tabs";
-
     // Enable full bookmark management(full-page dialog, bookmark/folder modification, etc.)
     public static final String FULL_BOOKMARK_MANAGEMENT = "full-bookmark-management";
 
     // Enable Leanplum SDK
     public static final String LEANPLUM = "leanplum-start";
 
     // Enable processing of background telemetry.
     public static final String ENABLE_PROCESSING_BACKGROUND_TELEMETRY = "process-background-telemetry";
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -881,22 +881,16 @@ public class GeckoPreferences
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 } else if (PREFS_COMPACT_TABS.equals(key)) {
                     if (HardwareUtils.isTablet()) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
-                    } else {
-                        final boolean value = GeckoSharedPrefs.forApp(this).getBoolean(GeckoPreferences.PREFS_COMPACT_TABS,
-                                SwitchBoard.isInExperiment(this, Experiments.COMPACT_TABS));
-
-                        pref.setDefaultValue(value);
-                        ((SwitchPreference) pref).setChecked(value);
                     }
                 }
 
                 // Some Preference UI elements are not actually preferences,
                 // but they require a key to work correctly. For example,
                 // "Clear private data" requires a key for its state to be
                 // saved when the orientation changes. It uses the
                 // "android.not_a_preference.privacy.clear" key - which doesn't
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
@@ -85,18 +85,17 @@ public class TabsPanel extends LinearLay
                 context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
     }
 
     public static View createTabsLayout(final Context context, final AttributeSet attrs) {
         if (tabletOrLandscapeMode(context)) {
             return new AutoFitTabsGridLayout(context, attrs);
         } else {
             // Phone in portrait mode.
-            if (GeckoSharedPrefs.forApp(context).getBoolean(GeckoPreferences.PREFS_COMPACT_TABS,
-                    SwitchBoard.isInExperiment(context, Experiments.COMPACT_TABS))) {
+            if (GeckoSharedPrefs.forApp(context).getBoolean(GeckoPreferences.PREFS_COMPACT_TABS, true)) {
                 return new CompactTabsGridLayout(context, attrs);
             } else {
                 return new TabsListLayout(context, attrs);
             }
         }
     }
 
     private final Context mContext;