Replace old list widget with new thumbnail widget

 Bug: 3336562

Change-Id: Ic612b5309f185658f4515bbc90cc44d8b9ccf1e0
diff --git a/res/layout/bookmarklistwidget.xml b/res/layout/bookmarklistwidget.xml
deleted file mode 100644
index f3857f8..0000000
--- a/res/layout/bookmarklistwidget.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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.
--->
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingTop="4dip"
-    android:paddingBottom="20dip"
-    android:paddingLeft="12dip"
-    android:paddingRight="12dip">
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical"
-        android:background="@drawable/bg_bookmark_widget_holo"
-        android:paddingLeft="0dip"
-        android:paddingRight="0dip"
-        android:paddingBottom="0dip">
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="42dip"
-            android:orientation="horizontal"
-            android:background="@drawable/header_bg_bookmark_widget_holo"
-            android:layout_marginLeft="5dip"
-            android:layout_marginRight="5dip">
-            <LinearLayout
-                android:id="@+id/header_browser"
-                android:layout_width="0dip"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:orientation="horizontal"
-                android:paddingLeft="16dip"
-                android:focusable="true"
-                android:clickable="true"
-                android:background="@drawable/widget_header_selector">
-                <ImageView
-                    android:id="@+id/logo"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_vertical"
-                    android:src="@drawable/ic_browser_bookmark_widget_holo" />
-                <TextView
-                    android:layout_width="0dip"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:layout_gravity="center_vertical"
-                    android:text="@string/application_name"
-                    android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:textStyle="bold"
-                    android:paddingLeft="8dip" />
-            </LinearLayout>
-            <ImageView
-                android:id="@+id/header_bookmarks"
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:src="@drawable/btn_ic_bookmark_bookmark_widget_holo_dark"
-                android:scaleType="centerInside"
-                android:focusable="true"
-                android:clickable="true"
-                android:background="@drawable/widget_header_selector"
-                android:paddingLeft="8dip"
-                android:paddingRight="8dip" />
-        </LinearLayout>
-        <ImageView android:background="@drawable/list_div_top_btm_bookmark_widget_holo"
-            android:layout_height="wrap_content"
-            android:layout_width="match_parent"
-            android:layout_marginLeft="2dip"
-            android:layout_marginRight="2dip" />
-        <ListView
-            android:id="@+id/bookmarks_list"
-            android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:layout_weight="1"
-            android:background="@drawable/widget_background"
-            android:cacheColorHint="@android:color/transparent"
-            android:divider="@drawable/list_div_bookmark_widget_holo"
-            android:layout_marginLeft="5dip"
-            android:layout_marginRight="5dip" />
-        <ImageView android:background="@drawable/list_div_top_btm_bookmark_widget_holo"
-            android:layout_height="wrap_content"
-            android:layout_width="match_parent"
-            android:layout_marginLeft="2dip"
-            android:layout_marginRight="2dip"
-            android:layout_marginBottom="2dip" />
-    </LinearLayout>
-</FrameLayout>
diff --git a/res/layout/bookmarklistwidget_item.xml b/res/layout/bookmarklistwidget_item.xml
deleted file mode 100644
index 2f64054..0000000
--- a/res/layout/bookmarklistwidget_item.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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.
--->
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/list_item"
-    android:layout_width="match_parent"
-    android:layout_height="48dp"
-    android:orientation="horizontal"
-    android:background="@drawable/row_activated_bookmark_widget_holo">
-    <ImageView
-        android:id="@+id/thumb"
-        android:src="@drawable/browser_thumbnail"
-        android:layout_height="@dimen/bookmark_widget_thumb_size"
-        android:layout_width="@dimen/bookmark_widget_thumb_size"
-        android:layout_gravity="center_vertical"
-        android:layout_marginLeft="16dp"
-        android:scaleType="centerInside"/>
-    <TextView
-        android:id="@+id/label"
-        android:layout_width="0dip"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical"
-        android:layout_weight="1"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-        android:paddingLeft="8dip"
-        android:maxLines="1"
-        android:scrollHorizontally="true"
-        android:ellipsize="marquee"/>
-</LinearLayout>
diff --git a/res/layout/bookmarkthumbnailwidget.xml b/res/layout/bookmarkthumbnailwidget.xml
new file mode 100644
index 0000000..581db5c
--- /dev/null
+++ b/res/layout/bookmarkthumbnailwidget.xml
@@ -0,0 +1,57 @@
+<?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.
+-->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingTop="4dip"
+    android:paddingBottom="22dip"
+    android:paddingLeft="13dip"
+    android:paddingRight="13dip">
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:padding="0dip"
+        android:background="@drawable/widget_background">
+        <ImageView android:background="@drawable/list_div_top_btm_bookmark_widget_holo"
+            android:layout_height="wrap_content"
+            android:layout_width="match_parent"
+            android:layout_marginTop="2dip"
+            android:layout_marginLeft="1dip"
+            android:layout_marginRight="1dip" />
+        <GridView
+            android:id="@+id/bookmarks_list"
+            android:layout_width="match_parent"
+            android:layout_height="0dip"
+            android:layout_weight="1"
+            android:layout_marginLeft="5dip"
+            android:layout_marginRight="5dip"
+            android:numColumns="2"
+            android:padding="1dip"
+            android:stretchMode="columnWidth"
+            android:horizontalSpacing="@dimen/widgetHorizontalSpacing"
+            android:verticalSpacing="@dimen/widgetVerticalSpacing"
+            android:drawSelectorOnTop="true"
+            android:listSelector="@drawable/bookmark_widget_thumb_selector" />
+        <ImageView android:background="@drawable/list_div_top_btm_bookmark_widget_holo"
+            android:layout_height="wrap_content"
+            android:layout_width="match_parent"
+            android:layout_marginBottom="3dip"
+            android:layout_marginLeft="1dip"
+            android:layout_marginRight="1dip" />
+    </LinearLayout>
+</FrameLayout>
diff --git a/res/layout/bookmarkthumbnailwidget_item.xml b/res/layout/bookmarkthumbnailwidget_item.xml
new file mode 100644
index 0000000..b67b386
--- /dev/null
+++ b/res/layout/bookmarkthumbnailwidget_item.xml
@@ -0,0 +1,61 @@
+<?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.
+-->
+
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/list_item"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/thumb"
+        android:src="@drawable/browser_thumbnail"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/widgetThumbnailHeight"
+        android:scaleType="centerCrop"
+        android:cropToPadding="true"
+        android:background="@drawable/border_thumb_bookmarks_widget_holo" />
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignBottom="@id/thumb"
+        android:background="@drawable/overlay_url_bookmark_widget_holo"
+        android:layout_marginLeft="2dip"
+        android:layout_marginRight="2dip"
+        android:layout_marginBottom="2dip">
+        <ImageView
+            android:id="@+id/favicon"
+            android:src="@drawable/app_web_browser_sm"
+            android:layout_width="@dimen/favicon_size"
+            android:layout_height="@dimen/favicon_size"
+            android:layout_gravity="center_vertical"
+            android:layout_marginLeft="4dip"
+            android:layout_marginRight="8dip"
+            android:layout_marginTop="4dip"
+            android:layout_marginBottom="4dip"
+            android:scaleType="centerInside" />
+        <TextView
+            android:id="@+id/label"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:singleLine="true"
+            android:ellipsize="end"
+            android:textSize="14sp"
+            android:typeface="sans"
+            android:textStyle="bold"
+            android:textColor="@android:color/white" />
+    </LinearLayout>
+</RelativeLayout>