mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-15 05:15:03 -05:00
Integrates passphrase strength indicator to create key wizard.
This commit patches issue #1050. The padding set in the passphrase edit text is set programmatically because there is a bug in appcompat-v7 where padding via xml doesn't work: http://code.google.com/p/android/issues/detail?id=77982
This commit is contained in:
parent
7f9c663033
commit
438314c4bb
@ -134,6 +134,12 @@ public class CreateKeyInputFragment extends Fragment {
|
||||
)
|
||||
);
|
||||
|
||||
// Edit text padding doesn't work via xml (http://code.google.com/p/android/issues/detail?id=77982)
|
||||
// so we set the right padding programmatically.
|
||||
mPassphraseEdit.setPadding(mPassphraseEdit.getPaddingLeft(),
|
||||
mPassphraseEdit.getPaddingTop(),
|
||||
(int) (56 * getResources().getDisplayMetrics().density),
|
||||
mPassphraseEdit.getPaddingBottom());
|
||||
mPassphraseEdit.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
@ -59,11 +59,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_passphrase" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/create_key_passphrase"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textPassword"
|
||||
android:hint="@string/label_passphrase"
|
||||
@ -72,15 +77,17 @@
|
||||
|
||||
<org.sufficientlysecure.keychain.ui.widget.passwordstrengthindicator.PasswordStrengthBarView
|
||||
android:id="@+id/create_key_passphrase_strength"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginBottom="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"
|
||||
android:layout_width="match_parent"
|
||||
|
Loading…
Reference in New Issue
Block a user