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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user