Update Settings to use DeviceDefault.Settings.

BUG: 28625050

Change-Id: Id283703a309cf27bb284147421614196e903c660
This commit is contained in:
Andrew Sapperstein
2016-06-11 12:12:44 -07:00
parent b2728f51fb
commit 5b66e143cc
7 changed files with 18 additions and 46 deletions

View File

@@ -4,7 +4,6 @@
package com.android.settings.applications;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
@@ -13,9 +12,9 @@ import android.graphics.Rect;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.widget.LinearLayout;
import com.android.settings.Utils;
public class LinearColorBar extends LinearLayout {
@@ -71,11 +70,7 @@ public class LinearColorBar extends LinearLayout {
? 2 : 1;
mEdgeGradientPaint.setStrokeWidth(mLineWidth);
mEdgeGradientPaint.setAntiAlias(true);
Resources.Theme theme = context.getTheme();
TypedValue typedValue = new TypedValue();
theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
mLeftColor = mMiddleColor = context.getColor(typedValue.resourceId);
mLeftColor = mMiddleColor = Utils.getColorAccent(context);
}
public void setOnRegionTappedListener(OnRegionTappedListener listener) {

View File

@@ -21,7 +21,6 @@ import android.app.Dialog;
import android.app.Fragment;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.SystemClock;
import android.os.UserHandle;
@@ -29,7 +28,6 @@ import android.text.BidiFormatter;
import android.text.format.DateUtils;
import android.text.format.Formatter;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -44,6 +42,7 @@ import android.widget.TextView;
import com.android.internal.util.MemInfoReader;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
import java.util.ArrayList;
import java.util.Collections;
@@ -451,13 +450,8 @@ public class RunningProcessesView extends FrameLayout
mListView.addHeaderView(mHeader, null, false /* set as not selectable */);
mColorBar = (LinearColorBar)mHeader.findViewById(R.id.color_bar);
final Context context = getContext();
Resources.Theme theme = context.getTheme();
TypedValue typedValue = new TypedValue();
theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
mColorBar.setColors(context.getColor(R.color.running_processes_system_ram),
context.getColor(typedValue.resourceId),
Utils.getColorAccent(context),
context.getColor(R.color.running_processes_free_ram));
mBackgroundProcessPrefix = (TextView)mHeader.findViewById(R.id.freeSizePrefix);
mAppsProcessPrefix = (TextView)mHeader.findViewById(R.id.appsSizePrefix);

View File

@@ -19,17 +19,18 @@ package com.android.settings.fingerprint;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.annotation.ColorInt;
import android.annotation.Nullable;
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;
import com.android.settings.R;
import com.android.settings.Utils;
/**
* View which plays an animation to indicate where the sensor is on the device.
@@ -61,13 +62,11 @@ public class FingerprintLocationAnimationView extends View implements
R.fraction.fingerprint_sensor_location_fraction_x, 1, 1);
mFractionCenterY = getResources().getFraction(
R.fraction.fingerprint_sensor_location_fraction_y, 1, 1);
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true);
int color = getResources().getColor(typedValue.resourceId, null);
@ColorInt int colorAccent = Utils.getColorAccent(context);
mDotPaint.setAntiAlias(true);
mPulsePaint.setAntiAlias(true);
mDotPaint.setColor(color);
mPulsePaint.setColor(color);
mDotPaint.setColor(colorAccent);
mPulsePaint.setColor(colorAccent);
mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
android.R.interpolator.linear_out_slow_in);
mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,

View File

@@ -16,8 +16,6 @@
package com.android.settings.notification;
import android.content.res.Resources;
import android.util.TypedValue;
import com.android.settings.R;
import com.android.settings.SeekBarPreference;
@@ -33,6 +31,7 @@ import android.view.View;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import com.android.settings.Utils;
/**
* A slider preference that controls notification importance.
@@ -57,10 +56,7 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
setLayoutResource(R.layout.preference_importance_slider);
Resources.Theme theme = context.getTheme();
TypedValue typedValue = new TypedValue();
theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
mActiveSliderTint = ColorStateList.valueOf(context.getColor(typedValue.resourceId));
mActiveSliderTint = ColorStateList.valueOf(Utils.getColorAccent(context));
mInactiveSliderTint = ColorStateList.valueOf(
context.getColor(R.color.importance_disabled_slider_color));
mHandler = new Handler();