Draw vertical data usage sweep labels.

Using template string, ask axis to build label for sweeps.  Also
clean up margins exposed to parent view, since we offset when label
is larger than sweep drawable.

Bug: 4598460
Change-Id: If71bc8ec8c952023325c80b9bc00b63c23609c7a
This commit is contained in:
Jeff Sharkey
2011-07-09 01:02:56 -07:00
parent 890e352d5f
commit ec3be8a4a5
8 changed files with 226 additions and 89 deletions

View File

@@ -16,6 +16,9 @@
package com.android.settings.widget;
import android.content.res.Resources;
import android.text.SpannableStringBuilder;
/**
* Axis along a {@link ChartView} that knows how to convert between raw point
* and screen coordinate systems.
@@ -28,8 +31,7 @@ public interface ChartAxis {
public float convertToPoint(long value);
public long convertToValue(float point);
public CharSequence getLabel(long value);
public CharSequence getShortLabel(long value);
public void buildLabel(Resources res, SpannableStringBuilder builder, long value);
public float[] getTickPoints();