summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-06-23 00:39:38 -0700
committerJeff Sharkey <jsharkey@android.com>2011-06-23 00:39:47 -0700
commit52c3f4461b806e4f1ce48455ee2ba0ac05dfdab4 (patch)
tree413297650a61f914f6e212b73af8fb76cacbc3d9 /res
parentaef3981e86909a6a5b4f6ecab972e43fd77582c1 (diff)
downloadpackages_apps_settings-52c3f4461b806e4f1ce48455ee2ba0ac05dfdab4.zip
packages_apps_settings-52c3f4461b806e4f1ce48455ee2ba0ac05dfdab4.tar.gz
packages_apps_settings-52c3f4461b806e4f1ce48455ee2ba0ac05dfdab4.tar.bz2
Iterate on data usage chart UI.
Switched to inflating chart views from XML, using attributes for configuration. Start using drawable assets for chart components instead of manually painting. Include hand-cut assets, and animate between states when touched to invoke. Clamp sweeps to valid chart ranges and prepare for sweep labels. Bug: 4768483, 4598460 Change-Id: Ic660c35bec826eb5e3f6a1dde3cc04d8c437ef2b
Diffstat (limited to 'res')
-rw-r--r--res/drawable-hdpi/data_grid_border.9.pngbin0 -> 229 bytes
-rw-r--r--res/drawable-hdpi/data_grid_primary.9.pngbin0 -> 203 bytes
-rw-r--r--res/drawable-hdpi/data_grid_secondary.9.pngbin0 -> 193 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_left_activated.9.pngbin0 -> 851 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_left_default.9.pngbin0 -> 790 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_limit_activated.9.pngbin0 -> 711 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_limit_default.9.pngbin0 -> 833 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_right_activated.9.pngbin0 -> 766 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_right_default.9.pngbin0 -> 799 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_warning_activated.9.pngbin0 -> 813 bytes
-rw-r--r--res/drawable-hdpi/data_sweep_warning_default.9.pngbin0 -> 847 bytes
-rw-r--r--res/drawable/data_sweep_left.xml22
-rw-r--r--res/drawable/data_sweep_limit.xml22
-rw-r--r--res/drawable/data_sweep_right.xml22
-rw-r--r--res/drawable/data_sweep_warning.xml22
-rw-r--r--res/layout/data_usage_chart.xml79
-rw-r--r--res/layout/data_usage_item.xml39
-rw-r--r--res/values/attrs.xml22
-rw-r--r--res/values/strings.xml7
19 files changed, 233 insertions, 2 deletions
diff --git a/res/drawable-hdpi/data_grid_border.9.png b/res/drawable-hdpi/data_grid_border.9.png
new file mode 100644
index 0000000..e0110b6
--- /dev/null
+++ b/res/drawable-hdpi/data_grid_border.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_grid_primary.9.png b/res/drawable-hdpi/data_grid_primary.9.png
new file mode 100644
index 0000000..a2b7b82
--- /dev/null
+++ b/res/drawable-hdpi/data_grid_primary.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_grid_secondary.9.png b/res/drawable-hdpi/data_grid_secondary.9.png
new file mode 100644
index 0000000..f13bf78
--- /dev/null
+++ b/res/drawable-hdpi/data_grid_secondary.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_left_activated.9.png b/res/drawable-hdpi/data_sweep_left_activated.9.png
new file mode 100644
index 0000000..e91ccf5
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_left_activated.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_left_default.9.png b/res/drawable-hdpi/data_sweep_left_default.9.png
new file mode 100644
index 0000000..76f33a5
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_left_default.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_limit_activated.9.png b/res/drawable-hdpi/data_sweep_limit_activated.9.png
new file mode 100644
index 0000000..4744037
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_limit_activated.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_limit_default.9.png b/res/drawable-hdpi/data_sweep_limit_default.9.png
new file mode 100644
index 0000000..dea3a0b
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_limit_default.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_right_activated.9.png b/res/drawable-hdpi/data_sweep_right_activated.9.png
new file mode 100644
index 0000000..afb15d6
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_right_activated.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_right_default.9.png b/res/drawable-hdpi/data_sweep_right_default.9.png
new file mode 100644
index 0000000..9d3808f
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_right_default.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_warning_activated.9.png b/res/drawable-hdpi/data_sweep_warning_activated.9.png
new file mode 100644
index 0000000..81a7aa8
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_warning_activated.9.png
Binary files differ
diff --git a/res/drawable-hdpi/data_sweep_warning_default.9.png b/res/drawable-hdpi/data_sweep_warning_default.9.png
new file mode 100644
index 0000000..e2485fe
--- /dev/null
+++ b/res/drawable-hdpi/data_sweep_warning_default.9.png
Binary files differ
diff --git a/res/drawable/data_sweep_left.xml b/res/drawable/data_sweep_left.xml
new file mode 100644
index 0000000..739a74e
--- /dev/null
+++ b/res/drawable/data_sweep_left.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+
+ <item android:state_activated="true" android:drawable="@drawable/data_sweep_left_activated" />
+ <item android:state_activated="false" android:drawable="@drawable/data_sweep_left_default" />
+</selector>
diff --git a/res/drawable/data_sweep_limit.xml b/res/drawable/data_sweep_limit.xml
new file mode 100644
index 0000000..29ecec8
--- /dev/null
+++ b/res/drawable/data_sweep_limit.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+
+ <item android:state_activated="true" android:drawable="@drawable/data_sweep_limit_activated" />
+ <item android:state_activated="false" android:drawable="@drawable/data_sweep_limit_default" />
+</selector>
diff --git a/res/drawable/data_sweep_right.xml b/res/drawable/data_sweep_right.xml
new file mode 100644
index 0000000..1a11469
--- /dev/null
+++ b/res/drawable/data_sweep_right.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+
+ <item android:state_activated="true" android:drawable="@drawable/data_sweep_right_activated" />
+ <item android:state_activated="false" android:drawable="@drawable/data_sweep_right_default" />
+</selector>
diff --git a/res/drawable/data_sweep_warning.xml b/res/drawable/data_sweep_warning.xml
new file mode 100644
index 0000000..5cafe06
--- /dev/null
+++ b/res/drawable/data_sweep_warning.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+
+ <item android:state_activated="true" android:drawable="@drawable/data_sweep_warning_activated" />
+ <item android:state_activated="false" android:drawable="@drawable/data_sweep_warning_default" />
+</selector>
diff --git a/res/layout/data_usage_chart.xml b/res/layout/data_usage_chart.xml
new file mode 100644
index 0000000..5fd640f
--- /dev/null
+++ b/res/layout/data_usage_chart.xml
@@ -0,0 +1,79 @@
+<?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.
+-->
+
+<com.android.settings.widget.DataUsageChartView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+ android:layout_width="match_parent"
+ android:layout_height="220dip"
+ android:padding="16dip">
+
+ <com.android.settings.widget.ChartGridView
+ android:id="@+id/grid"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="left|bottom"
+ settings:primaryDrawable="@drawable/data_grid_primary"
+ settings:secondaryDrawable="@drawable/data_grid_secondary"
+ settings:borderDrawable="@drawable/data_grid_border"
+ settings:labelColor="#24aae1" />
+
+ <com.android.settings.widget.ChartNetworkSeriesView
+ android:id="@+id/series"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="left|bottom"
+ settings:strokeColor="#24aae1"
+ settings:fillColor="#c050ade5"
+ settings:fillColorSecondary="#88566abc" />
+
+ <com.android.settings.widget.ChartSweepView
+ android:id="@+id/sweep_left"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal"
+ settings:sweepDrawable="@drawable/data_sweep_left"
+ settings:followAxis="horizontal"
+ settings:showLabel="false" />
+
+ <com.android.settings.widget.ChartSweepView
+ android:id="@+id/sweep_right"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal"
+ settings:sweepDrawable="@drawable/data_sweep_right"
+ settings:followAxis="horizontal"
+ settings:showLabel="false" />
+
+ <com.android.settings.widget.ChartSweepView
+ android:id="@+id/sweep_limit"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ settings:sweepDrawable="@drawable/data_sweep_limit"
+ settings:followAxis="vertical"
+ settings:showLabel="true" />
+
+ <com.android.settings.widget.ChartSweepView
+ android:id="@+id/sweep_warning"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ settings:sweepDrawable="@drawable/data_sweep_warning"
+ settings:followAxis="vertical"
+ settings:showLabel="true" />
+
+</com.android.settings.widget.DataUsageChartView>
diff --git a/res/layout/data_usage_item.xml b/res/layout/data_usage_item.xml
new file mode 100644
index 0000000..6451e21
--- /dev/null
+++ b/res/layout/data_usage_item.xml
@@ -0,0 +1,39 @@
+<?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:minHeight="48dip"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@android:id/text1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="6dip"
+ android:layout_marginTop="6dip"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <TextView
+ android:id="@android:id/text2"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="6dip"
+ android:layout_marginBottom="6dip"
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+
+</LinearLayout>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 7cff69c..06d2650 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -49,4 +49,26 @@
<!-- Minimum tick width for each slice in the bar chart. -->
<attr name="minTickWidth" format="dimension" />
</declare-styleable>
+
+ <declare-styleable name="ChartSweepView">
+ <attr name="sweepDrawable" format="reference" />
+ <attr name="followAxis">
+ <enum name="horizontal" value="0" />
+ <enum name="vertical" value="1" />
+ </attr>
+ <attr name="showLabel" format="boolean" />
+ </declare-styleable>
+
+ <declare-styleable name="ChartGridView">
+ <attr name="primaryDrawable" format="reference" />
+ <attr name="secondaryDrawable" format="reference" />
+ <attr name="borderDrawable" format="reference" />
+ <attr name="labelColor" format="color" />
+ </declare-styleable>
+
+ <declare-styleable name="ChartNetworkSeriesView">
+ <attr name="strokeColor" format="color" />
+ <attr name="fillColor" format="color" />
+ <attr name="fillColorSecondary" format="color" />
+ </declare-styleable>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 986d867..5839934 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3456,7 +3456,7 @@ found in the list of installed applications.</string>
<!-- Subtitle of dialog for editing data usage cycle reset date. [CHAR LIMIT=32] -->
<string name="data_usage_cycle_editor_subtitle">Date of each month:</string>
<!-- Positive button title for data usage cycle editor, confirming that changes should be saved. [CHAR LIMIT=32] -->
- <string name="data_usage_cycle_editor_positive">set</string>
+ <string name="data_usage_cycle_editor_positive">Set</string>
<!-- Title of dialog shown before user limits data usage. [CHAR LIMIT=48] -->
<string name="data_usage_limit_dialog_title">Limiting data usage</string>
@@ -3476,6 +3476,9 @@ found in the list of installed applications.</string>
<!-- Body of dialog shown when data usage has exceeded limit and has been disabled. [CHAR LIMIT=NONE] -->
<string name="data_usage_disabled_dialog">The specified data usage limit has been reached.\n\nAdditional data use may incur carrier charges.</string>
<!-- Dialog button indicating that data connection should be re-enabled. [CHAR LIMIT=28] -->
- <string name="data_usage_disabled_dialog_enable">re-enable data</string>
+ <string name="data_usage_disabled_dialog_enable">Re-enable data</string>
+
+ <!-- Label displaying current network data usage warning threshold. [CHAR LIMIT=18] -->
+ <string name="data_usage_sweep_warning"><font size="32"><xliff:g id="number" example="128">%1$s</xliff:g></font> <font size="12"><xliff:g id="unit" example="KB">%2$s</xliff:g></font>\n<font size="12">warning</font></string>
</resources>