Prevent data usage chart sweeps from crossing.

Add rules to clamp sweeps, since it doesn't make sense to have a
limit below warning.

Bug: 4598462
Change-Id: I3323c7bca7fabe3e3f1e9c89906c3a921103579c
This commit is contained in:
Jeff Sharkey
2011-07-10 12:23:55 -07:00
parent 9fab0da184
commit 4ec71e79ef
2 changed files with 49 additions and 2 deletions

View File

@@ -87,6 +87,12 @@ public class DataUsageChartView extends ChartView {
mSweepLimit = (ChartSweepView) findViewById(R.id.sweep_limit);
mSweepWarning = (ChartSweepView) findViewById(R.id.sweep_warning);
// prevent sweeps from crossing each other
mSweepLeft.setClampBefore(mSweepRight);
mSweepRight.setClampAfter(mSweepLeft);
mSweepLimit.setClampBefore(mSweepWarning);
mSweepWarning.setClampAfter(mSweepLimit);
mSweepLeft.addOnSweepListener(mSweepListener);
mSweepRight.addOnSweepListener(mSweepListener);
mSweepWarning.addOnSweepListener(mWarningListener);