Add a tab switcher button to phones
Bug: 4976834
Change-Id: I65477157ef3caed2b064e60fa1e8f701f6537535
diff --git a/res/layout/title_bar.xml b/res/layout/title_bar.xml
index 649a4a0..66ea1d4 100644
--- a/res/layout/title_bar.xml
+++ b/res/layout/title_bar.xml
@@ -84,6 +84,12 @@
android:layout_height="match_parent"
android:src="@drawable/ic_forward_holo_dark"
style="@style/HoloButton" />
+ <ImageButton
+ android:id="@+id/tab_switcher"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:src="@drawable/ic_windows_holo_dark"
+ style="@style/HoloButton" />
</LinearLayout>
<LinearLayout
android:id="@+id/autologin"
diff --git a/src/com/android/browser/TitleBarPhone.java b/src/com/android/browser/TitleBarPhone.java
index 1fcaf4d..528ea43 100644
--- a/src/com/android/browser/TitleBarPhone.java
+++ b/src/com/android/browser/TitleBarPhone.java
@@ -48,6 +48,7 @@
private ImageButton mForward;
private Drawable mStopDrawable;
private Drawable mRefreshDrawable;
+ private View mTabSwitcher;
public TitleBarPhone(Activity activity, UiController controller, PhoneUi ui,
FrameLayout parent) {
@@ -67,6 +68,8 @@
mVoiceButton.setOnClickListener(this);
mForward = (ImageButton) findViewById(R.id.forward);
mForward.setOnClickListener(this);
+ mTabSwitcher = findViewById(R.id.tab_switcher);
+ mTabSwitcher.setOnClickListener(this);
setFocusState(false);
Resources res = context.getResources();
mStopDrawable = res.getDrawable(R.drawable.ic_stop_holo_dark);
@@ -167,6 +170,8 @@
if (web != null) {
web.goForward();
}
+ } else if (v == mTabSwitcher) {
+ mBaseUi.onMenuKey();
} else {
super.onClick(v);
}