Bookmark UI update

Change-Id: Ibdf7f93f7c5863d7108044dcd40d3866ff02518a
diff --git a/res/drawable-mdpi/bookmarks_widget_thumb_selector_longpressed.9.png b/res/drawable-mdpi/bookmarks_widget_thumb_selector_longpressed.9.png
new file mode 100644
index 0000000..2aee937
--- /dev/null
+++ b/res/drawable-mdpi/bookmarks_widget_thumb_selector_longpressed.9.png
Binary files differ
diff --git a/res/drawable-nodpi/bg_browser.png b/res/drawable-nodpi/bg_browser.png
new file mode 100644
index 0000000..c7907d7
--- /dev/null
+++ b/res/drawable-nodpi/bg_browser.png
Binary files differ
diff --git a/res/drawable-mdpi/bg_browsertabs.png b/res/drawable-nodpi/bg_browsertabs.png
similarity index 96%
rename from res/drawable-mdpi/bg_browsertabs.png
rename to res/drawable-nodpi/bg_browsertabs.png
index 9d0ff07..15d3365 100644
--- a/res/drawable-mdpi/bg_browsertabs.png
+++ b/res/drawable-nodpi/bg_browsertabs.png
Binary files differ
diff --git a/res/menu/bookmark_view.xml b/res/drawable/bookmark_list_favicon_bg.xml
similarity index 60%
copy from res/menu/bookmark_view.xml
copy to res/drawable/bookmark_list_favicon_bg.xml
index fdfd672..3d362e4 100644
--- a/res/menu/bookmark_view.xml
+++ b/res/drawable/bookmark_list_favicon_bg.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
+<!-- Copyright (C) 2011 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.
@@ -14,9 +14,13 @@
      limitations under the License.
 -->
 
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/thumbnail_view"
-        android:title="@string/bookmark_thumbnail_view"/>
-    <item android:id="@+id/list_view"
-        android:title="@string/bookmark_list_view"/>
-</menu>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/bookmarkListFaviconBackground" />
+    <padding
+        android:left="5dip"
+        android:right="5dip"
+        android:top="5dip"
+        android:bottom="5dip" />
+    <corners android:radius="3dip" />
+</shape>
diff --git a/res/drawable/bookmark_thumb_selector.xml b/res/drawable/bookmark_thumb_selector.xml
index 5219d90..59d9405 100644
--- a/res/drawable/bookmark_thumb_selector.xml
+++ b/res/drawable/bookmark_thumb_selector.xml
@@ -14,8 +14,9 @@
      limitations under the License.
 -->
 
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/frame_bookmark_thumb_pressed" />
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+    <item android:state_pressed="true" android:drawable="@drawable/bookmark_thumb_selector_transition" />
     <item android:drawable="@android:color/transparent" />
 </selector>
 
diff --git a/res/menu/bookmark_view.xml b/res/drawable/bookmark_thumb_selector_transition.xml
similarity index 71%
rename from res/menu/bookmark_view.xml
rename to res/drawable/bookmark_thumb_selector_transition.xml
index fdfd672..07ad281 100644
--- a/res/menu/bookmark_view.xml
+++ b/res/drawable/bookmark_thumb_selector_transition.xml
@@ -14,9 +14,8 @@
      limitations under the License.
 -->
 
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/thumbnail_view"
-        android:title="@string/bookmark_thumbnail_view"/>
-    <item android:id="@+id/list_view"
-        android:title="@string/bookmark_list_view"/>
-</menu>
+<transition xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/bookmarks_widget_thumb_selector_pressed"  />
+    <item android:drawable="@drawable/bookmarks_widget_thumb_selector_longpressed"  />
+</transition>
+
diff --git a/res/drawable/bookmark_widget_thumb_selector.xml b/res/drawable/bookmark_widget_thumb_selector.xml
index d9b8171..d34a55d 100644
--- a/res/drawable/bookmark_widget_thumb_selector.xml
+++ b/res/drawable/bookmark_widget_thumb_selector.xml
@@ -14,7 +14,8 @@
      limitations under the License.
 -->
 
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:exitFadeDuration="@android:integer/config_mediumAnimTime">
     <item android:state_pressed="true" android:drawable="@drawable/bookmarks_widget_thumb_selector_pressed" />
     <item android:drawable="@android:color/transparent" />
 </selector>
diff --git a/res/layout/bookmark_list.xml b/res/layout/bookmark_list.xml
index 720685b..7413ca8 100644
--- a/res/layout/bookmark_list.xml
+++ b/res/layout/bookmark_list.xml
@@ -21,20 +21,21 @@
     android:layout_height="match_parent"
     android:minHeight="@dimen/widgetItemMinHeight"
     android:orientation="horizontal"
-    android:padding="8dip">
+    android:paddingLeft="16dip">
     <ImageView
         android:id="@+id/favicon"
-        android:layout_height="24dp"
-        android:layout_width="24dp"
+        android:layout_height="32dip"
+        android:layout_width="32dip"
         android:layout_gravity="center_vertical"
-        android:scaleType="fitXY"/>
+        android:background="@drawable/bookmark_list_favicon_bg"
+        android:scaleType="fitXY" />
     <TextView
         android:id="@+id/label"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:textAppearance="?android:attr/textAppearanceMedium"
-        android:padding="8dip"
+        android:paddingLeft="16dip"
         android:maxLines="1"
         android:scrollHorizontally="true"
         android:ellipsize="marquee"/>
diff --git a/res/layout/bookmark_thumbnail.xml b/res/layout/bookmark_thumbnail.xml
index 91d8db7..c545fa4 100644
--- a/res/layout/bookmark_thumbnail.xml
+++ b/res/layout/bookmark_thumbnail.xml
@@ -21,32 +21,42 @@
     android:padding="0dip"
     >
 
-    <ImageView android:id="@+id/thumb"
+    <ImageView
+        android:id="@+id/thumb"
         android:src="@drawable/browser_thumbnail"
         android:scaleType="centerCrop"
         android:layout_height="@dimen/bookmarkThumbnailHeight"
         android:layout_width="@dimen/bookmarkThumbnailWidth"
-        android:layout_gravity="center"
+        android:layout_centerHorizontal="true"
+        android:background="@drawable/border_thumb_bookmarks_widget_holo"
+        />
+
+    <ImageView
+        android:id="@+id/divider"
+        android:src="?android:attr/dividerVertical"
+        android:layout_width="wrap_content"
+        android:layout_height="24dip"
+        android:layout_below="@+id/thumb"
+        android:layout_alignLeft="@+id/thumb"
+        android:scaleType="fitXY"
+        android:layout_marginTop="12dip"
         />
 
     <TextView android:id="@+id/label"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textStyle="bold"
-        android:textColor="@color/white"
-        android:maxLines="1"
-        android:paddingLeft="2dip"
-        android:paddingRight="2dip"
-        android:paddingTop="0dip"
-        android:paddingBottom="0dip"
-        android:layout_marginTop="0dip"
-        android:scrollHorizontally="true"
-        android:ellipsize="marquee"
-        android:layout_below="@+id/thumb"
-        android:layout_alignLeft="@+id/thumb"
+        android:layout_height="match_parent"
+        android:layout_toRightOf="@id/divider"
+        android:layout_alignTop="@id/divider"
+        android:layout_alignBottom="@id/divider"
         android:layout_alignRight="@+id/thumb"
+        android:paddingLeft="8dip"
+        android:paddingRight="2dip"
+        android:gravity="center_vertical"
+        android:singleLine="true"
+        android:ellipsize="marquee"
+        android:typeface="sans"
+        android:textSize="14sp"
+        android:textColor="#AAAAAA"
         />
 
 </RelativeLayout>
diff --git a/res/layout/bookmarks.xml b/res/layout/bookmarks.xml
index 28f83e4..a4a4e04 100644
--- a/res/layout/bookmarks.xml
+++ b/res/layout/bookmarks.xml
@@ -31,21 +31,24 @@
         android:layout_height="match_parent">
         <GridView
             android:id="@+id/grid"
-            android:layout_width="match_parent"
+            android:layout_width="wrap_content"
             android:layout_height="match_parent"
-            android:horizontalSpacing="16dip"
-            android:verticalSpacing="16dip"
-            android:stretchMode="spacingWidth"
+            android:layout_gravity="center_horizontal"
+            android:horizontalSpacing="@dimen/combo_horizontalSpacing"
+            android:verticalSpacing="40dip"
             android:scrollbarStyle="insideInset"
             android:listSelector="@drawable/bookmark_thumb_selector"
             android:drawSelectorOnTop="true"
             android:focusable="true"
             android:focusableInTouchMode="true"
-            android:numColumns="auto_fit" />
+            android:numColumns="auto_fit"
+            android:stretchMode="spacingWidth" />
         <ListView
             android:id="@+id/list"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:listSelector="@drawable/bookmark_thumb_selector"
+            android:drawSelectorOnTop="true"
             android:focusable="true"
             android:focusableInTouchMode="true"
             android:visibility="gone"/>
diff --git a/res/layout/bookmarks_header.xml b/res/layout/bookmarks_header.xml
index 5d83892..ba8cf2c 100644
--- a/res/layout/bookmarks_header.xml
+++ b/res/layout/bookmarks_header.xml
@@ -13,25 +13,9 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<LinearLayout
+
+<com.android.browser.BreadCrumbView
     xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/crumbs"
     android:layout_width="match_parent"
-    android:layout_height="48dip"
-    android:orientation="horizontal">
-
-    <com.android.browser.BreadCrumbView
-        android:id="@+id/crumbs"
-        android:layout_width="0dip"
-        android:layout_height="match_parent"
-        android:layout_weight="1"
-        android:paddingLeft="16dip" />
-
-    <TextView
-        android:id="@+id/select_bookmark_view"
-        android:layout_width="wrap_content"
-        android:layout_height="match_parent"
-        android:text="@string/bookmark_thumbnail_view"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:gravity="center_vertical" />
-
-</LinearLayout>
+    android:layout_height="match_parent" />
diff --git a/res/layout/bookmarks_history.xml b/res/layout/bookmarks_history.xml
index 3294434..9961d6f 100644
--- a/res/layout/bookmarks_history.xml
+++ b/res/layout/bookmarks_history.xml
@@ -13,100 +13,12 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<LinearLayout
+<FrameLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/fragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingTop="8dip"
-    android:orientation="vertical"
-    android:background="@color/black">
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="48dip">
-
-        <LinearLayout
-            android:id="@+id/tabs"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            style="@style/ActionBarStyle">
-            <TextView
-                android:id="@+id/bmtab"
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:paddingLeft="32dip"
-                android:paddingRight="32dip"
-                android:textAppearance="?android:attr/textAppearanceMedium"
-                android:gravity="center_vertical"
-                android:text="@string/bookmarks"
-                android:drawableLeft="@drawable/ic_tab_bookmarks_selected"
-                android:drawablePadding="16dip"
-                android:background="@drawable/tab_background" />
-            <ImageView
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:paddingTop="8dp"
-                android:paddingBottom="8dp"
-                android:src="@drawable/divider_vert" />
-            <TextView
-                android:id="@+id/historytab"
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:paddingLeft="32dip"
-                android:paddingRight="32dip"
-                android:textAppearance="?android:attr/textAppearanceMedium"
-                android:gravity="center_vertical"
-                android:text="@string/tab_history"
-                android:drawableLeft="@drawable/ic_tab_history_selected"
-                android:drawablePadding="16dip"
-                android:background="@drawable/tab_background" />
-        </LinearLayout>
-
-        <FrameLayout
-            android:id="@+id/header_container"
-            android:layout_width="0dip"
-            android:layout_weight="1"
-            android:layout_height="match_parent" />
-
-        <ImageView
-            android:id="@+id/seperate_select_add"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:paddingRight="16dip"
-            android:paddingLeft="16dip"
-            android:src="@drawable/divider_vert" />
-
-        <TextView
-            android:id="@+id/addbm"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:text="@string/add_new_bookmark"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:gravity="center_vertical"
-            android:background="@null"
-            android:drawableLeft="@drawable/ic_favorite_off_normal"
-            android:drawablePadding="16dip" />
-
-        <ImageView
-            android:id="@+id/seperate_select_add"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:paddingLeft="16dip"
-            android:src="@drawable/divider_vert" />
-
-        <ImageView
-            android:id="@+id/home"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:src="@drawable/ic_home"
-            android:paddingRight="16dip"
-            android:paddingLeft="16dip"
-            android:scaleType="center" />
-
-    </LinearLayout>
-    <FrameLayout
-        android:id="@+id/fragment"
-        android:paddingTop="8dip"
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1.0" />
-</LinearLayout>
+    android:paddingTop="@dimen/combo_paddingTop"
+    android:paddingLeft="@dimen/combo_paddingLeftRight"
+    android:paddingRight="@dimen/combo_paddingLeftRight"
+    android:background="@drawable/bg_browser" />
diff --git a/res/layout/bookmarkthumbnailwidget.xml b/res/layout/bookmarkthumbnailwidget.xml
index e312a2a..12191e8 100644
--- a/res/layout/bookmarkthumbnailwidget.xml
+++ b/res/layout/bookmarkthumbnailwidget.xml
@@ -34,7 +34,8 @@
         android:verticalSpacing="@dimen/widgetVerticalSpacing"
         android:drawSelectorOnTop="true"
         android:listSelector="@drawable/bookmark_widget_thumb_selector"
-        android:fadingEdgeLength="24dp" />
+        android:fadingEdgeLength="24dp"
+        android:scrollbarStyle="outsideOverlay" />
 
     <ImageButton
         android:id="@+id/app_shortcut"
diff --git a/res/menu/bookmark.xml b/res/menu/bookmark.xml
new file mode 100644
index 0000000..4055b5e
--- /dev/null
+++ b/res/menu/bookmark.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/add_bookmark"
+        android:icon="@drawable/ic_favorite_off_normal"
+        android:title="@string/add_new_bookmark"
+        android:showAsAction="always|withText" />
+    <item
+        android:id="@+id/go_home"
+        android:icon="@drawable/ic_home"
+        android:showAsAction="always" />
+    <item
+        android:id="@+id/thumbnail_view"
+        android:title="@string/bookmark_thumbnail_view"/>
+    <item
+        android:id="@+id/list_view"
+        android:title="@string/bookmark_list_view"/>
+    <item
+        android:id="@+id/preferences_menu_id"
+        android:title="@string/menu_preferences"
+        android:alphabeticShortcut="p" />
+</menu>
diff --git a/res/mipmap-xlarge/ic_launcher_browser.png b/res/mipmap-xlarge/ic_launcher_browser.png
deleted file mode 100644
index 2ca92c8..0000000
--- a/res/mipmap-xlarge/ic_launcher_browser.png
+++ /dev/null
Binary files differ
diff --git a/res/mipmap-xlarge/ic_launcher_shortcut_browser_bookmark.png b/res/mipmap-xlarge/ic_launcher_shortcut_browser_bookmark.png
deleted file mode 100644
index 7b2c680..0000000
--- a/res/mipmap-xlarge/ic_launcher_shortcut_browser_bookmark.png
+++ /dev/null
Binary files differ
diff --git a/res/values-xlarge-port/dimensions.xml b/res/values-xlarge-port/dimensions.xml
index e6b59ce..f891396 100644
--- a/res/values-xlarge-port/dimensions.xml
+++ b/res/values-xlarge-port/dimensions.xml
@@ -14,4 +14,6 @@
     <dimen name="widgetThumbnailHeight">84dip</dimen>
     <dimen name="widgetHorizontalSpacing">10dip</dimen>
     <dimen name="widgetVerticalSpacing">10dip</dimen>
+    <dimen name="combo_paddingLeftRight">16dip</dimen>
+    <dimen name="combo_horizontalSpacing">8dip</dimen>
 </resources>
diff --git a/res/values-xlarge/dimensions.xml b/res/values-xlarge/dimensions.xml
index 6aa83d2..05a4087 100644
--- a/res/values-xlarge/dimensions.xml
+++ b/res/values-xlarge/dimensions.xml
@@ -22,4 +22,8 @@
     <dimen name="mv_item_width">231dp</dimen>
     <dimen name="mv_item_width_portrait">213dp</dimen>
     <dimen name="mv_border_width">3dp</dimen>
+    <!-- For the combined Bookmarks History view -->
+    <dimen name="combo_paddingTop">50dip</dimen>
+    <dimen name="combo_paddingLeftRight">134dip</dimen>
+    <dimen name="combo_horizontalSpacing">20dip</dimen>
 </resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 834bead..835f3ba 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -32,4 +32,5 @@
     <color name="qc_slice_normal">#E0A0A0A0</color>
     <color name="qc_slice_active">#E02090FF</color>
     <color name="bookmarkWidgetFaviconBackground">#23ffffff</color>
+    <color name="bookmarkListFaviconBackground">#23ffffff</color>
 </resources>