First pass at restyling dashboard
Still needs summaries, but the things are in the right place-ish.
Change-Id: I1cbc23da9f56589836b5ebd7e202114e8f323adc
diff --git a/res/drawable/selectable_card.xml b/res/drawable/selectable_card.xml
new file mode 100644
index 0000000..554b9f6
--- /dev/null
+++ b/res/drawable/selectable_card.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2015 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
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:attr/colorControlHighlight" >
+ <item android:drawable="@color/card_background"/>
+</ripple>
diff --git a/res/layout/dashboard.xml b/res/layout/dashboard.xml
index 0563fc0..ae5be68 100644
--- a/res/layout/dashboard.xml
+++ b/res/layout/dashboard.xml
@@ -14,24 +14,13 @@
limitations under the License.
-->
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/dashboard"
+<android.support.v7.widget.RecyclerView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/dashboard_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:scrollbarStyle="outsideOverlay"
- android:clipToPadding="false">
-
- <LinearLayout
- android:id="@+id/dashboard_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center_horizontal"
- android:paddingStart="@dimen/dashboard_padding_start"
- android:paddingEnd="@dimen/dashboard_padding_end"
- android:paddingTop="@dimen/dashboard_padding_top"
- android:paddingBottom="@dimen/dashboard_padding_bottom"
- android:clipToPadding="false"
- android:orientation="vertical"
- />
-
-</ScrollView>
+ android:paddingStart="@dimen/dashboard_padding_start"
+ android:paddingEnd="@dimen/dashboard_padding_end"
+ android:paddingTop="@dimen/dashboard_padding_top"
+ android:paddingBottom="@dimen/dashboard_padding_bottom"
+ android:clipToPadding="false" />
diff --git a/res/layout/dashboard_category.xml b/res/layout/dashboard_category.xml
index bee063e..9109440 100644
--- a/res/layout/dashboard_category.xml
+++ b/res/layout/dashboard_category.xml
@@ -21,11 +21,16 @@
android:paddingStart="@dimen/dashboard_category_padding_start"
android:paddingEnd="@dimen/dashboard_category_padding_end"
android:orientation="vertical"
+ android:paddingBottom="8dip"
android:background="@color/card_background"
- android:layout_marginBottom="8dip"
- android:elevation="@dimen/dashboard_category_elevation">
+ android:elevation="@dimen/dashboard_category_elevation" >
- <TextView android:id="@+id/category_title"
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="?android:attr/listDivider" />
+
+ <TextView android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_category_title_height"
android:paddingStart="@dimen/dashboard_category_title_margin_start"
@@ -36,10 +41,4 @@
android:textAlignment="viewStart"
/>
- <com.android.settings.dashboard.DashboardContainerView
- android:id="@+id/category_content"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- />
-
</LinearLayout>
diff --git a/res/layout/dashboard_spacer.xml b/res/layout/dashboard_spacer.xml
new file mode 100644
index 0000000..d7d9717
--- /dev/null
+++ b/res/layout/dashboard_spacer.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="10dp" />
diff --git a/res/layout/dashboard_tile.xml b/res/layout/dashboard_tile.xml
index aa1d00e..d1625c7 100644
--- a/res/layout/dashboard_tile.xml
+++ b/res/layout/dashboard_tile.xml
@@ -19,10 +19,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
- android:minHeight="@dimen/dashboard_tile_minimum_height">
+ android:minHeight="@dimen/dashboard_tile_minimum_height"
+ android:clickable="true"
+ android:background="@drawable/selectable_card"
+ android:elevation="@dimen/dashboard_category_elevation" >
<ImageView
- android:id="@+id/icon"
+ android:id="@android:id/icon"
android:layout_width="@dimen/dashboard_tile_image_size"
android:layout_height="@dimen/dashboard_tile_image_size"
android:scaleType="centerInside"
@@ -45,7 +48,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content">
- <TextView android:id="@+id/title"
+ <TextView android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
@@ -53,7 +56,7 @@
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
- <TextView android:id="@+id/status"
+ <TextView android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
@@ -65,11 +68,6 @@
</LinearLayout>
- <View android:id="@+id/tile_divider"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="?android:attr/dividerVertical" />
-
</LinearLayout>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/see_all.xml b/res/layout/see_all.xml
new file mode 100644
index 0000000..fff4d07
--- /dev/null
+++ b/res/layout/see_all.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:minHeight="@dimen/dashboard_tile_minimum_height"
+ android:clickable="true"
+ android:background="@drawable/selectable_card"
+ android:elevation="@dimen/dashboard_category_elevation">
+
+ <View
+ android:layout_width="@dimen/dashboard_tile_image_size"
+ android:layout_height="@dimen/dashboard_tile_image_size"
+ android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
+ android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end"
+ android:visibility="invisible" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:orientation="vertical"
+ android:gravity="center_vertical"
+ android:layout_weight="1">
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <TextView android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@android:style/TextAppearance.Material.Widget.Button.Inverse"
+ android:textColor="?android:attr/colorAccent"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
+
+ </RelativeLayout>
+
+ </LinearLayout>
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index df4d7a4..f9a8fee 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6989,4 +6989,9 @@
<!-- Description for a custom display scale. This shows the requested display
density in raw pixels per inch rather than computing a scale amount. [CHAR LIMIT=24] -->
<string name="force_density_summary_custom">Custom (<xliff:g id="densityDpi" example="160">%d</xliff:g>)</string>
+
+ <!-- Button to show all top-level settings items [CHAR LIMIT=20] -->
+ <string name="see_all">See all</string>
+ <!-- Button to show less top-level settings items [CHAR LIMIT=20] -->
+ <string name="see_less">See less</string>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 8b400ef..87e5103 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -299,7 +299,7 @@
<style name="TextAppearance.Switch" parent="@android:style/TextAppearance.Material.Title" />
<style name="TextAppearance.CategoryTitle" parent="@android:style/TextAppearance.Material.Body2">
- <item name="android:textColor">?android:attr/colorAccent</item>
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
</style>
<style name="TextAppearance.TileTitle" parent="@android:style/TextAppearance.Material.Subhead" />