Commit 0b146579 authored by zhaopengxiang's avatar zhaopengxiang

简化code

parent 9309eada
...@@ -86,13 +86,13 @@ class ResetAuthorizePasswordActivity : BaseActivity() { ...@@ -86,13 +86,13 @@ class ResetAuthorizePasswordActivity : BaseActivity() {
val accountAuthorizePassword = AccountPasswordManageKit.getInstance().accountPassword val accountAuthorizePassword = AccountPasswordManageKit.getInstance().accountPassword
if (TextUtils.isEmpty(accountAuthorizePassword)) { if (TextUtils.isEmpty(accountAuthorizePassword)) {
AccountPasswordManageKit.getInstance() AccountPasswordManageKit.getInstance()
.loadAccountPassword(this, AccountPasswordManageKit.AccountPasswordManageCallback { .loadAccountPassword(this) {
if (!it.equals(originPassword)) { if (!it.equals(originPassword)) {
CenterToasty.error(this, "原始密码输入错误!").show() CenterToasty.error(this, "原始密码输入错误!").show()
}else{ } else {
updateAuthorizePasswordSucced(newPassword) updateAuthorizePasswordSucced(newPassword)
} }
}) }
} else { } else {
if (!accountAuthorizePassword.equals(originPassword)) { if (!accountAuthorizePassword.equals(originPassword)) {
CenterToasty.error(this, "原始密码输入错误!").show() CenterToasty.error(this, "原始密码输入错误!").show()
......
...@@ -85,10 +85,10 @@ class AuthorizePasswordInputDialog() : DialogFragment(), View.OnClickListener { ...@@ -85,10 +85,10 @@ class AuthorizePasswordInputDialog() : DialogFragment(), View.OnClickListener {
val accountPassword = AccountPasswordManageKit.getInstance().accountPassword val accountPassword = AccountPasswordManageKit.getInstance().accountPassword
if (TextUtils.isEmpty(accountPassword)) { if (TextUtils.isEmpty(accountPassword)) {
AccountPasswordManageKit.getInstance() AccountPasswordManageKit.getInstance()
.loadAccountPassword(context as AppCompatActivity?, .loadAccountPassword(context as AppCompatActivity?
AccountPasswordManageKit.AccountPasswordManageCallback { ) {
checkPasswordAndDoNext(it, inputPassword) checkPasswordAndDoNext(it, inputPassword)
}) }
} else { } else {
checkPasswordAndDoNext(accountPassword, inputPassword) checkPasswordAndDoNext(accountPassword, inputPassword)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment