From cb802d754fcfc0c0487a03b6f9cebc78270dc52c Mon Sep 17 00:00:00 2001 From: Martyn Haigh Date: Tue, 9 Dec 2014 17:07:26 +0000 Subject: [PATCH] Bug 1100464 - Add back button to top left of the tabs panel (r=lucasr) --- .../new_tablet_nav_back.png | Bin 0 -> 808 bytes .../new_tablet_nav_back.png | Bin 0 -> 581 bytes .../new_tablet_nav_back.png | Bin 0 -> 1062 bytes .../new_tablet_nav_back.png | Bin 0 -> 1016 bytes .../new_tablet_tabs_panel_back_button.xml | 14 ++++++++++++++ .../base/resources/layout/tabs_panel_default.xml | 5 +++++ mobile/android/base/resources/values/layout.xml | 1 + mobile/android/base/tabs/TabsPanel.java | 13 +++++++++++++ 8 files changed, 33 insertions(+) create mode 100644 mobile/android/base/newtablet/res/drawable-large-hdpi-v11/new_tablet_nav_back.png create mode 100644 mobile/android/base/newtablet/res/drawable-large-mdpi-v11/new_tablet_nav_back.png create mode 100644 mobile/android/base/newtablet/res/drawable-large-xhdpi-v11/new_tablet_nav_back.png create mode 100644 mobile/android/base/newtablet/res/drawable-large-xxhdpi-v11/new_tablet_nav_back.png create mode 100644 mobile/android/base/newtablet/res/layout-large-v11/new_tablet_tabs_panel_back_button.xml diff --git a/mobile/android/base/newtablet/res/drawable-large-hdpi-v11/new_tablet_nav_back.png b/mobile/android/base/newtablet/res/drawable-large-hdpi-v11/new_tablet_nav_back.png new file mode 100644 index 0000000000000000000000000000000000000000..1754c44edc86aa78dfca1f22413f295002cec066 GIT binary patch literal 808 zcmV+@1K0eCP)Px%;z>k7R7ef2R?lk_K@^_ZZcPhHQ7QgF^d#QY=urrQAR=^kldVBeEDDOWcu)(1 zdI*$);Gu|M$t6Kct;BAUP4rSd=}E-W*8iY*5QUy9p)uL>jIQD&d~&XPgfi_tCFB6tQA%$gJ$`aK zrZwluBc*?dgbnMf$V>?bn+zY0^-gKy;@QBEB7IW=^4Wi)!=<>`iBiY&@hfYFkE{2X{J}z<6-MEkA^q@B@LU zN+`RWFwNI~o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`DeSZyZWisZS zbwLHM^p1vjmXVtRn~mCH8&?92A&WV|Vm{yEVA1G_{$edS9u2(>C|=bXAB3yh5Gra2 z(gcX(T&({OQ3OltMSRJ159_FxdHRBDsJs#VN(eXQfOsAx6awMril~0FxvIYQycb#2 zcTBlUM$4<W*Uo;YG*uM&brH%C+yHR`OG9M_aR~k;HIANLQRQ>ok&rLJ5LBut+ z%-4(~oT=|OY)yU(;g7;&+v&H=&;}WQ&8Xa1yq@9dySQPK{El;`Vhf6#p-^yi zyz+U@)X9*op(_N9*r~)94UQIu$QcUpkd+*Mo8Oqvglr96-m4M~#t4Qug4SuRr1`!O z;zMZ+glkft!Vz0gz-gz`-d9-APiLO(PP9tP*-qnj#F_B(3^mXIk2| zkGk#Nd(U2a&dRc=6>X@AJVz{+P4X<^oV(%9?|%3DzTfYD=iIsXo(>P=xw(3}G8hau zen?ORy!yd&+3>*-lW*|_3sR6-&LK&4Va za)BV!YBi4I8V#k<0O)7|LcLzEB}s@FW*`Ux!vIE-a10`pIsht25|$201CGN2H~^6A zkpu{l1UN}K5hq~_Nj+&G00p@d^?-sc0vK?DBH#>?u=U@;k%L;Wa5zR%2x*fh$RP$y zI76rXLp13$(Oq?LeEs(QM{nQH{$F8YF%y0&Mf{)u z;UT8HO_V-%gU5~T#knFE=FpqUX!9{6+cZB7%;9)(B<0@3AonlG0crC4jUg_nh{m4 zQuL`L#^9*D1AAWbghbmx&IVp_`tr*!mtmQb$j16IJf`H4|51+5=5jx;t|8^Dv^A-$ z!guXc$~H=bT5k9quFA5z4CJkC+bMiDw#2YcnbCDXzzvGpa%-+_5~gKoXDnFi*BYbf zwzQm=)Zf1;m$uJNd@8D`$m(p&{xCb?`}Ty@*lCw*={$37ykr*T{WdjVdySjpO}xQ6 zDSxN0x4%PCmqn7CZ zEo4@HlutF- + + + + diff --git a/mobile/android/base/resources/layout/tabs_panel_default.xml b/mobile/android/base/resources/layout/tabs_panel_default.xml index dd807b748495..ff8821ffef38 100644 --- a/mobile/android/base/resources/layout/tabs_panel_default.xml +++ b/mobile/android/base/resources/layout/tabs_panel_default.xml @@ -18,6 +18,11 @@ android:layout_height="match_parent" android:background="@color/background_tabs"> + + @null @null @null + @null diff --git a/mobile/android/base/tabs/TabsPanel.java b/mobile/android/base/tabs/TabsPanel.java index 7ae330819267..6977b4674a2a 100644 --- a/mobile/android/base/tabs/TabsPanel.java +++ b/mobile/android/base/tabs/TabsPanel.java @@ -30,6 +30,7 @@ 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; @@ -88,6 +89,7 @@ public class TabsPanel extends LinearLayout private IconTabWidget mTabWidget; private static ImageButton mMenuButton; private static ImageButton mAddTab; + private ImageButton mNavBackButton; private Panel mCurrentPanel; private boolean mIsSideBar; @@ -163,6 +165,17 @@ public class TabsPanel extends LinearLayout 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() {