summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/widget
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-06-13 00:42:03 -0700
committerJeff Sharkey <jsharkey@android.com>2011-06-13 00:42:22 -0700
commit4dfa66001d20d1b461ef15f94887aa050d9295cf (patch)
treeaaedd76032007e981a64ac32ddd34acd3dcc51bd /src/com/android/settings/widget
parent05cc0cc4a620009a9ec7bdcc2ccb3878f59c8697 (diff)
downloadpackages_apps_settings-4dfa66001d20d1b461ef15f94887aa050d9295cf.zip
packages_apps_settings-4dfa66001d20d1b461ef15f94887aa050d9295cf.tar.gz
packages_apps_settings-4dfa66001d20d1b461ef15f94887aa050d9295cf.tar.bz2
First pass at detailed app data usage, policy.
Fragment to show application data usage details, including chart with inspection ranges. Button that invokes ACTION_MANAGE_NETWORK_USAGE towards application, and UID-specific policy controls. Fragment is launched when clicking list items from data usage summary page. Change-Id: Ie1564aa8af98e1a7083817a997059a5a7b1caa50
Diffstat (limited to 'src/com/android/settings/widget')
-rw-r--r--src/com/android/settings/widget/ChartNetworkSeriesView.java23
-rw-r--r--src/com/android/settings/widget/DataUsageChartView.java7
2 files changed, 21 insertions, 9 deletions
diff --git a/src/com/android/settings/widget/ChartNetworkSeriesView.java b/src/com/android/settings/widget/ChartNetworkSeriesView.java
index d0a2742..5fc79dd 100644
--- a/src/com/android/settings/widget/ChartNetworkSeriesView.java
+++ b/src/com/android/settings/widget/ChartNetworkSeriesView.java
@@ -40,9 +40,9 @@ public class ChartNetworkSeriesView extends View {
private final ChartAxis mHoriz;
private final ChartAxis mVert;
- private final Paint mPaintStroke;
- private final Paint mPaintFill;
- private final Paint mPaintFillDisabled;
+ private Paint mPaintStroke;
+ private Paint mPaintFill;
+ private Paint mPaintFillDisabled;
private NetworkStatsHistory mStats;
@@ -58,24 +58,29 @@ public class ChartNetworkSeriesView extends View {
mHoriz = Preconditions.checkNotNull(horiz, "missing horiz");
mVert = Preconditions.checkNotNull(vert, "missing vert");
+ setChartColor(Color.parseColor("#24aae1"), Color.parseColor("#c050ade5"),
+ Color.parseColor("#88566abc"));
+
+ mPathStroke = new Path();
+ mPathFill = new Path();
+ }
+
+ public void setChartColor(int stroke, int fill, int disabled) {
mPaintStroke = new Paint();
mPaintStroke.setStrokeWidth(6.0f);
- mPaintStroke.setColor(Color.parseColor("#24aae1"));
+ mPaintStroke.setColor(stroke);
mPaintStroke.setStyle(Style.STROKE);
mPaintStroke.setAntiAlias(true);
mPaintFill = new Paint();
- mPaintFill.setColor(Color.parseColor("#c050ade5"));
+ mPaintFill.setColor(fill);
mPaintFill.setStyle(Style.FILL);
mPaintFill.setAntiAlias(true);
mPaintFillDisabled = new Paint();
- mPaintFillDisabled.setColor(Color.parseColor("#88566abc"));
+ mPaintFillDisabled.setColor(disabled);
mPaintFillDisabled.setStyle(Style.FILL);
mPaintFillDisabled.setAntiAlias(true);
-
- mPathStroke = new Path();
- mPathFill = new Path();
}
public void bindNetworkStats(NetworkStatsHistory stats) {
diff --git a/src/com/android/settings/widget/DataUsageChartView.java b/src/com/android/settings/widget/DataUsageChartView.java
index 6a702d0..9dbffcd 100644
--- a/src/com/android/settings/widget/DataUsageChartView.java
+++ b/src/com/android/settings/widget/DataUsageChartView.java
@@ -86,6 +86,13 @@ public class DataUsageChartView extends ChartView {
mSweepTime1.addOnSweepListener(mSweepListener);
mSweepTime2.addOnSweepListener(mSweepListener);
+ mSweepDataWarn.setVisibility(View.INVISIBLE);
+ mSweepDataLimit.setVisibility(View.INVISIBLE);
+
+ }
+
+ public void setChartColor(int stroke, int fill, int disabled) {
+ mSeries.setChartColor(stroke, fill, disabled);
}
public void setListener(DataUsageChartListener listener) {