diff options
author | Jeff Sharkey <jsharkey@android.com> | 2011-06-10 13:31:21 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2011-06-10 16:17:21 -0700 |
commit | 8a50364a71e7c261b54840210f8bacff5abecb34 (patch) | |
tree | 6ddcd421fd26829af3c6b0a6bcd656c6986dc182 /res | |
parent | 86432504d356e3de7e63b48251f653245bcafd32 (diff) | |
download | packages_apps_Settings-8a50364a71e7c261b54840210f8bacff5abecb34.zip packages_apps_Settings-8a50364a71e7c261b54840210f8bacff5abecb34.tar.gz packages_apps_Settings-8a50364a71e7c261b54840210f8bacff5abecb34.tar.bz2 |
Iterating on data usage; tabs, scrolling, cycles.
Added ActionBar items to control complexity of data surfaced; checked
state causes tabs to be shown/hidden for "Mobile", "2G-3G", "4G", and
"Wi-Fi" network templates. Loading historical stats and policy from
system services based on selected tab.
Change entire body under tabs to scroll, treating network options and
chart as ListView headers. Teach chart sweep to disable intercept to
play with ListView, and draw sweep disabled as dashed line. Hijacking
Preference views for toggles to offer consistency. No policy updates
are persisted yet.
Based on available historical network stats and policy cycle reset day,
build list of user-selectable cycles. Wired up chart to display cycle
data and reset inspection region to last week of available data.
Change-Id: Ia561578276fa23908b745fbc06a6ef828d9ccc2e
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/data_usage_header.xml | 49 | ||||
-rw-r--r-- | res/layout/data_usage_summary.xml | 38 | ||||
-rw-r--r-- | res/layout/tab_indicator_thin_holo.xml | 33 | ||||
-rw-r--r-- | res/menu/data_usage.xml | 33 | ||||
-rw-r--r-- | res/values/strings.xml | 33 |
5 files changed, 174 insertions, 12 deletions
diff --git a/res/layout/data_usage_header.xml b/res/layout/data_usage_header.xml new file mode 100644 index 0000000..4d8a5dd --- /dev/null +++ b/res/layout/data_usage_header.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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:orientation="vertical"> + + <LinearLayout + android:id="@+id/switches" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingLeft="16dip" + android:paddingRight="16dip"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:text="@string/data_usage_cycle" /> + + <Spinner + android:id="@+id/cycles" + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight="1" /> + + </LinearLayout> + +</LinearLayout> diff --git a/res/layout/data_usage_summary.xml b/res/layout/data_usage_summary.xml index 9a356ae..fc62465 100644 --- a/res/layout/data_usage_summary.xml +++ b/res/layout/data_usage_summary.xml @@ -14,20 +14,34 @@ limitations under the License. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<TabHost xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@android:id/tabhost" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="match_parent"> - <FrameLayout - android:id="@+id/chart_container" + <LinearLayout android:layout_width="match_parent" - android:layout_height="200dip" /> + android:layout_height="match_parent" + android:orientation="vertical"> - <ListView - android:id="@+id/list" - android:layout_width="match_parent" - android:layout_height="0dip" - android:layout_weight="1" /> + <TabWidget + android:id="@android:id/tabs" + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <!-- give an empty content area to make tabhost happy --> + <FrameLayout + android:id="@android:id/tabcontent" + android:layout_width="0dip" + android:layout_height="0dip" /> + + <ListView + android:id="@android:id/list" + android:layout_width="match_parent" + android:layout_height="0dip" + android:layout_weight="1" /> + + </LinearLayout> -</LinearLayout> +</TabHost> diff --git a/res/layout/tab_indicator_thin_holo.xml b/res/layout/tab_indicator_thin_holo.xml new file mode 100644 index 0000000..e4c4652 --- /dev/null +++ b/res/layout/tab_indicator_thin_holo.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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:layout_width="0dp" + android:layout_height="48dp" + android:layout_weight="1" + android:background="@*android:drawable/tab_indicator_holo"> + + <TextView + android:id="@android:id/title" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:singleLine="true" + android:ellipsize="marquee" + android:gravity="center" + android:textAppearance="?android:attr/textAppearanceMedium" /> + +</RelativeLayout> diff --git a/res/menu/data_usage.xml b/res/menu/data_usage.xml new file mode 100644 index 0000000..a95c074 --- /dev/null +++ b/res/menu/data_usage.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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/action_settings" + android:icon="@drawable/ic_sysbar_quicksettings" + android:showAsAction="always"> + <menu> + <item + android:id="@+id/action_split_4g" + android:title="@string/data_usage_menu_split_4g" + android:checkable="true" /> + <item + android:id="@+id/action_show_wifi" + android:title="@string/data_usage_menu_show_wifi" + android:checkable="true" /> + </menu> + </item> +</menu> diff --git a/res/values/strings.xml b/res/values/strings.xml index eaacf44..0c1abff 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3361,5 +3361,38 @@ found in the list of installed applications.</string> <!-- Activity title for network data usage summary. [CHAR LIMIT=25] --> <string name="data_usage_summary_title">Data usage</string> + <!-- Title for option to pick visible time range from a list available usage periods. [CHAR LIMIT=25] --> + <string name="data_usage_cycle">Data usage cycle</string> + <!-- Title for checkbox menu option to show 4G mobile data usage separate from other mobile data usage. [CHAR LIMIT=32] --> + <string name="data_usage_menu_split_4g">Split 4G usage</string> + <!-- Title for checkbox menu option to show Wi-Fi data usage. [CHAR LIMIT=32] --> + <string name="data_usage_menu_show_wifi">Show Wi-Fi usage</string> + <!-- Title for option to change data usage cycle day. [CHAR LIMIT=32] --> + <string name="data_usage_change_cycle">Change cycle\u2026</string> + <!-- Body of dialog prompting user to change numerical day of month that data usage cycle should reset. [CHAR LIMIT=64] --> + <string name="data_usage_pick_cycle_day">Day of month to reset data usage cycle:</string> + + <!-- Checkbox label that will disable mobile network data connection when user-defined limit is reached. [CHAR LIMIT=32] --> + <string name="data_usage_disable_mobile_limit">Disable mobile data at limit</string> + <!-- Checkbox label that will disable 4G network data connection when user-defined limit is reached. [CHAR LIMIT=32] --> + <string name="data_usage_disable_4g_limit">Disable 4G data at limit</string> + <!-- Checkbox label that will disable 2G-3G network data connection when user-defined limit is reached. [CHAR LIMIT=32] --> + <string name="data_usage_disable_3g_limit">Disable 2G-3G data at limit</string> + + <!-- Tab title for showing Wi-Fi data usage. [CHAR LIMIT=10] --> + <string name="data_usage_tab_wifi">Wi-Fi</string> + <!-- Tab title for showing combined mobile data usage. [CHAR LIMIT=10] --> + <string name="data_usage_tab_mobile">Mobile</string> + <!-- Tab title for showing 4G data usage. [CHAR LIMIT=10] --> + <string name="data_usage_tab_4g">4G</string> + <!-- Tab title for showing 2G and 3G data usage. [CHAR LIMIT=10] --> + <string name="data_usage_tab_3g">2G-3G</string> + + <!-- Toggle switch title for enabling all mobile data network connections. [CHAR LIMIT=32] --> + <string name="data_usage_enable_mobile">Mobile data</string> + <!-- Toggle switch title for enabling 2G and 3G data network connections. [CHAR LIMIT=32] --> + <string name="data_usage_enable_3g">2G-3G data</string> + <!-- Toggle switch title for enabling 4G data network connection. [CHAR LIMIT=32] --> + <string name="data_usage_enable_4g">4G data</string> </resources> |