ditch password strength indicator

This commit is contained in:
Vincent Breitmoser
2017-05-19 14:49:57 +02:00
parent 80b8374eaa
commit 37865f5c0c
7 changed files with 11 additions and 712 deletions

View File

@@ -1,106 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_above="@+id/create_key_buttons">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/create_key_passphrase_text" />
<org.sufficientlysecure.keychain.ui.widget.PassphraseEditText
android:id="@+id/create_key_passphrase"
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"
/>
<EditText
android:id="@+id/create_key_passphrase_again"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:inputType="textPassword"
android:hint="@string/label_passphrase_again"
android:ems="10"
android:layout_gravity="center_horizontal" />
<CheckBox
android:id="@+id/create_key_show_passphrase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/label_show_passphrase" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="?attr/colorButtonRow"
android:id="@+id/create_key_buttons">
<TextView
android:id="@+id/create_key_back_button"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@string/btn_back"
android:textAllCaps="true"
android:minHeight="?android:attr/listPreferredItemHeight"
android:drawableLeft="@drawable/ic_chevron_left_grey_24dp"
android:drawablePadding="8dp"
android:gravity="left|center_vertical"
android:clickable="true"
style="?android:attr/borderlessButtonStyle" />
<TextView
android:id="@+id/create_key_next_button"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@string/btn_next"
android:textAllCaps="true"
android:minHeight="?android:attr/listPreferredItemHeight"
android:drawableRight="@drawable/ic_chevron_right_grey_24dp"
android:drawablePadding="8dp"
android:gravity="right|center_vertical"
android:clickable="true"
style="?android:attr/borderlessButtonStyle" />
</LinearLayout>
</RelativeLayout>

View File

@@ -15,36 +15,17 @@
android:layout_height="wrap_content"
android:text="@string/label_no_passphrase" />
<FrameLayout
<EditText
android:id="@+id/passphrase_passphrase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp">
<org.sufficientlysecure.keychain.ui.widget.PassphraseEditText
android:id="@+id/passphrase_passphrase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:imeOptions="actionNext"
android:hint="@string/label_passphrase"
android:inputType="textPassword"
android:ems="10"
android:layout_gravity="center_horizontal" />
<org.sufficientlysecure.keychain.ui.widget.PasswordStrengthBarView
android:id="@+id/passphrase_repeat_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/password_strength_low"
custom:color_weak="@color/password_strength_medium"
custom:color_strong="@color/password_strength_high" />
</FrameLayout>
android:layout_marginBottom="8dp"
android:imeOptions="actionNext"
android:hint="@string/label_passphrase"
android:inputType="textPassword"
android:ems="10"
android:layout_gravity="center_horizontal" />
<EditText
android:id="@+id/passphrase_passphrase_again"

View File

@@ -11,20 +11,6 @@
<attr name="initializeFolded" format="boolean" />
</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>
<declare-styleable name="PrefixedEditText">
<attr name="prefix" format="string" />
</declare-styleable>