Bug 1204851 - Inline back button in tabs panel layout. r=margaret

Previously we used a ViewStub to only show the back button for some configurations. Now we
show the button always, so we can get rid of the ViewStub.
This commit is contained in:
Sebastian Kaspari 2015-10-20 12:48:16 +02:00
parent 69f95dd119
commit 173dd9b902
3 changed files with 11 additions and 23 deletions

View File

@ -1,17 +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.tabs.TabPanelBackButton xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:id="@+id/nav_back"
android:layout_width="@dimen/tabs_panel_button_width"
android:layout_height="match_parent"
android:minWidth="@dimen/tabs_panel_button_width"
android:src="@drawable/tabs_panel_nav_back"
android:contentDescription="@string/back"
android:background="@drawable/action_bar_button_inverse"
gecko:dividerVerticalPadding="@dimen/tab_panel_divider_vertical_padding"
gecko:rightDivider="@drawable/tab_indicator_divider"/>

View File

@ -18,10 +18,16 @@
android:layout_height="@dimen/browser_toolbar_height"
android:background="@color/text_and_tabs_tray_grey">
<ViewStub android:id="@+id/nav_back_stub"
android:layout="@layout/tabs_panel_back_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<org.mozilla.gecko.tabs.TabPanelBackButton
android:id="@+id/nav_back"
android:layout_width="@dimen/tabs_panel_button_width"
android:layout_height="match_parent"
android:minWidth="@dimen/tabs_panel_button_width"
android:src="@drawable/tabs_panel_nav_back"
android:contentDescription="@string/back"
android:background="@drawable/action_bar_button_inverse"
gecko:dividerVerticalPadding="@dimen/tab_panel_divider_vertical_padding"
gecko:rightDivider="@drawable/tab_indicator_divider"/>
<org.mozilla.gecko.widget.IconTabWidget android:id="@+id/tab_widget"
android:layout_width="wrap_content"

View File

@ -164,8 +164,7 @@ public class TabsPanel extends LinearLayout
}
});
ViewStub backButtonStub = (ViewStub) findViewById(R.id.nav_back_stub);
mNavBackButton = (ImageButton) backButtonStub.inflate( );
mNavBackButton = (ImageButton) findViewById(R.id.nav_back);
mNavBackButton.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View view) {