aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2016-02-10 18:14:36 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2016-02-10 18:48:27 +0100
commit0feb4d074ce284bfed17e82a3cbc218209aff14a (patch)
treea530ff920e9fa160fb4ec820aa3a8e95cce6886c
parenta2ea509f06242fa713e26081fded56590788f1a7 (diff)
downloadopen-keychain-0feb4d074ce284bfed17e82a3cbc218209aff14a.tar.gz
open-keychain-0feb4d074ce284bfed17e82a3cbc218209aff14a.tar.bz2
open-keychain-0feb4d074ce284bfed17e82a3cbc218209aff14a.zip
Use non-breaking spaces for backup code MaskedEditText
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java9
-rw-r--r--OpenKeychain/src/main/res/layout/backup_code_fragment.xml2
-rw-r--r--OpenKeychain/src/main/res/layout/passphrase_dialog_backup_code.xml2
3 files changed, 11 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java
index 2cacaea90..a9dfaa2c5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java
@@ -170,7 +170,11 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar
mTitleAnimator.setDisplayedChild(1, animate);
mStatusAnimator.setDisplayedChild(1, animate);
mCodeFieldsAnimator.setDisplayedChild(1, animate);
- mCodeEditText.setText(" - - - - - ");
+ // use non-breaking spaces to enlarge the empty EditText appropriately
+ String empty = "\u00a0\u00a0\u00a0\u00a0-\u00a0\u00a0\u00a0\u00a0" +
+ "-\u00a0\u00a0\u00a0\u00a0-\u00a0\u00a0\u00a0\u00a0" +
+ "-\u00a0\u00a0\u00a0\u00a0-\u00a0\u00a0\u00a0\u00a0";
+ mCodeEditText.setText(empty);
pushBackStackEntry();
@@ -349,7 +353,8 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar
public void afterTextChanged(Editable s) {
boolean inInputState = mCurrentState == BackupCodeState.STATE_INPUT
|| mCurrentState == BackupCodeState.STATE_INPUT_ERROR;
- boolean partIsComplete = (backupCode.getText().toString().indexOf(' ') == -1);
+ boolean partIsComplete = (backupCode.getText().toString().indexOf(' ') == -1)
+ && (backupCode.getText().toString().indexOf('\u00a0') == -1);
if (!inInputState || !partIsComplete) {
return;
}
diff --git a/OpenKeychain/src/main/res/layout/backup_code_fragment.xml b/OpenKeychain/src/main/res/layout/backup_code_fragment.xml
index 619a1b3b1..330f18d1c 100644
--- a/OpenKeychain/src/main/res/layout/backup_code_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/backup_code_fragment.xml
@@ -84,9 +84,11 @@
android:textSize="18dp"
android:textStyle="bold"
android:typeface="monospace"
+ app:deleteChar="\u00a0"
app:mask="****-****-****-****-****-****"
app:maskIconColor="@color/colorPrimary"
app:notMaskedSymbol="*"
+ app:replacementChar="\u00a0"
tools:ignore="SpUsage" />
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
diff --git a/OpenKeychain/src/main/res/layout/passphrase_dialog_backup_code.xml b/OpenKeychain/src/main/res/layout/passphrase_dialog_backup_code.xml
index a55033380..b17c9dba7 100644
--- a/OpenKeychain/src/main/res/layout/passphrase_dialog_backup_code.xml
+++ b/OpenKeychain/src/main/res/layout/passphrase_dialog_backup_code.xml
@@ -38,9 +38,11 @@
android:textSize="18dp"
android:textStyle="bold"
android:typeface="monospace"
+ app:deleteChar="\u00a0"
app:mask="****-****-****-****-****-****"
app:maskIconColor="@color/colorPrimary"
app:notMaskedSymbol="*"
+ app:replacementChar="\u00a0"
tools:ignore="SpUsage" />
</LinearLayout>