Spec update for Bookmark widget
Bug: 3286323
This updates both the assets for the bookmark widget and slightly
alters its behavior to match the updated spec. There are now two
touch targets in the header, one launches the browser and the other
launches the bookmarks view.
Change-Id: I1e8864983852af8421280b86421dea1d9ed4335e
diff --git a/res/drawable-hdpi/bg_bookmark_widget_holo.9.png b/res/drawable-hdpi/bg_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..8a23d6f
--- /dev/null
+++ b/res/drawable-hdpi/bg_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/btn_ic_back_bookmark_widget_holo_dark.png b/res/drawable-hdpi/btn_ic_back_bookmark_widget_holo_dark.png
new file mode 100644
index 0000000..447f3af
--- /dev/null
+++ b/res/drawable-hdpi/btn_ic_back_bookmark_widget_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/btn_ic_bookmark_bookmark_widget_holo_dark.png b/res/drawable-hdpi/btn_ic_bookmark_bookmark_widget_holo_dark.png
new file mode 100644
index 0000000..1c10e98
--- /dev/null
+++ b/res/drawable-hdpi/btn_ic_bookmark_bookmark_widget_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/gradient_overlay_bg_bookmark_widget_holo.png b/res/drawable-hdpi/gradient_overlay_bg_bookmark_widget_holo.png
new file mode 100644
index 0000000..1a84583
--- /dev/null
+++ b/res/drawable-hdpi/gradient_overlay_bg_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/header_bg_bookmark_widget_holo.png b/res/drawable-hdpi/header_bg_bookmark_widget_holo.png
new file mode 100644
index 0000000..8d0706a
--- /dev/null
+++ b/res/drawable-hdpi/header_bg_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/header_row_focused_bookmark_widget_holo.9.png b/res/drawable-hdpi/header_row_focused_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..b3406fd
--- /dev/null
+++ b/res/drawable-hdpi/header_row_focused_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/header_row_press_bookmark_widget_holo.9.png b/res/drawable-hdpi/header_row_press_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..2a6ff60
--- /dev/null
+++ b/res/drawable-hdpi/header_row_press_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_browser_bookmark_widget_holo.png b/res/drawable-hdpi/ic_browser_bookmark_widget_holo.png
new file mode 100644
index 0000000..1fb772e
--- /dev/null
+++ b/res/drawable-hdpi/ic_browser_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_folder_bookmark_widget_holo_dark.png b/res/drawable-hdpi/ic_folder_bookmark_widget_holo_dark.png
new file mode 100644
index 0000000..8a167e2
--- /dev/null
+++ b/res/drawable-hdpi/ic_folder_bookmark_widget_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/list_div_bookmark_widget_holo.9.png b/res/drawable-hdpi/list_div_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..65f42ba
--- /dev/null
+++ b/res/drawable-hdpi/list_div_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/list_div_top_btm_bookmark_widget_holo.9.png b/res/drawable-hdpi/list_div_top_btm_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..e9165d2
--- /dev/null
+++ b/res/drawable-hdpi/list_div_top_btm_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/row_activated_bookmark_widget_holo.9.png b/res/drawable-hdpi/row_activated_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..b6cfc4c
--- /dev/null
+++ b/res/drawable-hdpi/row_activated_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/stripes_overlay_bg_bookmark_widget_holo.png b/res/drawable-hdpi/stripes_overlay_bg_bookmark_widget_holo.png
new file mode 100644
index 0000000..95d24fa
--- /dev/null
+++ b/res/drawable-hdpi/stripes_overlay_bg_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/bg_bookmark_widget_holo.9.png b/res/drawable-mdpi/bg_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..ac56bbe
--- /dev/null
+++ b/res/drawable-mdpi/bg_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_ic_back_bookmark_widget_holo_dark.png b/res/drawable-mdpi/btn_ic_back_bookmark_widget_holo_dark.png
new file mode 100644
index 0000000..d8697b8
--- /dev/null
+++ b/res/drawable-mdpi/btn_ic_back_bookmark_widget_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_ic_bookmark_bookmark_widget_holo_dark.png b/res/drawable-mdpi/btn_ic_bookmark_bookmark_widget_holo_dark.png
new file mode 100644
index 0000000..21a2cc3
--- /dev/null
+++ b/res/drawable-mdpi/btn_ic_bookmark_bookmark_widget_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/gradient_overlay_bg_bookmark_widget_holo.png b/res/drawable-mdpi/gradient_overlay_bg_bookmark_widget_holo.png
new file mode 100644
index 0000000..1673338
--- /dev/null
+++ b/res/drawable-mdpi/gradient_overlay_bg_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/header_bg_bookmark_widget_holo.png b/res/drawable-mdpi/header_bg_bookmark_widget_holo.png
new file mode 100644
index 0000000..9c3f7a6
--- /dev/null
+++ b/res/drawable-mdpi/header_bg_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/header_row_focused_bookmark_widget_holo.9.png b/res/drawable-mdpi/header_row_focused_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..b745159
--- /dev/null
+++ b/res/drawable-mdpi/header_row_focused_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/header_row_press_bookmark_widget_holo.9.png b/res/drawable-mdpi/header_row_press_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..2e8874e
--- /dev/null
+++ b/res/drawable-mdpi/header_row_press_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_browser_bookmark_widget_holo.png b/res/drawable-mdpi/ic_browser_bookmark_widget_holo.png
new file mode 100644
index 0000000..0d9e49d
--- /dev/null
+++ b/res/drawable-mdpi/ic_browser_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_folder_bookmark_widget_holo_dark.png b/res/drawable-mdpi/ic_folder_bookmark_widget_holo_dark.png
new file mode 100644
index 0000000..910e9ec
--- /dev/null
+++ b/res/drawable-mdpi/ic_folder_bookmark_widget_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/list_div_bookmark_widget_holo.9.png b/res/drawable-mdpi/list_div_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..fc1946f
--- /dev/null
+++ b/res/drawable-mdpi/list_div_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/list_div_top_btm_bookmark_widget_holo.9.png b/res/drawable-mdpi/list_div_top_btm_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..309b608
--- /dev/null
+++ b/res/drawable-mdpi/list_div_top_btm_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/row_activated_bookmark_widget_holo.9.png b/res/drawable-mdpi/row_activated_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..ed8760f
--- /dev/null
+++ b/res/drawable-mdpi/row_activated_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/stripes_overlay_bg_bookmark_widget_holo.png b/res/drawable-mdpi/stripes_overlay_bg_bookmark_widget_holo.png
new file mode 100644
index 0000000..8c9614b
--- /dev/null
+++ b/res/drawable-mdpi/stripes_overlay_bg_bookmark_widget_holo.png
Binary files differ
diff --git a/res/drawable/preview.png b/res/drawable/preview.png
index b363ab5..b239716 100644
--- a/res/drawable/preview.png
+++ b/res/drawable/preview.png
Binary files differ
diff --git a/res/drawable/widget_background.xml b/res/drawable/widget_background.xml
new file mode 100644
index 0000000..de6c3f2
--- /dev/null
+++ b/res/drawable/widget_background.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+
+<layer-list
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <bitmap
+ android:src="@drawable/gradient_overlay_bg_bookmark_widget_holo"
+ android:gravity="top|fill_horizontal" />
+ </item>
+ <item>
+ <bitmap
+ android:src="@drawable/stripes_overlay_bg_bookmark_widget_holo"
+ android:gravity="top|fill_horizontal" />
+ </item>
+</layer-list>
diff --git a/res/drawable/widget_header_selector.xml b/res/drawable/widget_header_selector.xml
new file mode 100644
index 0000000..0e6bc47
--- /dev/null
+++ b/res/drawable/widget_header_selector.xml
@@ -0,0 +1,33 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+ <item
+ android:state_window_focused="false"
+ android:drawable="@android:color/transparent" />
+ <item
+ android:state_focused="true"
+ android:state_pressed="true"
+ android:drawable="@drawable/header_row_press_bookmark_widget_holo" />
+ <item
+ android:state_focused="false"
+ android:state_pressed="true"
+ android:drawable="@drawable/header_row_press_bookmark_widget_holo" />
+ <item
+ android:state_focused="true"
+ android:drawable="@drawable/header_row_focused_bookmark_widget_holo" />
+</selector>
diff --git a/res/layout/bookmarklistwidget.xml b/res/layout/bookmarklistwidget.xml
index 17aee1d..f3857f8 100644
--- a/res/layout/bookmarklistwidget.xml
+++ b/res/layout/bookmarklistwidget.xml
@@ -13,41 +13,87 @@
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:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="vertical"
- android:background="@null"
- android:focusable="true"
- android:clickable="true">
+ android:paddingTop="4dip"
+ android:paddingBottom="20dip"
+ android:paddingLeft="12dip"
+ android:paddingRight="12dip">
<LinearLayout
- android:id="@+id/header"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:padding="8dip"
- android:background="@color/bookmarkWidgetHeader">
- <ImageView
- android:id="@+id/logo"
- android:layout_width="32dp"
- android:layout_height="32dp"
- android:src="@mipmap/ic_launcher_browser" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:text="@string/tab_bookmarks"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingLeft="8dip" />
- </LinearLayout>
- <ListView
- android:id="@+id/bookmarks_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/bookmarkWidgetItemBackground"
- android:cacheColorHint="@color/bookmarkWidgetItemBackground"
- android:dividerHeight="1px"
- android:divider="@color/bookmarkWidgetDivider" />
-</LinearLayout>
+ 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
index 9e41d39..039bc2c 100644
--- a/res/layout/bookmarklistwidget_item.xml
+++ b/res/layout/bookmarklistwidget_item.xml
@@ -18,23 +18,23 @@
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:layout_height="48dp"
android:orientation="horizontal"
- android:padding="8dip"
- android:background="@color/bookmarkWidgetFolderBackground">
+ android:background="@drawable/row_activated_bookmark_widget_holo">
<ImageView
android:id="@+id/thumb"
android:src="@drawable/browser_thumbnail"
- android:layout_height="24dp"
- android:layout_width="24dp"
+ android:layout_height="32dp"
+ android:layout_width="32dp"
android:layout_gravity="center_vertical"
+ android:layout_marginLeft="16dp"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/label"
- android:layout_width="wrap_content"
+ 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"