Backed out changeset e01dbdf8a218 (bug 1016613)
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 09 Jul 2014 16:26:49 -0700
changeset 193280 d4f97168453a91922d42dd177db6ca631cd228b0
parent 193279 91ce45738633f9b301124300a1bd8d94f27abec8
child 193281 b576014a4876104e47f60109235e06e2631774af
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1016613
milestone33.0a1
backs oute01dbdf8a21829a811dce89265a7490282d74d8b
Backed out changeset e01dbdf8a218 (bug 1016613)
mobile/android/base/resources/layout-large-land-v11/tabs_panel.xml
mobile/android/base/resources/layout/remote_tabs_panel_view.xml
mobile/android/base/resources/layout/tabs_panel.xml
mobile/android/base/tabspanel/TabsPanel.java
--- a/mobile/android/base/resources/layout-large-land-v11/tabs_panel.xml
+++ b/mobile/android/base/resources/layout-large-land-v11/tabs_panel.xml
@@ -41,20 +41,21 @@
                                               gecko:tabs="tabs_normal"/>
 
         <org.mozilla.gecko.tabspanel.PrivateTabsPanel
                 android:id="@+id/private_tabs_panel"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:visibility="gone"/>
 
-        <ViewStub android:id="@+id/remote_tabs_panel_stub"
-                  android:layout="@layout/remote_tabs_panel_view"
-                  android:layout_width="match_parent"
-                  android:layout_height="match_parent"/>
+        <org.mozilla.gecko.tabspanel.RemoteTabsPanel
+                android:id="@+id/remote_tabs"
+                android:layout_height="match_parent"
+                android:layout_width="match_parent"
+                android:visibility="gone"/>
 
     </view>
 
     <RelativeLayout android:id="@+id/tabs_panel_footer"
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/browser_toolbar_height">
 
         <view class="org.mozilla.gecko.tabspanel.TabsPanel$TabsPanelToolbar"
deleted file mode 100644
--- a/mobile/android/base/resources/layout/remote_tabs_panel_view.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?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/. -->
-
-<org.mozilla.gecko.tabspanel.RemoteTabsPanel xmlns:android="http://schemas.android.com/apk/res/android"
-                                             android:id="@+id/remote_tabs_panel"
-                                             android:layout_width="match_parent"
-                                             android:layout_height="match_parent"/>
--- a/mobile/android/base/resources/layout/tabs_panel.xml
+++ b/mobile/android/base/resources/layout/tabs_panel.xml
@@ -40,16 +40,17 @@
                                               gecko:tabs="tabs_normal"/>
 
         <org.mozilla.gecko.tabspanel.PrivateTabsPanel
                 android:id="@+id/private_tabs_panel"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:visibility="gone"/>
 
+        <org.mozilla.gecko.tabspanel.RemoteTabsPanel
+                android:id="@+id/remote_tabs"
+                android:layout_height="match_parent"
+                android:layout_width="match_parent"
+                android:visibility="gone"/>
 
-        <ViewStub android:id="@+id/remote_tabs_panel_stub"
-                  android:layout="@layout/remote_tabs_panel_view"
-                  android:layout_width="match_parent"
-                  android:layout_height="match_parent"/>
     </view>
 
 </merge>
--- a/mobile/android/base/tabspanel/TabsPanel.java
+++ b/mobile/android/base/tabspanel/TabsPanel.java
@@ -26,17 +26,16 @@ import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
 import android.os.Build;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
-import android.view.ViewStub;
 import android.widget.Button;
 import android.widget.FrameLayout;
 import android.widget.ImageButton;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 
 public class TabsPanel extends LinearLayout
                        implements GeckoPopupMenu.OnMenuItemClickListener,
@@ -113,17 +112,16 @@ public class TabsPanel extends LinearLay
         LayoutInflater.from(context).inflate(R.layout.tabs_panel, this);
         initialize();
 
         mAppStateListener = new AppStateListener() {
             @Override
             public void onResume() {
                 if (mPanel == mPanelRemote) {
                     // Refresh the remote panel.
-                    initializeRemotePanelView();
                     mPanelRemote.show();
                 }
             }
 
             @Override
             public void onOrientationChanged() {
                 // Remote panel is already refreshed by chrome refresh.
             }
@@ -138,16 +136,19 @@ public class TabsPanel extends LinearLay
         mTabsContainer = (TabsListContainer) findViewById(R.id.tabs_container);
 
         mPanelNormal = (PanelView) findViewById(R.id.normal_tabs);
         mPanelNormal.setTabsPanel(this);
 
         mPanelPrivate = (PanelView) findViewById(R.id.private_tabs_panel);
         mPanelPrivate.setTabsPanel(this);
 
+        mPanelRemote = (PanelView) findViewById(R.id.remote_tabs);
+        mPanelRemote.setTabsPanel(this);
+
         mFooter = (RelativeLayout) findViewById(R.id.tabs_panel_footer);
 
         mAddTab = (ImageButton) findViewById(R.id.add_tab);
         mAddTab.setOnClickListener(new Button.OnClickListener() {
             @Override
             public void onClick(View v) {
                 TabsPanel.this.addTab();
             }
@@ -407,17 +408,16 @@ public class TabsPanel extends LinearLay
         switch (panelToShow) {
             case NORMAL_TABS:
                 mPanel = mPanelNormal;
                 break;
             case PRIVATE_TABS:
                 mPanel = mPanelPrivate;
                 break;
             case REMOTE_TABS:
-                initializeRemotePanelView();
                 mPanel = mPanelRemote;
                 break;
 
             default:
                 throw new IllegalArgumentException("Unknown panel type " + panelToShow);
         }
         mPanel.show();
 
@@ -556,16 +556,9 @@ public class TabsPanel extends LinearLay
      */
     public Drawable getIconDrawable(Panel panel) {
         return mTabWidget.getIconDrawable(panel.ordinal());
     }
 
     public void setIconDrawable(Panel panel, int resource) {
         mTabWidget.setIconDrawable(panel.ordinal(), resource);
     }
-
-    private void initializeRemotePanelView() {
-        if (mPanelRemote == null) {
-            mPanelRemote = (PanelView) ((ViewStub) findViewById(R.id.remote_tabs_panel_stub)).inflate();
-            mPanelRemote.setTabsPanel(TabsPanel.this);
-        }
-    }
 }