diff --git a/app/src/main/java/ee/ria/DigiDoc/android/Constants.java b/app/src/main/java/ee/ria/DigiDoc/android/Constants.java index 5d06aeebc..e1d450d77 100644 --- a/app/src/main/java/ee/ria/DigiDoc/android/Constants.java +++ b/app/src/main/java/ee/ria/DigiDoc/android/Constants.java @@ -4,6 +4,11 @@ public final class Constants { public static final Object VOID = new Object(); + /* + * Relying Party + */ + public static final String SETTINGS_DEFAULT_RELYING_PARTY_UUID = "00000000-0000-0000-0000-000000000000"; + /* * Request codes for startActivityForResult */ diff --git a/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/TsaUrlPreferenceDialogFragment.java b/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/TsaUrlPreferenceDialogFragment.java index c73c76263..d3c8906d3 100644 --- a/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/TsaUrlPreferenceDialogFragment.java +++ b/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/TsaUrlPreferenceDialogFragment.java @@ -112,6 +112,13 @@ public void beforeTextChanged(CharSequence s, int start, int count, int after) { public void onTextChanged(CharSequence s, int start, int before, int count) { summary.setSingleLine(summary.getText() != null && summary.getText().length() != 0); handleTsaUrlContentDescription(view, checkBox); + if (summary.getText().toString().isEmpty()) { + summary.setHint(configurationProvider.getTsaUrl()); + summary.setContentDescription(getResources().getText(R.string.main_settings_tsa_url_title)); + } else { + summary.setHint(""); + summary.setContentDescription(""); + } } @Override diff --git a/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreference.java b/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreference.java index d83e28ff1..e387274bb 100644 --- a/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreference.java +++ b/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreference.java @@ -21,6 +21,7 @@ package ee.ria.DigiDoc.android.main.settings.signing; import static android.view.accessibility.AccessibilityEvent.TYPE_ANNOUNCEMENT; +import static ee.ria.DigiDoc.android.Constants.SETTINGS_DEFAULT_RELYING_PARTY_UUID; import android.content.Context; import android.text.TextUtils; @@ -92,7 +93,7 @@ public CheckBox getCheckBox() { public CharSequence getSummary() { String text = getText(); if (TextUtils.isEmpty(text)) { - return "00000000-0000-0000-0000-000000000000"; + return SETTINGS_DEFAULT_RELYING_PARTY_UUID; } char[] password = new char[text.length()]; Arrays.fill(password, 'ยท'); diff --git a/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreferenceDialogFragment.java b/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreferenceDialogFragment.java index 887935a1e..6c6ce6cad 100644 --- a/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreferenceDialogFragment.java +++ b/app/src/main/java/ee/ria/DigiDoc/android/main/settings/signing/UUIDPreferenceDialogFragment.java @@ -21,6 +21,7 @@ package ee.ria.DigiDoc.android.main.settings.signing; import static android.view.accessibility.AccessibilityEvent.TYPE_ANNOUNCEMENT; +import static ee.ria.DigiDoc.android.Constants.SETTINGS_DEFAULT_RELYING_PARTY_UUID; import android.app.Dialog; import android.graphics.Color; @@ -82,7 +83,7 @@ protected void onBindDialogView(@NonNull View view) { if (appCompatEditText != null) { setAccessibilityForEditText(uuidPreference, appCompatEditText, appCompatTextView); if (AccessibilityUtils.isTalkBackEnabled()) { - AccessibilityUtils.setTextViewContentDescription(getContext(), true, "00000000-0000-0000-0000-000000000000", appCompatTextView.getText().toString(), appCompatEditText); + AccessibilityUtils.setTextViewContentDescription(getContext(), true, SETTINGS_DEFAULT_RELYING_PARTY_UUID, appCompatTextView.getText().toString(), appCompatEditText); } } @@ -123,6 +124,13 @@ public void beforeTextChanged(CharSequence s, int start, int count, int after) { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { handleUuidUrlContentDescription(view, checkBox); + if (summary.getText().toString().isEmpty()) { + summary.setHint(SETTINGS_DEFAULT_RELYING_PARTY_UUID); + summary.setContentDescription(getResources().getText(R.string.main_settings_uuid_title)); + } else { + summary.setHint(""); + summary.setContentDescription(""); + } } @Override @@ -150,7 +158,7 @@ private void setAccessibilityForEditText( private void disableTextViewOnChecked(AppCompatEditText appCompatEditText) { appCompatEditText.setText(null); appCompatEditText.setSingleLine(false); - appCompatEditText.setHint("00000000-0000-0000-0000-000000000000"); + appCompatEditText.setHint(SETTINGS_DEFAULT_RELYING_PARTY_UUID); appCompatEditText.clearFocus(); } diff --git a/app/src/main/res/layout/signature_update_mobile_id.xml b/app/src/main/res/layout/signature_update_mobile_id.xml index dbff40ae9..93b9b0ee5 100644 --- a/app/src/main/res/layout/signature_update_mobile_id.xml +++ b/app/src/main/res/layout/signature_update_mobile_id.xml @@ -42,7 +42,7 @@ android:id="@id/signatureUpdateMobileIdPhoneNo" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="phone" + android:inputType="phone|textNoSuggestions" android:digits="0123456789" android:imeOptions="actionDone" android:lines="1" @@ -50,6 +50,8 @@ android:hint="@string/mobile_id_country_code_and_phone_number_placeholder" android:accessibilityTraversalAfter="@id/signatureUpdateMobileIdPhoneNoText" android:minHeight="@dimen/material_baseline_grid_6x" + android:importantForAutofill="no" + android:autofillHints="" android:background="@drawable/bottom_border_background"/>