Merge "Fix some dark theme issues (Take 2)" into mnc-dev

This commit is contained in:
Jason Monk
2015-06-05 13:23:12 +00:00
committed by Android (Google) Code Review
15 changed files with 69 additions and 20 deletions

View File

@@ -114,7 +114,8 @@ public class AccountPreference extends Preference {
int res;
switch (status) {
case SYNC_ENABLED:
res = R.drawable.ic_sync_green_holo;
case SYNC_IN_PROGRESS:
res = R.drawable.ic_settings_sync;
break;
case SYNC_DISABLED:
res = R.drawable.ic_sync_grey_holo;
@@ -122,9 +123,6 @@ public class AccountPreference extends Preference {
case SYNC_ERROR:
res = R.drawable.ic_sync_red_holo;
break;
case SYNC_IN_PROGRESS:
res = R.drawable.ic_sync_green_holo;
break;
default:
res = R.drawable.ic_sync_red_holo;
Log.e(TAG, "Unknown sync status: " + status);

View File

@@ -296,7 +296,7 @@ public class AccountSettings extends SettingsPreferenceFragment
private Preference newAddAccountPreference(Context context) {
Preference preference = new Preference(context);
preference.setTitle(R.string.add_account_label);
preference.setIcon(R.drawable.ic_menu_add_dark);
preference.setIcon(R.drawable.ic_menu_add);
preference.setOnPreferenceClickListener(this);
preference.setOrder(ORDER_NEXT_TO_LAST);
return preference;

View File

@@ -24,6 +24,7 @@ import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
@@ -59,7 +60,9 @@ public class FingerprintLocationAnimationView extends View {
R.fraction.fingerprint_sensor_location_fraction_x, 1, 1);
mFractionCenterY = getResources().getFraction(
R.fraction.fingerprint_sensor_location_fraction_y, 1, 1);
int color = getResources().getColor(R.color.fingerprint_dot_color, null);
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true);
int color = getResources().getColor(typedValue.resourceId, null);
mDotPaint.setAntiAlias(true);
mPulsePaint.setAntiAlias(true);
mDotPaint.setColor(color);

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;