Bug 1039738 - Correct private tabs list appearance. r=bnicholson
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 16 Jul 2014 16:35:49 -0700
changeset 216517 a794759a5272b1edd8cef2edb33b5d68967242d1
parent 216516 70c675963e761056edc2a9e7c87e8b250c56dfbe
child 216518 e69dde0fa09fe9b35e5561ecfc322faa610bd028
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs1039738
milestone33.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 1039738 - Correct private tabs list appearance. r=bnicholson
mobile/android/base/resources/layout/private_tabs_panel.xml
mobile/android/base/tabspanel/PrivateTabsPanel.java
--- a/mobile/android/base/resources/layout/private_tabs_panel.xml
+++ b/mobile/android/base/resources/layout/private_tabs_panel.xml
@@ -1,26 +1,19 @@
 <?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/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
-   <FrameLayout android:layout_width="match_parent"
+    <ScrollView android:layout_width="match_parent"
                 android:layout_height="match_parent">
 
-        <org.mozilla.gecko.tabspanel.TabsTray android:id="@+id/private_tabs_tray"
-                                              style="@style/TabsList"
-                                              android:layout_width="match_parent"
-                                              android:layout_height="match_parent"
-                                              android:choiceMode="singleChoice"
-                                              gecko:tabs="tabs_private"/>
-
         <LinearLayout android:id="@+id/private_tabs_empty"
                       style="@style/TabsPanelFrame.PrivateTabs"
                       android:layout_width="match_parent"
                       android:layout_height="match_parent">
 
             <LinearLayout style="@style/TabsPanelSection.PrivateTabs.Header"
                           android:layout_width="match_parent"
                           android:layout_height="wrap_content">
@@ -45,11 +38,20 @@
                           style="@style/TabsPanelItem.TextAppearance.Linkified.LearnMore"
                           android:layout_width="match_parent"
                           android:text="@string/private_tabs_panel_learn_more"/>
 
             </LinearLayout>
 
         </LinearLayout>
 
-    </FrameLayout>
+    </ScrollView>
+
+    <!-- Note: for an unknown reason, scrolling in the TabsTray
+         does not work unless it is laid out after the empty view. -->
+    <org.mozilla.gecko.tabspanel.TabsTray android:id="@+id/private_tabs_tray"
+                                          style="@style/TabsList"
+                                          android:layout_width="match_parent"
+                                          android:layout_height="match_parent"
+                                          android:choiceMode="singleChoice"
+                                          gecko:tabs="tabs_private"/>
 
 </merge>
--- a/mobile/android/base/tabspanel/PrivateTabsPanel.java
+++ b/mobile/android/base/tabspanel/PrivateTabsPanel.java
@@ -12,25 +12,24 @@ import org.mozilla.gecko.R;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.tabspanel.TabsPanel.CloseAllPanelView;
 
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.FrameLayout;
-import android.widget.ScrollView;
 
 /**
  * A container that wraps the private tabs {@link android.widget.AdapterView} and empty
  * {@link android.view.View} to manage both of their visibility states by changing the visibility of
  * this container as calling {@link android.widget.AdapterView#setVisibility} does not affect the
  * empty View's visibility.
  */
-class PrivateTabsPanel extends ScrollView implements CloseAllPanelView {
+class PrivateTabsPanel extends FrameLayout implements CloseAllPanelView {
     private TabsPanel tabsPanel;
     private TabsTray tabsTray;
 
     public PrivateTabsPanel(Context context, AttributeSet attrs) {
         super(context, attrs);
 
         LayoutInflater.from(context).inflate(R.layout.private_tabs_panel, this);
         tabsTray = (TabsTray) findViewById(R.id.private_tabs_tray);