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

@@ -19,4 +19,5 @@
android:id="@+id/sliding_tab_selected_indicator"
android:layout_width="wrap_content"
android:layout_height="@dimen/pager_tabs_selected_indicator_height"
android:background="@color/accent_color_lighter"/>
android:background="?android:attr/colorAccent"
android:theme="@*android:style/ThemeOverlay.DeviceDefault.Accent" />

View File

@@ -100,7 +100,6 @@
<color name="importance_disabled_tint">#4d000000</color>
<!-- Accessibility SUW colors -->
<color name="material_blue_400">#5e97f6</color>
<color name="material_blue_500">#4285F4</color>
<color name="material_blue_700">#3367D6</color>
@@ -125,11 +124,7 @@
<color name="card_background_grey">#eeeeee</color>
<color name="primary_color">@color/material_blue_grey_900</color>
<color name="primary_dark_color">@color/material_blue_grey_950</color>
<color name="secondary_color">#ff37474f</color>
<color name="accent_color">@color/accent_material_light</color>
<color name="accent_color_lighter">#ff7fcac3</color>
<!-- Gestures settings -->
<color name="gestures_setting_backgroud_color">#f5f5f5</color>

View File

@@ -129,9 +129,7 @@
layouts against a remote context using our local theme colors. Due to the implementation
details of Theme, we can't reference any local resources and MUST instead use the values
directly. So use #ff263238 instead of @color/theme_primary and so on. -->
<style name="Theme.SettingsBase" parent="@android:style/Theme.Material.Settings">
<item name="android:colorPrimary">@color/primary_color</item>
<item name="android:colorAccent">@color/accent_color</item>
<style name="Theme.SettingsBase" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="colorSecondary">@color/secondary_color</item>
</style>
@@ -195,8 +193,7 @@
<item name="android:contentInsetStart">@dimen/actionbar_subsettings_contentInsetStart</item>
</style>
<style name="ThemeOverlay.SwitchBar.Settings" parent="@android:style/ThemeOverlay.Material.Dark.ActionBar">
<item name="android:colorAccent">@color/accent_color_lighter</item>
<style name="ThemeOverlay.SwitchBar.Settings" parent="@*android:style/ThemeOverlay.DeviceDefault.Dark.ActionBar.Accent">
<item name="switchBarMarginStart">@dimen/switchbar_subsettings_margin_start</item>
<item name="switchBarMarginEnd">@dimen/switchbar_subsettings_margin_end</item>
<item name="switchBarBackgroundColor">?attr/colorSecondary</item>
@@ -208,9 +205,7 @@
<item name="switchBarBackgroundColor">?attr/colorSecondary</item>
</style>
<style name="Theme.DialogWhenLarge" parent="@*android:style/Theme.Material.Settings.DialogWhenLarge">
<item name="android:colorPrimary">@color/primary_color</item>
<item name="android:colorAccent">@color/accent_color</item>
<style name="Theme.DialogWhenLarge" parent="@*android:style/Theme.DeviceDefault.Settings.DialogWhenLarge">
<item name="colorSecondary">@color/secondary_color</item>
<!-- Redefine the ActionBar style for contentInsetStart -->
<item name="android:actionBarStyle">@style/Theme.ActionBar</item>
@@ -242,8 +237,7 @@
<item name="android:windowSoftInputMode">adjustResize</item>
</style>
<style name="Theme.AlertDialog" parent="@*android:style/Theme.Material.Settings.Dialog.Alert">
<item name="android:colorAccent">@color/accent_color</item>
<style name="Theme.AlertDialog" parent="@*android:style/Theme.DeviceDefault.Settings.Dialog.Alert">
<item name="android:windowSoftInputMode">adjustResize</item>
<!-- Redefine the ActionBar style for contentInsetStart -->
@@ -263,9 +257,7 @@
<item name="confirmDeviceCredentialsTopMargin">16dp</item>
</style>
<style name="Theme.ConfirmDeviceCredentialsDark" parent="@android:style/Theme.Material">
<item name="android:colorPrimary">@color/primary_color</item>
<item name="android:colorAccent">@color/accent_color_lighter</item>
<style name="Theme.ConfirmDeviceCredentialsDark" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">?android:attr/colorPrimary</item>

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();