From 2a869d7fe80831d0240f2df7c969b9a07219ca28 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 21 Feb 2019 10:09:10 -0600 Subject: [PATCH] In the dialog that appears to choose a security lock, changed its title and modified the list to use a single choice list with radio buttons and pre-selecting the actual security lock option. --- .../fragments/PatternSecurityLockDialog.kt | 2 +- .../fragments/SettingsFragment.kt | 12 ++++++++++-- .../main/res/layout/dialog_pattern_security_lock.xml | 4 ++-- app/src/main/res/values-es/strings.xml | 9 +++++---- app/src/main/res/values/strings.xml | 9 +++++---- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt index d9b61ca..871a397 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt @@ -179,7 +179,7 @@ class PatternSecurityLockDialog : BaseSecurityLockDialog() { patternLockView.isInputEnabled = true btnClear.visibility = View.INVISIBLE btnNext.isEnabled = false - btnNext.text = getString(R.string.btn__confirm) + btnNext.text = getString(R.string.button__confirm) } } } diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SettingsFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SettingsFragment.kt index 825a3c7..571f452 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SettingsFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SettingsFragment.kt @@ -14,7 +14,7 @@ import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.callbacks.onDismiss import com.afollestad.materialdialogs.customview.customView import com.afollestad.materialdialogs.list.customListAdapter -import com.afollestad.materialdialogs.list.listItems +import com.afollestad.materialdialogs.list.listItemsSingleChoice import cy.agorise.bitsybitshareswallet.BuildConfig import cy.agorise.bitsybitshareswallet.R import cy.agorise.bitsybitshareswallet.adapters.FullNodesAdapter @@ -282,10 +282,18 @@ class SettingsFragment : Fragment(), ServiceConnection, BaseSecurityLockDialog.O * Shows a dialog so the user can select its desired Security Lock option. */ private fun showChooseSecurityLockDialog() { + // Obtain the current Security Lock Option selected and display it in the screen + val securityLockSelected = PreferenceManager.getDefaultSharedPreferences(context) + .getInt(Constants.KEY_SECURITY_LOCK_SELECTED, 0) + // Security Lock Options + // 0 -> None + // 1 -> PIN + // 2 -> Pattern + context?.let { MaterialDialog(it).show { title(R.string.title__security_dialog) - listItems(R.array.security_lock_options) {_, index, _ -> + listItemsSingleChoice(R.array.security_lock_options, initialSelection = securityLockSelected) {_, index, _ -> // Args used for both PIN and Pattern options val args = Bundle() args.putInt(BaseSecurityLockDialog.KEY_STEP_SECURITY_LOCK, diff --git a/app/src/main/res/layout/dialog_pattern_security_lock.xml b/app/src/main/res/layout/dialog_pattern_security_lock.xml index 3ce9231..78cbc7b 100644 --- a/app/src/main/res/layout/dialog_pattern_security_lock.xml +++ b/app/src/main/res/layout/dialog_pattern_security_lock.xml @@ -72,7 +72,7 @@ style="@style/Widget.Bitsy.Button.TextButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/btn__clear" + android:text="@string/button__clear" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> @@ -81,7 +81,7 @@ style="@style/Widget.Bitsy.Button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/btn__next" + android:text="@string/button__next" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index c07ec40..eef0c0f 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -140,10 +140,11 @@ Seguridad Bloqueo de Seguridad - Choose Security Lock + Elige un Bloqueo de Seguridad PIN Patrón Ninguno + Elegir Reingresa tu PIN Digita tu PIN de BiTSy para continuar PIN incorrecto @@ -155,11 +156,11 @@ Ingresa tu patrón de BiTSy para continuar Por seguridad, crea un patrón para BiTSy Suelta tu dedo al terminar - Limpiar - Siguiente + Limpiar + Siguiente Dibuja un patrón de desbloqueo Dibuja tu patrón de nuevo para confirmar - Confirmar + Confirmar Tu nuevo patrón de desbloqueo Patrón incorrecto Patrón registrado diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 990affa..61ee122 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -141,10 +141,11 @@ Security Security Lock - Choose Security Lock + Choose a Security Lock PIN Pattern None + Choose Re-enter your PIN Enter your BiTSy PIN to continue Wrong PIN @@ -156,11 +157,11 @@ Enter your BiTSy pattern to continue For security, set BiTSy pattern Release finger when done - Clear - Next + Clear + Next Draw an unlock pattern Draw pattern again to confirm - Confirm + Confirm Your new unlock pattern Wrong pattern Pattern recorded