Adds a list view option for viewing bookmarks

 Bug: 3166319
 This adds a popup menu option to the combined view that allows a
 user to switch between viewing their bookmarks as a grid of thumbnails
 or as a list of bookmarks with favicons.

Change-Id: I6729d477f574a46847dff4b69c1b32d9f63fb37f
diff --git a/res/layout/bookmark_list.xml b/res/layout/bookmark_list.xml
new file mode 100644
index 0000000..720685b
--- /dev/null
+++ b/res/layout/bookmark_list.xml
@@ -0,0 +1,41 @@
+<?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="match_parent"
+    android:minHeight="@dimen/widgetItemMinHeight"
+    android:orientation="horizontal"
+    android:padding="8dip">
+    <ImageView
+        android:id="@+id/favicon"
+        android:layout_height="24dp"
+        android:layout_width="24dp"
+        android:layout_gravity="center_vertical"
+        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:maxLines="1"
+        android:scrollHorizontally="true"
+        android:ellipsize="marquee"/>
+</LinearLayout>
diff --git a/res/layout/bookmarks.xml b/res/layout/bookmarks.xml
index fa08353..66a78e8 100644
--- a/res/layout/bookmarks.xml
+++ b/res/layout/bookmarks.xml
@@ -31,6 +31,13 @@
         android:focusable="true"
         android:focusableInTouchMode="true"
         android:numColumns="auto_fit" />
+    <ListView
+        android:id="@+id/list"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:visibility="gone"/>
     <TextView
         android:id="@android:id/empty"
         android:layout_width="wrap_content"
diff --git a/res/layout/bookmarks_history.xml b/res/layout/bookmarks_history.xml
index a89a2b9..b8ccfe7 100644
--- a/res/layout/bookmarks_history.xml
+++ b/res/layout/bookmarks_history.xml
@@ -76,6 +76,23 @@
             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:layout_toLeftOf="@id/addbm"
+            android:paddingRight="16dip"
+            android:src="@drawable/divider_vert" />
+        <TextView
+            android:id="@+id/select_bookmark_view"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="@string/switch_to_thumbnails"
+            android:layout_toLeftOf="@id/seperate_select_add"
+            android:paddingRight="16dip"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:gravity="center_vertical"
+            android:background="@null" />
     </RelativeLayout>
     <FrameLayout
         android:id="@+id/fragment"
diff --git a/res/menu/bookmark_view.xml b/res/menu/bookmark_view.xml
new file mode 100644
index 0000000..fdfd672
--- /dev/null
+++ b/res/menu/bookmark_view.xml
@@ -0,0 +1,22 @@
+<?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/thumbnail_view"
+        android:title="@string/bookmark_thumbnail_view"/>
+    <item android:id="@+id/list_view"
+        android:title="@string/bookmark_list_view"/>
+</menu>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4f63d3f..7d27dec 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -184,11 +184,11 @@
             showing. -->
     <string name="bookmark_page">Bookmark last-viewed page</string>
     <!-- Menu item in the page that displays all bookmarks.  Switches to
-            a grid view which shows thumbnails -->
-    <string name="switch_to_thumbnails">Thumbnail view</string>
+            a grid view which shows thumbnails [CHAR LIMIT=50] -->
+    <string name="bookmark_thumbnail_view">Thumbnail view</string>
     <!-- Menu item in the page that displays all bookmarks.  Switches to a
-            list view which shows titles -->
-    <string name="switch_to_list">List view</string>
+            list view which shows titles [CHAR LIMIT=50] -->
+    <string name="bookmark_list_view">List view</string>
     <!-- Summary text under the New Bookmark item on the Bookmarks screen.
             Tells the user that if they select this item, it will bring up a
             dialog to bookmark the page that the browser is currently viewing,