Tost shown when password is set now show when password is not set at end (cancel) or unset
This commit is contained in:
parent
39c08a5a2b
commit
c58c62d4bc
|
@ -95,16 +95,19 @@ class PasswordCheck @Inject constructor(val sp: SP) {
|
|||
val enteredPassword = userInput.text.toString()
|
||||
if (enteredPassword.isNotEmpty()) {
|
||||
sp.putString(preference, CryptoUtil.hashPassword(enteredPassword))
|
||||
ToastUtils.showToastInUiThread(context, context.getString(R.string.password_set))
|
||||
ok?.invoke(enteredPassword)
|
||||
} else {
|
||||
if (sp.contains(preference)) {
|
||||
sp.remove(preference)
|
||||
ToastUtils.showToastInUiThread(context, context.getString(R.string.password_cleared))
|
||||
clear?.invoke()
|
||||
} else {
|
||||
ToastUtils.showToastInUiThread(context, context.getString(R.string.password_not_changed))
|
||||
cancel?.invoke()
|
||||
}
|
||||
}
|
||||
ToastUtils.showToastInUiThread(context, context.getString(R.string.password_set))
|
||||
|
||||
}
|
||||
.setNegativeButton(context.getString(R.string.cancel)
|
||||
) { dialog, _ ->
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<string name="password_set">Password set!</string>
|
||||
<string name="password_not_set">Password not set</string>
|
||||
<string name="password_not_changed">Password not changed</string>
|
||||
<string name="password_cleared">Password cleared!</string>
|
||||
<string name="password_hint">Enter password here</string>
|
||||
|
||||
<string name="key_master_password">master_password</string>
|
||||
|
|
Loading…
Reference in a new issue