am 28efc11e: am f5a7d673: am d7dbe161: Merge "Fix some dark theme issues (Take 2)" into mnc-dev

* commit '28efc11e2bfd94f4b5ba962201f99bbf946b7d27':
  Fix some dark theme issues (Take 2)
This commit is contained in:
Jason Monk
2015-06-05 13:54:33 +00:00
committed by Android Git Automerger
15 changed files with 69 additions and 20 deletions

View File

@@ -123,14 +123,15 @@ public class ChartSweepView extends View {
final TypedArray a = context.obtainStyledAttributes(
attrs, R.styleable.ChartSweepView, defStyle, 0);
setSweepDrawable(a.getDrawable(R.styleable.ChartSweepView_sweepDrawable));
final int color = a.getColor(R.styleable.ChartSweepView_labelColor, Color.BLUE);
setSweepDrawable(a.getDrawable(R.styleable.ChartSweepView_sweepDrawable), color);
setFollowAxis(a.getInt(R.styleable.ChartSweepView_followAxis, -1));
setNeighborMargin(a.getDimensionPixelSize(R.styleable.ChartSweepView_neighborMargin, 0));
setSafeRegion(a.getDimensionPixelSize(R.styleable.ChartSweepView_safeRegion, 0));
setLabelMinSize(a.getDimensionPixelSize(R.styleable.ChartSweepView_labelSize, 0));
setLabelTemplate(a.getResourceId(R.styleable.ChartSweepView_labelTemplate, 0));
setLabelColor(a.getColor(R.styleable.ChartSweepView_labelColor, Color.BLUE));
setLabelColor(color);
// TODO: moved focused state directly into assets
setBackgroundResource(R.drawable.data_usage_sweep_background);
@@ -213,7 +214,7 @@ public class ChartSweepView extends View {
requestLayout();
}
public void setSweepDrawable(Drawable sweep) {
public void setSweepDrawable(Drawable sweep, int color) {
if (mSweep != null) {
mSweep.setCallback(null);
unscheduleDrawable(mSweep);
@@ -226,6 +227,8 @@ public class ChartSweepView extends View {
}
sweep.setVisible(getVisibility() == VISIBLE, false);
mSweep = sweep;
// Match the text.
mSweep.setTint(color);
sweep.getPadding(mSweepPadding);
} else {
mSweep = null;