Add colorEdgeEffect to themes, default it to colorPrimary

Allow edgeeffect colors to be changed independently of the primary
color for the current theme.

Bug 16512225

Change-Id: Ibc13ad755f489fe1f6d16af0c61a1d12dd1a61f7
This commit is contained in:
Adam Powell
2014-09-19 12:50:31 -07:00
parent b6812b64c4
commit c6c744da75
7 changed files with 10 additions and 2 deletions

View File

@@ -409,6 +409,7 @@ package android {
field public static final int colorControlActivated = 16843818; // 0x101042a
field public static final int colorControlHighlight = 16843820; // 0x101042c
field public static final int colorControlNormal = 16843817; // 0x1010429
field public static final int colorEdgeEffect = 16843982; // 0x10104ce
field public static final int colorFocusedHighlight = 16843663; // 0x101038f
field public static final int colorForeground = 16842800; // 0x1010030
field public static final int colorForegroundInverse = 16843270; // 0x1010206

View File

@@ -120,7 +120,7 @@ public class EdgeEffect {
final TypedArray a = context.obtainStyledAttributes(
com.android.internal.R.styleable.EdgeEffect);
final int themeColor = a.getColor(
com.android.internal.R.styleable.EdgeEffect_colorPrimary, 0xff666666);
com.android.internal.R.styleable.EdgeEffect_colorEdgeEffect, 0xff666666);
a.recycle();
mPaint.setColor((themeColor & 0xffffff) | 0x33000000);
mPaint.setStyle(Paint.Style.FILL);

View File

@@ -1020,6 +1020,9 @@
<!-- The color applied to framework switch thumbs in their normal state. -->
<attr name="colorSwitchThumbNormal" format="color" />
<!-- The color applied to the edge effect on scrolling containers. -->
<attr name="colorEdgeEffect" format="color" />
<!-- =================== -->
<!-- Lighting properties -->
<!-- =================== -->
@@ -7435,7 +7438,7 @@
<!-- Used as a filter array on the theme to pull out only the EdgeEffect-relevant bits. -->
<declare-styleable name="EdgeEffect">
<attr name="colorPrimary" />
<attr name="colorEdgeEffect" />
</declare-styleable>
<!-- Use <code>tv-input</code> as the root tag of the XML resource that describes a

View File

@@ -2291,6 +2291,7 @@
<public type="attr" name="strokeAlpha" id="0x010104cb" />
<public type="attr" name="fillAlpha" id="0x010104cc" />
<public type="attr" name="windowActivityTransitions" id="0x010104cd" />
<public type="attr" name="colorEdgeEffect" id="0x010104ce" />
<public type="id" name="mask" id="0x0102002e" />
<public type="id" name="statusBarBackground" id="0x0102002f" />

View File

@@ -59,6 +59,7 @@ please see themes_device_defaults.xml.
<item name="colorControlNormal">@color/legacy_control_normal</item>
<item name="colorControlHighlight">@color/legacy_button_pressed</item>
<item name="colorButtonNormal">@color/legacy_button_normal</item>
<item name="colorEdgeEffect">?attr/colorPrimary</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>

View File

@@ -81,6 +81,7 @@ please see themes_device_defaults.xml.
<item name="colorControlNormal">@color/holo_control_normal</item>
<item name="colorControlHighlight">@color/holo_button_pressed</item>
<item name="colorButtonNormal">@color/holo_button_normal</item>
<item name="colorEdgeEffect">?attr/colorPrimary</item>
<!-- Text styles -->
<item name="textAppearance">@style/TextAppearance.Holo</item>

View File

@@ -375,6 +375,7 @@ please see themes_device_defaults.xml.
<item name="colorPrimaryDark">@color/material_blue_grey_900</item>
<item name="colorPrimary">@color/material_blue_grey_800</item>
<item name="colorAccent">@color/material_deep_teal_200</item>
<item name="colorEdgeEffect">?attr/colorPrimary</item>
<item name="colorControlNormal">?attr/textColorSecondary</item>
<item name="colorControlActivated">?attr/colorAccent</item>