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:
Thialfihar 2015-06-26 12:12:19 +02:00
parent dfe5a64fb0
commit 0af7d3c50b
3 changed files with 11 additions and 10 deletions

View file

@ -99,9 +99,9 @@ public class PasswordStrengthView extends View {
public PasswordStrengthView(Context context, AttributeSet attrs) {
super(context, attrs);
int COLOR_FAIL = getResources().getColor(R.color.android_red_light);
int COLOR_WEAK = getResources().getColor(R.color.android_orange_light);
int COLOR_STRONG = getResources().getColor(R.color.android_green_light);
int COLOR_FAIL = getResources().getColor(R.color.password_strength_low);
int COLOR_WEAK = getResources().getColor(R.color.password_strength_medium);
int COLOR_STRONG = getResources().getColor(R.color.password_strength_high);
TypedArray style = context.getTheme().obtainStyledAttributes(
attrs,

View file

@ -40,9 +40,9 @@
android:layout_gravity="end|center_vertical"
custom:strength="medium"
custom:showGuides="false"
custom:color_fail="@color/android_red_light"
custom:color_weak="@color/android_orange_light"
custom:color_strong="@color/android_green_light" />
custom:color_fail="@color/password_strength_low"
custom:color_weak="@color/password_strength_medium"
custom:color_strong="@color/password_strength_high" />
</FrameLayout>
@ -57,4 +57,4 @@
android:ems="10"
android:layout_gravity="center_horizontal" />
</LinearLayout>
</LinearLayout>

View file

@ -14,12 +14,16 @@
<color name="tab_text_selected">#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 -->
<color name="black">#000000</color>
<color name="white">#fafafa</color>
<!--
Standard Android colors:
http://www.google.com/design/spec/style/color.html#color-color-palette
light = normal color
dark = 900
@ -29,10 +33,7 @@
<color name="android_red_light">#f44336</color>
<color name="android_red_dark">#b71c1c</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_dark">#6c983d</color>
<color name="android_purple_light">#673ab7</color>
<color name="android_purple_dark">#311b92</color>
</resources>