mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Cleanup
This commit is contained in:
parent
dc7b3dfc9d
commit
d679c9d5d8
@ -70,7 +70,7 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
|
||||
mPassphraseInputLayout.error = newValue
|
||||
})
|
||||
|
||||
helperTextWithLink.text = spannableStringForHelperText(context!!)
|
||||
helperTextWithLink.text = spannableStringForHelperText()
|
||||
|
||||
viewModel.showPasswordMode.observe(viewLifecycleOwner, Observer {
|
||||
val shouldBeVisible = it ?: false
|
||||
@ -87,9 +87,9 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
|
||||
}
|
||||
}
|
||||
|
||||
private fun spannableStringForHelperText(context: Context): SpannableString {
|
||||
val clickableText = context.getString(R.string.keys_backup_restore_use_recovery_key)
|
||||
val helperText = context.getString(R.string.keys_backup_restore_with_passphrase_helper_with_link, clickableText)
|
||||
private fun spannableStringForHelperText(): SpannableString {
|
||||
val clickableText = getString(R.string.keys_backup_restore_use_recovery_key)
|
||||
val helperText = getString(R.string.keys_backup_restore_with_passphrase_helper_with_link, clickableText)
|
||||
|
||||
val spanString = SpannableString(helperText)
|
||||
|
||||
@ -117,7 +117,7 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
|
||||
fun onRestoreBackup() {
|
||||
val value = viewModel.passphrase.value
|
||||
if (value.isNullOrBlank()) {
|
||||
viewModel.passphraseErrorText.value = context?.getString(R.string.passphrase_empty_error_message)
|
||||
viewModel.passphraseErrorText.value = getString(R.string.passphrase_empty_error_message)
|
||||
} else {
|
||||
viewModel.recoverKeys(sharedViewModel)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user