Give password strength indicator colors their own name
Also prune the android color definitions, most of which aren't used.
This commit is contained in:
@@ -99,9 +99,9 @@ public class PasswordStrengthView extends View {
|
|||||||
public PasswordStrengthView(Context context, AttributeSet attrs) {
|
public PasswordStrengthView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
|
|
||||||
int COLOR_FAIL = getResources().getColor(R.color.android_red_light);
|
int COLOR_FAIL = getResources().getColor(R.color.password_strength_low);
|
||||||
int COLOR_WEAK = getResources().getColor(R.color.android_orange_light);
|
int COLOR_WEAK = getResources().getColor(R.color.password_strength_medium);
|
||||||
int COLOR_STRONG = getResources().getColor(R.color.android_green_light);
|
int COLOR_STRONG = getResources().getColor(R.color.password_strength_high);
|
||||||
|
|
||||||
TypedArray style = context.getTheme().obtainStyledAttributes(
|
TypedArray style = context.getTheme().obtainStyledAttributes(
|
||||||
attrs,
|
attrs,
|
||||||
|
|||||||
@@ -40,9 +40,9 @@
|
|||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="end|center_vertical"
|
||||||
custom:strength="medium"
|
custom:strength="medium"
|
||||||
custom:showGuides="false"
|
custom:showGuides="false"
|
||||||
custom:color_fail="@color/android_red_light"
|
custom:color_fail="@color/password_strength_low"
|
||||||
custom:color_weak="@color/android_orange_light"
|
custom:color_weak="@color/password_strength_medium"
|
||||||
custom:color_strong="@color/android_green_light" />
|
custom:color_strong="@color/password_strength_high" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
@@ -57,4 +57,4 @@
|
|||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -14,12 +14,16 @@
|
|||||||
<color name="tab_text_selected">#FFFFFF</color>
|
<color name="tab_text_selected">#FFFFFF</color>
|
||||||
<color name="tab_indicator">#FFFFFF</color>
|
<color name="tab_indicator">#FFFFFF</color>
|
||||||
|
|
||||||
|
<color name="password_strength_low">#f44336</color>
|
||||||
|
<color name="password_strength_medium">#ff9800</color>
|
||||||
|
<color name="password_strength_high">#7bad45</color>
|
||||||
|
|
||||||
<!-- floating action buttons -->
|
<!-- floating action buttons -->
|
||||||
<color name="black">#000000</color>
|
<color name="black">#000000</color>
|
||||||
<color name="white">#fafafa</color>
|
<color name="white">#fafafa</color>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
Standard Android colors:
|
||||||
http://www.google.com/design/spec/style/color.html#color-color-palette
|
http://www.google.com/design/spec/style/color.html#color-color-palette
|
||||||
light = normal color
|
light = normal color
|
||||||
dark = 900
|
dark = 900
|
||||||
@@ -29,10 +33,7 @@
|
|||||||
<color name="android_red_light">#f44336</color>
|
<color name="android_red_light">#f44336</color>
|
||||||
<color name="android_red_dark">#b71c1c</color>
|
<color name="android_red_dark">#b71c1c</color>
|
||||||
<color name="android_orange_light">#ff9800</color>
|
<color name="android_orange_light">#ff9800</color>
|
||||||
<color name="android_orange_dark">#e65100</color>
|
|
||||||
<color name="android_green_light">#7bad45</color>
|
<color name="android_green_light">#7bad45</color>
|
||||||
<color name="android_green_dark">#6c983d</color>
|
<color name="android_green_dark">#6c983d</color>
|
||||||
<color name="android_purple_light">#673ab7</color>
|
|
||||||
<color name="android_purple_dark">#311b92</color>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user