Bug 1100464 - Add back button to top left of the tabs panel. r=lucasr, a=sledru
authorMartyn Haigh <martyn.haigh@gmail.com>
Tue, 09 Dec 2014 17:07:26 +0000
changeset 242404 447fb28e81cf49eb6f9f7575aa7e9744ae9a7ffd
parent 242403 409a02246b8a93c38b4d6fb5b7fcca17de8371e8
child 242405 e8654d5c97538a98d49dc95d43b13b0eea4d84f9
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, sledru
bugs1100464
milestone36.0a2
Bug 1100464 - Add back button to top left of the tabs panel. r=lucasr, a=sledru
mobile/android/base/newtablet/res/drawable-large-hdpi-v11/new_tablet_nav_back.png
mobile/android/base/newtablet/res/drawable-large-mdpi-v11/new_tablet_nav_back.png
mobile/android/base/newtablet/res/drawable-large-xhdpi-v11/new_tablet_nav_back.png
mobile/android/base/newtablet/res/drawable-large-xxhdpi-v11/new_tablet_nav_back.png
mobile/android/base/newtablet/res/layout-large-v11/new_tablet_tabs_panel_back_button.xml
mobile/android/base/resources/layout/tabs_panel_default.xml
mobile/android/base/resources/values/layout.xml
mobile/android/base/tabs/TabsPanel.java
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1754c44edc86aa78dfca1f22413f295002cec066
GIT binary patch
literal 808
zc$@(!1K0eCP)<h;3K|Lk000e1NJLTq000{R000{Z1^@s6jnwp200001b5ch_0Itp)
z=>Px%;z>k7R7ef2R?lk_K@^_ZZcPhHQ7QgF^d#QY=urrQAR=^kldVBeEDDOWcu)(1
zdI*$);Gu|M$t6Kct;BAUP4rSd=}E-W*8iY*5QUy9p)uL<o63}AcaohL2bMSUeth4&
zo%d#!k`9OCIESd-`-&18WsE&rSy~)VrBa>>jIQD&d~&XPgfi_tCFB6tQA%$gJ$`aK
zrZ<F7JE^rZHrnQ0H>wluBc*?dgbnMf$V>?bn+zY0<DQ~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FkpN)$PBkyuO^zT@&1Y;qR?8yAJ4<R3>g-$M|}U*sg8^#%&+w%5Hj{bjdS+ftRD<
qs}ni#dkc<ic=CDU`{z@1Zrdb06Ifp5FLeTxfjwRQT-G@yGywo@#5Y3#
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/newtablet/res/layout-large-v11/new_tablet_tabs_panel_back_button.xml
@@ -0,0 +1,14 @@
+<?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/. -->
+
+<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
+             android:id="@+id/nav_back"
+             android:layout_width="@dimen/tabs_panel_indicator_width"
+             android:layout_height="match_parent"
+             android:minWidth="@dimen/tabs_panel_indicator_width"
+             android:src="@drawable/new_tablet_nav_back"
+             android:contentDescription="@string/back"
+             android:background="@drawable/action_bar_button_inverse"/>
+
--- a/mobile/android/base/resources/layout/tabs_panel_default.xml
+++ b/mobile/android/base/resources/layout/tabs_panel_default.xml
@@ -10,16 +10,21 @@
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/browser_toolbar_height">
 
         <view class="org.mozilla.gecko.tabs.TabsPanel$TabsPanelToolbar"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:background="@color/background_tabs">
 
+            <ViewStub android:id="@+id/nav_back_stub"
+                      android:layout="@layout/new_tablet_tabs_panel_back_button"
+                      android:layout_width="wrap_content"
+                      android:layout_height="match_parent"/>
+
             <org.mozilla.gecko.widget.IconTabWidget android:id="@+id/tab_widget"
                                                     android:layout_width="wrap_content"
                                                     android:layout_height="match_parent"
                                                     android:tabStripEnabled="false"
                                                     android:divider="@drawable/tab_indicator_divider"
                                                     android:layout="@layout/tabs_panel_indicator"/>
 
             <View android:layout_width="0dip"
--- a/mobile/android/base/resources/values/layout.xml
+++ b/mobile/android/base/resources/values/layout.xml
@@ -4,9 +4,10 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
     <item type="layout" name="tabs_panel">@layout/tabs_panel_default</item>
     <item type="layout" name="tabs_layout_item_view">@layout/tabs_item_row</item>
     <item type="layout" name="new_tablet_browser_toolbar">@null</item>
     <item type="layout" name="new_tablet_tab_strip">@null</item>
     <item type="layout" name="new_tablet_tabs_item_cell">@null</item>
+    <item type="layout" name="new_tablet_tabs_panel_back_button">@null</item>
 </resources>
--- a/mobile/android/base/tabs/TabsPanel.java
+++ b/mobile/android/base/tabs/TabsPanel.java
@@ -25,16 +25,17 @@ import android.content.Context;
 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;
+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,
@@ -83,16 +84,17 @@ public class TabsPanel extends LinearLay
     private PanelView mPanelNormal;
     private PanelView mPanelPrivate;
     private RelativeLayout mFooter;
     private TabsLayoutChangeListener mLayoutChangeListener;
 
     private IconTabWidget mTabWidget;
     private static ImageButton mMenuButton;
     private static ImageButton mAddTab;
+    private ImageButton mNavBackButton;
 
     private Panel mCurrentPanel;
     private boolean mIsSideBar;
     private boolean mVisible;
     private boolean mHeaderVisible;
 
     private final GeckoPopupMenu mPopupMenu;
 
@@ -158,16 +160,27 @@ public class TabsPanel extends LinearLay
 
         mMenuButton = (ImageButton) findViewById(R.id.menu);
         mMenuButton.setOnClickListener(new Button.OnClickListener() {
             @Override
             public void onClick(View view) {
                 showMenu();
             }
         });
+
+        if(NewTabletUI.isEnabled(getContext())) {
+            ViewStub backButtonStub = (ViewStub) findViewById(R.id.nav_back_stub);
+            mNavBackButton = (ImageButton) backButtonStub.inflate( );
+            mNavBackButton.setOnClickListener(new Button.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    mActivity.onBackPressed();
+                }
+            });
+        }
     }
 
     public void showMenu() {
         final Menu menu = mPopupMenu.getMenu();
 
         // Each panel has a "+" shortcut button, so don't show it for that panel.
         menu.findItem(R.id.new_tab).setVisible(mCurrentPanel != Panel.NORMAL_TABS);
         menu.findItem(R.id.new_private_tab).setVisible(mCurrentPanel != Panel.PRIVATE_TABS);