diff options
Diffstat (limited to 'OpenKeychain/src/main/res')
-rw-r--r-- | OpenKeychain/src/main/res/layout/create_key_input_fragment.xml | 34 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/values/attr.xml | 14 |
2 files changed, 40 insertions, 8 deletions
diff --git a/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml b/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml index d817f9269..d7be00bcd 100644 --- a/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml +++ b/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:custom="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> @@ -58,17 +59,34 @@ android:layout_height="wrap_content" android:text="@string/label_passphrase" /> - <EditText - android:id="@+id/create_key_passphrase" + <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:layout_marginBottom="8dp" - android:imeOptions="actionNext" - android:inputType="textPassword" - android:hint="@string/label_passphrase" - android:ems="10" - android:layout_gravity="center_horizontal" /> + android:layout_marginBottom="8dp"> + + <EditText + android:id="@+id/create_key_passphrase" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionNext" + android:inputType="textPassword" + android:hint="@string/label_passphrase" + android:ems="10" + android:layout_gravity="center_horizontal" /> + + <org.sufficientlysecure.keychain.ui.widget.passwordstrengthindicator.PasswordStrengthBarView + android:id="@+id/create_key_passphrase_strength" + android:layout_width="48dp" + android:layout_height="8dp" + 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"/> + + </FrameLayout> <EditText android:id="@+id/create_key_passphrase_again" diff --git a/OpenKeychain/src/main/res/values/attr.xml b/OpenKeychain/src/main/res/values/attr.xml index 98ce1c364..7a2f3054e 100644 --- a/OpenKeychain/src/main/res/values/attr.xml +++ b/OpenKeychain/src/main/res/values/attr.xml @@ -15,4 +15,18 @@ </attr> </declare-styleable> + <!-- Taken from Matt Allen Password Strength View + https://github.com/matt-allen/android-password-strength-indicator --> + <declare-styleable name="PasswordStrengthView"> + <attr name="strength" format="enum"> + <enum name="weak" value="0" /> + <enum name="medium" value="1" /> + <enum name="strong" value="2" /> + </attr> + <attr name="showGuides" format="boolean" /> + <attr name="color_fail" format="color" /> + <attr name="color_weak" format="color" /> + <attr name="color_strong" format="color" /> + </declare-styleable> + </resources>
\ No newline at end of file |