diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2014-03-21 19:24:43 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2014-03-28 15:51:29 -0700 |
commit | d25314d3305ed1a07b53991a978cd71219ef2a10 (patch) | |
tree | 797a75d9ff94055ee025294848e0154fae26f365 /res | |
parent | 5f3442af6f1d1141f8f4dff033d4176214281b81 (diff) | |
download | packages_apps_Settings-d25314d3305ed1a07b53991a978cd71219ef2a10.zip packages_apps_Settings-d25314d3305ed1a07b53991a978cd71219ef2a10.tar.gz packages_apps_Settings-d25314d3305ed1a07b53991a978cd71219ef2a10.tar.bz2 |
Settings - update for new UI (no more Drawer)
- follow the UX spec by no more using a Drawer
- the Dashboard is now a Fragment that contains the list of Headers
- the search results are also put into a Fragment that is replacing
the initial one (Dashboard or other) when expanding the SearchView
- use a SearchView for query input
- when tapping on a Header or a Search Result, re-launch Settings as
an Activity so that we are benefiting from the Activity stack for
UP affordance and BACK button
- manage UP affordance to show it only when needed
- move some Actions to the Menu in the ActionBar for allowing space
to the Search action and removing some clutter
- fix an issue with the Index and WiFiEnabler and their cached Context
that was not updated when there was a Configuration change
- simplify the SettingsActivity code by extracting some inner classes
Change-Id: I50b5f77bb44a7fade1886114dbbc820609a5e63d
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/dashboard.xml | 29 | ||||
-rw-r--r-- | res/layout/search_result_item.xml (renamed from res/layout/search_result.xml) | 0 | ||||
-rw-r--r-- | res/layout/search_results.xml | 33 | ||||
-rw-r--r-- | res/layout/settings_main.xml | 91 | ||||
-rw-r--r-- | res/menu/options_menu.xml | 24 | ||||
-rw-r--r-- | res/values/strings.xml | 17 | ||||
-rw-r--r-- | res/xml/settings_headers.xml | 8 |
7 files changed, 109 insertions, 93 deletions
diff --git a/res/layout/dashboard.xml b/res/layout/dashboard.xml index 87bd973..8a29289 100644 --- a/res/layout/dashboard.xml +++ b/res/layout/dashboard.xml @@ -24,33 +24,10 @@ android:layout_gravity="center" android:orientation="vertical"> - <TextView android:id="@+id/dash_text" + <ListView android:id="@id/android:list" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:text="@string/dashboard_wip" - android:padding="16dp" - android:layout_weight="0" - android:background="#ffcccccc" - android:textSize="16sp" - /> - - <EditText android:id="@+id/edittext_query" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:hint="@string/query_hint_text" - android:layout_weight="0"/> - - <FrameLayout android:id="@+id/dashboard" - android:layout_width="match_parent" - android:layout_height="0dip" - android:layout_weight="1"> - - <ListView android:id="@+id/list_results" - android:layout_width="match_parent" - android:layout_height="match_parent"/> - - </FrameLayout> + android:layout_height="match_parent" + android:background="@color/background_drawer" /> </LinearLayout> diff --git a/res/layout/search_result.xml b/res/layout/search_result_item.xml index 6fa6d98..6fa6d98 100644 --- a/res/layout/search_result.xml +++ b/res/layout/search_result_item.xml diff --git a/res/layout/search_results.xml b/res/layout/search_results.xml new file mode 100644 index 0000000..a833404 --- /dev/null +++ b/res/layout/search_results.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 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:id="@+id/dashboard" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:orientation="vertical"> + + <ListView android:id="@+id/list_results" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + </LinearLayout> + +</FrameLayout> diff --git a/res/layout/settings_main.xml b/res/layout/settings_main.xml index 8b98794..db732dc 100644 --- a/res/layout/settings_main.xml +++ b/res/layout/settings_main.xml @@ -17,65 +17,58 @@ */ --> -<android.support.v4.widget.DrawerLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/drawer_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <LinearLayout +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="match_parent" android:layout_width="match_parent"> - <android.preference.PreferenceFrameLayout android:id="@+id/prefs" - android:layout_width="match_parent" + <LinearLayout + android:orientation="vertical" android:layout_height="match_parent" - android:layout_weight="1" - /> + android:layout_width="match_parent"> - <RelativeLayout android:id="@+id/button_bar" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_weight="0" - android:visibility="gone"> + <android.preference.PreferenceFrameLayout + android:id="@+id/prefs" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + /> + </LinearLayout> - <Button android:id="@+id/back_button" + <RelativeLayout android:id="@+id/button_bar" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_weight="0" + android:visibility="gone"> + + <Button android:id="@+id/back_button" + android:layout_width="150dip" + android:layout_height="wrap_content" + android:layout_margin="5dip" + android:layout_alignParentStart="true" + android:text="@*android:string/back_button_label" + /> + <LinearLayout + android:orientation="horizontal" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true"> + + <Button android:id="@+id/skip_button" android:layout_width="150dip" android:layout_height="wrap_content" android:layout_margin="5dip" - android:layout_alignParentStart="true" - android:text="@*android:string/back_button_label" + android:text="@*android:string/skip_button_label" + android:visibility="gone" /> - <LinearLayout - android:orientation="horizontal" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentEnd="true"> - - <Button android:id="@+id/skip_button" - android:layout_width="150dip" - android:layout_height="wrap_content" - android:layout_margin="5dip" - android:text="@*android:string/skip_button_label" - android:visibility="gone" - /> - <Button android:id="@+id/next_button" - android:layout_width="150dip" - android:layout_height="wrap_content" - android:layout_margin="5dip" - android:text="@*android:string/next_button_label" - /> - </LinearLayout> - </RelativeLayout> - - </LinearLayout> - - <ListView android:id="@+id/headers_drawer" - android:layout_width="300dp" - android:layout_height="match_parent" - android:layout_gravity="start" - android:background="@color/background_drawer"/> + <Button android:id="@+id/next_button" + android:layout_width="150dip" + android:layout_height="wrap_content" + android:layout_margin="5dip" + android:text="@*android:string/next_button_label" + /> + </LinearLayout> + </RelativeLayout> -</android.support.v4.widget.DrawerLayout> +</LinearLayout> diff --git a/res/menu/options_menu.xml b/res/menu/options_menu.xml new file mode 100644 index 0000000..59e9cad --- /dev/null +++ b/res/menu/options_menu.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 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/search" + android:title="@string/search_menu" + android:icon="@*android:drawable/ic_search" + android:showAsAction="collapseActionView|ifRoom" + android:actionViewClass="android.widget.SearchView" /> +</menu>
\ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 1d6c751..62d5ca6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -4988,20 +4988,17 @@ <string name="enable_nfc">NFC is not enabled and is required for NFC Unlock. Please turn on NFC.</string> <string name="ok">NFC Settings</string> - <!--Drawer strings--> - <!-- Text to describe the "open drawer" action for accessibility purpose [CHAR LIMIT=50] --> - <string name="drawer_open">Open navigation drawer</string> - <!-- Text to describe the "close drawer" action for accessibility purpose [CHAR LIMIT=50] --> - <string name="drawer_close">Close navigation drawer</string> - <!--Dashboard strings--> - <!-- Text to describe the dashboard entry into the Drawer [CHAR LIMIT=16] --> - <string name="dashboard_title">Overview</string> - <string name="dashboard_wip" translatable="false">Overview and Search are work in progress and Confidential\n\nDrag the Drawer on the left to see the settings list</string> + <!-- Text to describe the dashboard fragment title [CHAR LIMIT=16] --> + <string name="dashboard_title">Settings</string> <!-- Search strings --> + <!-- Text to describe the search results fragment title [CHAR LIMIT=16] --> + <string name="search_results_title">Settings</string> + <!-- Text used as a search hint into the search box --> + <string name="search_menu">Search</string> <!-- Text used as a search hint into the search box --> - <string name="query_hint_text">What are you looking for?</string> + <string name="query_hint_text">Search settings</string> <!--Search Keywords--> <string name="keywords_wifi">wifi wi-fi network connection</string> diff --git a/res/xml/settings_headers.xml b/res/xml/settings_headers.xml index c4b5eac..73665cd 100644 --- a/res/xml/settings_headers.xml +++ b/res/xml/settings_headers.xml @@ -17,14 +17,6 @@ <preference-headers xmlns:android="http://schemas.android.com/apk/res/android"> - - <!-- Dashboard --> - <!--TODO: android:icon="@drawable/ic_settings_dashboard"--> - <header - android:id="@+id/dashboard" - android:fragment="com.android.settings.dashboard.DashboardSummary" - android:title="@string/dashboard_title" /> - <!-- WIRELESS and NETWORKS --> <header android:id="@+id/wireless_section" android:title="@string/header_category_wireless_networks" /> |