Update data usage UX

Update the UX and dig the data usage screen out of a huge whole of
technical debt.  Switch every to use Preferences rather than standard
layouts and ListViews.

Split data usage into several fragments, all separated.

DataUsageSummary:
 - Shows a summary of the 'default' usage at the top, this will be
   the default sim on phones, or wifi if it has it, or ethernet
   as last attempt to show something.
 - Also has individual categories for each network type that has
   data, cell, wifi, and ethernet. Maybe should look into bt though?

DataUsageList:
- Takes a NetworkTemplate as an input, and can only be reached from
  the network specific categories in DataUsageSummary
- Shows a graph of current usage for that network and links to
  app detail page for any app.
- Has gear link to quick get to billing cycle screen if available

BillingCycleSettings:
 - Just a screen with the cycle day and warning/limits separated
   out from the data usage.

AppDataUsage:
 - App specific data usage details
 - May need some UX iteration given lack of clarity in the spec

Bug: 22459566
Change-Id: I0222d8d7ea7b75a9775207a6026ebbdcce8f5e46
This commit is contained in:
Jason Monk
2016-01-11 14:27:20 -05:00
parent 703dae96e1
commit b37e2887d3
58 changed files with 3553 additions and 3309 deletions

View File

@@ -14,6 +14,12 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/data_sweep_limit_activated" />
</selector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="2dp"
android:height="14.5dp"
android:viewportWidth="2"
android:viewportHeight="56">
<path
android:fillColor="#ffffffff"
android:pathData="M0,48l2,0l0,8l-2,0l0,-8z" />
</vector>

View File

@@ -14,6 +14,12 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/data_sweep_warning_activated" />
</selector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="2dp"
android:height="14.5dp"
android:viewportWidth="2"
android:viewportHeight="56">
<path
android:fillColor="#ffffffff"
android:pathData="M0,48l2,0l0,8l-2,0l0,-8z" />
</vector>

View File

@@ -53,11 +53,5 @@
android:src="@drawable/ic_info"
style="?android:attr/borderlessButtonStyle" />
<View
android:id="@+id/row_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listDivider" />
</RelativeLayout>

View File

@@ -20,22 +20,34 @@
android:layout_height="?android:attr/actionBarSize"
android:background="@drawable/switchbar_background"
android:gravity="center_vertical"
android:paddingEnd="@dimen/switchbar_subsettings_margin_end"
android:theme="?attr/switchBarTheme" >
<Spinner
android:id="@+id/filter_spinner"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="64dp"
android:layout_marginEnd="70dp"
android:layout_alignWithParentIfMissing="true"
android:layout_centerVertical="true"
android:textAlignment="viewStart" />
<View
android:id="@+id/row_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listDivider" />
<ImageView
android:id="@+id/filter_settings"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:minHeight="0dp"
android:minWidth="0dp"
android:contentDescription="@string/configure"
android:scaleType="center"
android:src="@drawable/ic_settings_24dp"
style="?android:attr/borderlessButtonStyle"
android:visibility="gone" />
</RelativeLayout>

View File

@@ -0,0 +1,31 @@
<!--
Copyright (C) 2016 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">
<include layout="@layout/app_header" />
<View
android:layout_width="match_parent"
android:layout_height=".5dp"
android:background="@android:color/white" />
<include layout="@layout/apps_filter_spinner" />
</LinearLayout>

View File

@@ -22,8 +22,8 @@
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="@dimen/data_usage_chart_height"
android:paddingLeft="?android:attr/listPreferredItemPaddingStart"
android:paddingRight="40dp"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="16dp"
android:paddingBottom="24dp">

View File

@@ -31,14 +31,4 @@
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
android:textColor="?android:attr/textColorPrimary" />
<TextView
android:id="@+id/cycle_summary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
android:textColor="?android:attr/textColorPrimary"
android:textAlignment="viewEnd" />
</LinearLayout>

View File

@@ -1,58 +0,0 @@
<?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|end"
android:layout_marginBottom="5dp" >
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:scaleType="centerInside"
android:src="@color/memory_avg_use"
android:contentDescription="@null" />
<TextView
android:id="@+id/memory_avg"
android:text="@string/memory_avg_use"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textColor="?android:attr/textColorSecondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:scaleType="centerInside"
android:src="@color/memory_max_use"
android:contentDescription="@null" />
<TextView
android:id="@+id/memory_max"
android:text="@string/memory_max_use"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textColor="?android:attr/textColorSecondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp" />
</LinearLayout>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 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.
-->
<Space xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="0dp" />

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<!-- Layout used for PreferenceCategory in a PreferenceActivity. -->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:textAppearance="@android:style/TextAppearance.Material.Body2"
android:textColor="?android:attr/colorAccent"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="16dip" />

View File

@@ -18,95 +18,95 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container_material"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
android:id="@+id/container_material"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
<FrameLayout android:id="@+id/pinned_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
<FrameLayout
android:id="@android:id/list_container"
android:layout_height="0px"
android:layout_weight="1"
android:layout_width="match_parent">
<FrameLayout
android:id="@android:id/list_container"
android:layout_height="0px"
android:layout_weight="1"
android:layout_width="match_parent">
<ListView android:id="@+id/backup_list"
style="@style/PreferenceFragmentListSinglePane"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@dimen/settings_side_margin"
android:paddingEnd="@dimen/settings_side_margin"
android:paddingTop="@dimen/dashboard_padding_top"
android:paddingBottom="@dimen/dashboard_padding_bottom"
android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle"
android:clipToPadding="false"
android:drawSelectorOnTop="false"
android:elevation="@dimen/dashboard_category_elevation"
android:visibility="gone"
android:scrollbarAlwaysDrawVerticalTrack="true" />
style="@style/PreferenceFragmentListSinglePane"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@dimen/settings_side_margin"
android:paddingEnd="@dimen/settings_side_margin"
android:paddingTop="@dimen/dashboard_padding_top"
android:paddingBottom="@dimen/dashboard_padding_bottom"
android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle"
android:clipToPadding="false"
android:drawSelectorOnTop="false"
android:elevation="@dimen/dashboard_category_elevation"
android:visibility="gone"
android:scrollbarAlwaysDrawVerticalTrack="true" />
<include layout="@layout/loading_container" />
<com.android.settings.widget.FloatingActionButton
android:id="@+id/fab"
android:visibility="gone"
android:clickable="true"
android:layout_width="@dimen/fab_size"
android:layout_height="@dimen/fab_size"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"
android:elevation="@dimen/fab_elevation"
android:background="@drawable/fab_background" />
android:id="@+id/fab"
android:visibility="gone"
android:clickable="true"
android:layout_width="@dimen/fab_size"
android:layout_height="@dimen/fab_size"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"
android:elevation="@dimen/fab_elevation"
android:background="@drawable/fab_background" />
</FrameLayout>
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@*android:dimen/preference_fragment_padding_side"
android:gravity="center"
android:visibility="gone" />
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@*android:dimen/preference_fragment_padding_side"
android:gravity="center"
android:visibility="gone" />
<RelativeLayout android:id="@+id/button_bar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="0"
android:visibility="gone">
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"
/>
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:text="@*android:string/next_button_label"
/>
</LinearLayout>

View File

@@ -1,45 +0,0 @@
<?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:id="@+id/all_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:orientation="vertical">
<TextView
android:id="@+id/memory_state"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:textColor="?android:attr/colorAccent"
android:textAppearance="@android:style/TextAppearance.Material.Display1"
/>
<com.android.settings.applications.LinearColorBar
android:id="@+id/color_bar"
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_marginBottom="15dp"
/>
</LinearLayout>

View File

@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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/all_details"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
<com.android.settings.applications.LinearColorBar
android:id="@+id/color_bar"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="10dp"
/>
<include layout="@layout/memory_key" />
<!-- Force stop and report buttons -->
<LinearLayout
android:id="@+id/two_buttons_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="6dip"
android:orientation="vertical">
<include layout="@layout/two_buttons_panel"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 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:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:orientation="vertical">
<TextView
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="5dp"
android:textColor="?android:attr/colorAccent"
android:textAppearance="@android:style/TextAppearance.Material.Display1"
/>
<TextView android:id="@android:id/summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary"
android:paddingBottom="5dp"
android:maxLines="10" />
<com.android.settings.applications.LinearColorBar
android:id="@+id/color_bar"
android:layout_width="match_parent"
android:layout_height="28dp"
/>
<LinearLayout
android:id="@+id/label_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="2dp"
android:orientation="horizontal">
<TextView android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView android:id="@android:id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
</LinearLayout>

View File

@@ -15,25 +15,7 @@
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/data_usage_menu_restrict_background"
android:title="@string/data_usage_menu_restrict_background" />
<item
android:id="@+id/data_usage_menu_show_wifi"
android:title="@string/data_usage_menu_show_wifi" />
<item
android:id="@+id/data_usage_menu_show_ethernet"
android:title="@string/data_usage_menu_show_ethernet" />
<item
android:id="@+id/data_usage_menu_metered"
android:title="@string/data_usage_menu_metered" />
<item
android:id="@+id/data_usage_menu_sim_cards"
android:title="@string/data_usage_menu_sim_cards" />
<item
android:id="@+id/data_usage_menu_cellular_networks"
android:title="@string/data_usage_menu_cellular_networks" />
<item
android:id="@+id/data_usage_menu_help"
android:title="@string/help_label" />
</menu>

View File

@@ -94,12 +94,13 @@
<color name="memory_critical">#ffff5621</color>
<color name="memory_avg_use">#ff384248</color>
<color name="memory_max_use">#ff009587</color>
<color name="memory_remaining">#ffced7db</color>
<color name="zen_rule_name_warning">@color/system_warning_color</color>
<!-- Accent color that matches the settings launcher icon -->
<color name="icon_accent">#ffabffec</color>
<color name="summary_default_start">#ff009587</color>
<color name="summary_default_end">#ffced7db</color>
</resources>

View File

@@ -586,7 +586,7 @@
<!-- mobile network settings screen, button on dialog box that appears when you are roaming and clear the "Data roaming" check box -->
<string name="roaming_turn_it_on_button">Turn it on</string>
<!-- mobile network settings screen, message in dialog box that appears when you select the "Data roaming" check box -->
<string name="roaming_warning">When you allow data roaming, you may incur significant roaming charges!</string>
<string name="roaming_warning">You may incur significant charges.</string>
<!-- mobile network settings screen, message in dialog box that appears when you select the "Data roaming" check box. This is for multiuser tablets [CHAR LIMIT=none] -->
<string name="roaming_warning_multiuser" product="tablet">When you allow data roaming, you may incur significant roaming charges!\n\nThis setting affects all users on this tablet.</string>
<!-- mobile network settings screen, message in dialog box that appears when you select the "Data roaming" check box. This is for multiuser phones [CHAR LIMIT=none] -->
@@ -6809,4 +6809,75 @@
<!-- Description of the setting to change the display's color temperature -->
<string name="color_temperature_desc">Enable cool temperature</string>
<!-- Label for category for data usage [CHAR LIMIT=30] -->
<string name="usage">Usage</string>
<!-- Label for cellular data usage in data usage screen [CHAR LIMIT=60] -->
<string name="cellular_data_usage">Cellular data usage</string>
<!-- Label for wifi data usage in data usage screen [CHAR LIMIT=60] -->
<string name="wifi_data_usage">Wi-Fi data usage</string>
<!-- Label for ethernet data usage in data usage screen [CHAR LIMIT=60] -->
<string name="ethernet_data_usage">Ethernet data usage</string>
<!-- Label for section about wifi in data usage screen [CHAR LIMIT=60] -->
<string name="wifi">Wi-Fi</string>
<!-- Label for section about ethernet in data usage screen [CHAR LIMIT=60] -->
<string name="ethernet">Ethernet</string>
<!-- Format string for amount of cellular data used [CHAR LIMIT=30] -->
<string name="cell_data_template"><xliff:g name="units" example="GB">%1$s</xliff:g> cellular data</string>
<!-- Format string for amount of wifi data used [CHAR LIMIT=30] -->
<string name="wifi_data_template"><xliff:g name="units" example="GB">%1$s</xliff:g> Wi-Fi data</string>
<!-- Format string for amount of ethernet data used [CHAR LIMIT=30] -->
<string name="ethernet_data_template"><xliff:g name="units" example="GB">%1$s</xliff:g> ethernet data</string>
<!-- Format for a summary describing the amount of data before the user is warned [CHAR LIMIT=NONE] -->
<string name="cell_warning_only"><xliff:g name="amount" example="1 GB">%1$s</xliff:g> Data warning</string>
<!-- Format for a summary describing the amount of data before the user is warned or limited [CHAR LIMIT=NONE] -->
<string name="cell_warning_and_limit"><xliff:g name="amount" example="1 GB">%1$s</xliff:g> Data warning / <xliff:g name="amount" example="2 GB">%2$s</xliff:g> Data limit</string>
<!-- Title of button and screen for billing cycle preferences [CHAR LIMIT=30 -->
<string name="billing_cycle">Billing cycle</string>
<!-- Summary describing when the billing cycle for their phone carrier starts [CHAR LIMIT=NONE] -->
<string name="billing_cycle_summary">Monthly cycle starts on the <xliff:g name="day" example="1st">%1$s</xliff:g> of every month</string>
<!-- Summary describing when the billing cycle for their phone carrier starts [CHAR LIMIT=NONE] -->
<string name="billing_cycle_fragment_summary">Monthly starting <xliff:g name="day_of_month" example="1st">%1$s</xliff:g></string>
<!-- Title of button and screen for which wifi networks have data restrictions [CHAR LIMIT=30 -->
<string name="network_restrictions">Network restrictions</string>
<!-- A summary shown on data usage screens to indicate inaccuracy of data tracking [CHAR LIMIT=NONE] -->
<string name="operator_warning">Operator data accounting may differ from your device.</string>
<!-- Format string describing how much data has been used [CHAR LIMIT=20] -->
<string name="data_used_template"><xliff:g name="amount" example="1 GB">%1$s</xliff:g> used</string>
<!-- Label for button to set the amount of data before user is warned about usage [CHAR LIMIT=30] -->
<string name="data_warning">Data warning</string>
<!-- Label for switch about whether to limit how much data can be used [CHAR LIMIT=30] -->
<string name="set_data_limit">Set data limit</string>
<!-- Label for button to set the amount of data before user is limited [CHAR LIMIT=30] -->
<string name="data_limit">Data limit</string>
<!-- Summary about how much data has been used in a date range [CHAR LIMIT=NONE] -->
<string name="data_usage_template"><xliff:g name="amount" example="200 MB">%1$s</xliff:g> used between <xliff:g name="date_range" example="Jan 1 -- Feb 2">%2$s</xliff:g></string>
<!-- Accessibility label for button that leads to screen with more configuration options [CHAR LIMIT=NONE] -->
<string name="configure">Configure</string>
<!-- TODO: Actually figure out what to do with the extra apps, and update
the code to do that -->
<string name="data_usage_other_apps" translatable="false">Other apps included in usage</string>
</resources>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/data_usage_summary_title">
<com.android.settings.applications.SpacePreference
android:layout_height="8dp" />
<Preference
android:key="total_usage"
android:title="@string/total_size_label"
android:selectable="false"
android:layout="@layout/horizontal_preference" />
<Preference
android:key="foreground_usage"
android:title="@string/data_usage_label_foreground"
android:selectable="false"
android:layout="@layout/horizontal_preference" />
<Preference
android:key="background_usage"
android:title="@string/data_usage_label_background"
android:selectable="false"
android:layout="@layout/horizontal_preference" />
<com.android.settings.applications.SpacePreference
android:layout_height="8dp" />
<Preference
android:key="app_settings"
android:title="@string/data_usage_app_settings" />
<SwitchPreference
android:key="restrict_background"
android:title="@string/data_usage_app_restrict_background"
android:summary="@string/data_usage_app_restrict_background_summary" />
<PreferenceCategory
android:key="app_list"
android:title="@string/data_usage_other_apps" />
</PreferenceScreen>

View File

@@ -18,11 +18,15 @@
android:title="@string/memory_usage">
<PreferenceCategory
android:title="@string/average_memory_use" />
android:title="@string/average_memory_use"
android:layout="@layout/preference_category_short" />
<com.android.settings.applications.LayoutPreference
<com.android.settings.SummaryPreference
android:key="status_header"
android:layout="@layout/proc_stats_ui" />
android:selectable="false" />
<com.android.settings.applications.SpacePreference
android:layout_height="5dp" />
<Preference
android:key="frequency"

36
res/xml/billing_cycle.xml Normal file
View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/data_usage_summary_title">
<Preference
android:key="billing_cycle"
android:title="@string/billing_cycle" />
<Preference
android:key="data_warning"
android:title="@string/data_warning" />
<SwitchPreference
android:key="set_data_limit"
android:title="@string/set_data_limit" />
<Preference
android:key="data_limit"
android:title="@string/data_limit" />
</PreferenceScreen>

38
res/xml/data_usage.xml Normal file
View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/data_usage_summary_title">
<PreferenceCategory
android:title="@string/usage"
android:layout="@layout/preference_category_short">
<com.android.settings.SummaryPreference
android:key="status_header"
android:selectable="false" />
<Preference
android:key="limit_summary"
android:selectable="false" />
<com.android.settings.datausage.RestrictBackgroundDataPreference
android:key="restrict_background"
android:title="@string/data_usage_menu_restrict_background" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.settings.datausage.TemplatePreferenceCategory
android:key="mobile_category"
android:title="@string/data_usage_tab_mobile">
<com.android.settings.datausage.CellDataPreference
android:key="data_usage_enable"
android:title="@string/data_usage_enable_mobile" />
<com.android.settings.datausage.DataUsagePreference
android:key="cellular_data_usage"
android:title="@string/cellular_data_usage" />
<com.android.settings.datausage.BillingCyclePreference
android:key="billing_preference"
android:title="@string/billing_cycle" />
</com.android.settings.datausage.TemplatePreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.settings.datausage.TemplatePreferenceCategory
android:key="ethernet_category"
android:title="@string/ethernet">
<com.android.settings.datausage.DataUsagePreference
android:key="ethernet_data_usage"
android:title="@string/ethernet_data_usage" />
</com.android.settings.datausage.TemplatePreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/data_usage_summary_title">
<PreferenceCategory
android:key="usage_amount"
android:layout="@layout/preference_category_short">
<com.android.settings.datausage.ChartDataUsagePreference
android:key="chart_data" />
<Preference
android:summary="@string/operator_warning"
android:selectable="false" />
</PreferenceCategory>
<PreferenceCategory
android:key="apps_group"
android:layout="@layout/preference_category_no_label" />
</PreferenceScreen>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.settings.datausage.TemplatePreferenceCategory
android:key="wifi_category"
android:title="@string/wifi">
<com.android.settings.datausage.DataUsagePreference
android:key="wifi_data_usage"
android:title="@string/wifi_data_usage" />
<com.android.settings.datausage.NetworkRestrictionsPreference
android:key="network_restrictions"
android:title="@string/network_restrictions"
android:fragment="com.android.settings.datausage.DataUsageMeteredSettings" />
</com.android.settings.datausage.TemplatePreferenceCategory>
</PreferenceScreen>

View File

@@ -18,13 +18,17 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/app_memory_use"
android:key="app_list">
<PreferenceCategory
android:title="@string/average_memory_use" />
<com.android.settings.applications.LayoutPreference
<PreferenceCategory
android:title="@string/average_memory_use"
android:layout="@layout/preference_category_short" />
<com.android.settings.SummaryPreference
android:key="status_header"
android:selectable="false"
android:layout="@layout/proc_stats_ui" />
android:selectable="false" />
<com.android.settings.applications.SpacePreference
android:layout_height="5dp" />
<Preference
android:key="performance"