Initial attempt to get the sliding title bar working, using a Gallery.
In addition the sliding title bar, I have now removed the TabPicker.
Now, when changing to a new tab, we just go straight there. Also
put back in Add bookmark in the top level menu. And fix the bug
where switching tabs was always bringing up the bookmarks.
diff --git a/res/drawable/browser_tab_selected.9.png b/res/drawable/browser_tab_selected.9.png
new file mode 100644
index 0000000..f822528
--- /dev/null
+++ b/res/drawable/browser_tab_selected.9.png
Binary files differ
diff --git a/res/drawable/browser_tab_unselected.9.png b/res/drawable/browser_tab_unselected.9.png
new file mode 100644
index 0000000..6f6e373
--- /dev/null
+++ b/res/drawable/browser_tab_unselected.9.png
Binary files differ
diff --git a/res/drawable/ic_add_tab.png b/res/drawable/ic_add_tab.png
new file mode 100644
index 0000000..5585a54
--- /dev/null
+++ b/res/drawable/ic_add_tab.png
Binary files differ
diff --git a/res/drawable/ic_close_tab.png b/res/drawable/ic_close_tab.png
new file mode 100644
index 0000000..44a789e
--- /dev/null
+++ b/res/drawable/ic_close_tab.png
Binary files differ
diff --git a/res/drawable/tab_selected.9.png b/res/drawable/tab_selected.9.png
new file mode 100644
index 0000000..a47f024
--- /dev/null
+++ b/res/drawable/tab_selected.9.png
Binary files differ
diff --git a/res/drawable/tab_unselected.9.png b/res/drawable/tab_unselected.9.png
new file mode 100644
index 0000000..2e3a454
--- /dev/null
+++ b/res/drawable/tab_unselected.9.png
Binary files differ
diff --git a/res/layout/custom_screen.xml b/res/layout/custom_screen.xml
index 3ea8ec9..f654a84 100644
--- a/res/layout/custom_screen.xml
+++ b/res/layout/custom_screen.xml
@@ -24,9 +24,10 @@
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
- <com.android.browser.TitleBar android:id="@+id/title_bar"
+ <com.android.browser.TitleBarSet android:id="@+id/title_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
+ android:background="@drawable/tab_unselected"
/>
<LinearLayout android:id="@+id/error_console"
diff --git a/res/layout/new_window_button.xml b/res/layout/new_window_button.xml
new file mode 100644
index 0000000..af0a4bd
--- /dev/null
+++ b/res/layout/new_window_button.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- android:background="@drawable/browser_tab_unselected" -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ >
+ <ImageView android:id="@+id/button"
+ android:src="@drawable/ic_add_tab"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ />
+</LinearLayout>
diff --git a/res/layout/title_bar.xml b/res/layout/title_bar.xml
index 0f70519..3cc25ac 100644
--- a/res/layout/title_bar.xml
+++ b/res/layout/title_bar.xml
@@ -18,7 +18,7 @@
android:fitsSystemWindows="true"
android:orientation="horizontal"
android:layout_width="fill_parent"
- android:background="@drawable/background_titlebar"
+ android:background="@drawable/tab_selected"
android:layout_height="45dip">
<ImageView android:id="@+id/favicon"
android:layout_height="20dip"
@@ -34,22 +34,37 @@
android:layout_weight="1"
android:layout_height="wrap_content">
<!-- This part contains the favicon and the progress bar -->
- <RelativeLayout
- android:layout_marginTop="3dip"
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_marginTop="0dip"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
>
+ <!-- need to make this no wider than the horizontal progress bar -->
+ <TextView android:id="@+id/title"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginLeft="6dip"
+ android:layout_marginTop="0dip"
+ android:textSize="14dip"
+ android:textColor="@color/white"
+ android:textStyle="bold"
+ android:singleLine="true"
+ android:padding="0dip"
+ />
<LinearLayout
android:orientation="horizontal"
- android:layout_marginTop="3dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
- <ProgressBar android:id="@+id/progress_horizontal"
- style="?android:attr/progressBarStyleHorizontal"
- android:layout_width="0dip"
- android:layout_weight="1"
+ <TextView android:id="@+id/url"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:max="100" />
+ android:layout_marginLeft="6dip"
+ android:textSize="11dip"
+ android:padding="0dip"
+ android:textColor="@color/white"
+ android:singleLine="true"
+ />
<ProgressBar android:id="@+id/progress_circular"
style="?android:attr/progressBarStyleSmallTitle"
android:layout_marginLeft="3dip"
@@ -57,49 +72,25 @@
android:max="100"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
- </LinearLayout>
- <!-- need to make this no wider than the horizontal progress bar -->
- <TextView android:id="@+id/title"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_marginLeft="6dip"
- android:layout_marginTop="4dip"
- android:textSize="14dip"
- android:textColor="@color/white"
- android:textStyle="bold"
- android:singleLine="true"
- />
- <TextView android:id="@+id/url"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="6dip"
- android:layout_below="@id/title"
- android:textSize="12dip"
- android:textColor="@color/white"
- android:singleLine="true"
- />
<ImageView android:id="@+id/lock_icon"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignBottom="@id/title"
android:layout_alignParentRight="true"
android:visibility="gone"/>
- </RelativeLayout>
+ </LinearLayout>
+ <ProgressBar android:id="@+id/progress_horizontal"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_width="fill_parent"
+ android:layout_weight="1"
+ android:layout_height="5dip"
+ android:max="100" />
+ </LinearLayout>
</LinearLayout>
- <!-- These buttons will change look/functionality -->
- <ImageView android:id="@+id/lft_button"
- android:layout_width="52dip"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:src="@android:drawable/btn_star"/>
- <!-- divider -->
- <View android:id="@+id/divider"
- android:layout_height="fill_parent"
- android:layout_width="2dip"
- android:background="@drawable/button_line"/>
+ <!-- This buttons will change look/functionality -->
<ImageView android:id="@+id/rt_button"
android:layout_width="52dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:src="@*android:drawable/btn_browser_zoom_page_overview"/>
+ android:src="@drawable/ic_close_tab"/>
</LinearLayout>
diff --git a/res/menu/browser.xml b/res/menu/browser.xml
index 32217eb..71b1081 100644
--- a/res/menu/browser.xml
+++ b/res/menu/browser.xml
@@ -22,11 +22,9 @@
android:icon="@android:drawable/ic_menu_search"/>
<item android:id="@+id/stop_reload_menu_id"
android:alphabeticShortcut="r" />
- <item android:id="@+id/windows_menu_id"
- android:title="@string/view_tabs"
- android:alphabeticShortcut="t"
- android:titleCondensed="@string/view_tabs_condensed"
- android:icon="@drawable/ic_menu_windows" />
+ <item android:id="@+id/add_bookmark_menu_id"
+ android:title="@string/save_to_bookmarks"
+ android:icon="@drawable/ic_dialog_bookmark" />
<item android:id="@+id/back_menu_id"
android:title="@string/back"
android:drawable="@*android:drawable/ic_menu_back"
@@ -84,20 +82,6 @@
<item android:id="@+id/window_eight_menu_id"
android:alphabeticShortcut="8" />
</group>
- <group android:id="@+id/TAB_MENU">
- <item android:id="@+id/new_tab_menu_id"
- android:title="@string/tab_picker_new_tab"
- android:alphabeticShortcut="t"
- android:icon="@android:drawable/ic_menu_add" />
- <item android:id="@+id/bookmarks_tab_menu_id"
- android:title="@string/bookmarks"
- android:alphabeticShortcut="b"
- android:icon="@drawable/ic_menu_bookmark" />
- <item android:id="@+id/history_tab_menu_id"
- android:title="@string/history"
- android:alphabeticShortcut="h"
- android:icon="@android:drawable/ic_menu_recent_history" />
- </group>
<!-- these items are toggled in and out of @+id/stop_reload_menu_id -->
<item android:id="@+id/stop_menu_id"
android:title="@string/stop"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e8ef5f9..a91b3e1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -137,7 +137,7 @@
<!-- Initial value in Location field in Bookmark dialog box -->
<string name="http">http://</string>
<!-- Menu item that opens a dialog to save a bookmark, initialized with the current page -->
- <string name="save_to_bookmarks">Bookmark</string>
+ <string name="save_to_bookmarks">Add bookmark</string>
<!-- Menu item on the bookmarks page, to edit an existing bookmark -->
<string name="edit_bookmark">Edit bookmark</string>
<!-- Context menu item to create a shortcut to the bookmark on the desktop -->