Use non-breaking spaces for backup code MaskedEditText
This commit is contained in:
@@ -170,7 +170,11 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar
|
|||||||
mTitleAnimator.setDisplayedChild(1, animate);
|
mTitleAnimator.setDisplayedChild(1, animate);
|
||||||
mStatusAnimator.setDisplayedChild(1, animate);
|
mStatusAnimator.setDisplayedChild(1, animate);
|
||||||
mCodeFieldsAnimator.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();
|
pushBackStackEntry();
|
||||||
|
|
||||||
@@ -349,7 +353,8 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar
|
|||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
boolean inInputState = mCurrentState == BackupCodeState.STATE_INPUT
|
boolean inInputState = mCurrentState == BackupCodeState.STATE_INPUT
|
||||||
|| mCurrentState == BackupCodeState.STATE_INPUT_ERROR;
|
|| 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) {
|
if (!inInputState || !partIsComplete) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,9 +84,11 @@
|
|||||||
android:textSize="18dp"
|
android:textSize="18dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
|
app:deleteChar="\u00a0"
|
||||||
app:mask="****-****-****-****-****-****"
|
app:mask="****-****-****-****-****-****"
|
||||||
app:maskIconColor="@color/colorPrimary"
|
app:maskIconColor="@color/colorPrimary"
|
||||||
app:notMaskedSymbol="*"
|
app:notMaskedSymbol="*"
|
||||||
|
app:replacementChar="\u00a0"
|
||||||
tools:ignore="SpUsage" />
|
tools:ignore="SpUsage" />
|
||||||
|
|
||||||
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
|
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
|
||||||
|
|||||||
@@ -38,9 +38,11 @@
|
|||||||
android:textSize="18dp"
|
android:textSize="18dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
|
app:deleteChar="\u00a0"
|
||||||
app:mask="****-****-****-****-****-****"
|
app:mask="****-****-****-****-****-****"
|
||||||
app:maskIconColor="@color/colorPrimary"
|
app:maskIconColor="@color/colorPrimary"
|
||||||
app:notMaskedSymbol="*"
|
app:notMaskedSymbol="*"
|
||||||
|
app:replacementChar="\u00a0"
|
||||||
tools:ignore="SpUsage" />
|
tools:ignore="SpUsage" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user