Commit af8d66fe authored by mengcuiguang's avatar mengcuiguang

代码优化

parent ae26efe5
......@@ -79,8 +79,13 @@ class LoginActivity : BaseActivity()
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
return if (keyCode == KeyEvent.KEYCODE_BACK) {
if (!loginFlag) {
finish()
return true
}
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !loginFlag) {
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE)) {
finish()
}
true
......@@ -92,8 +97,13 @@ class LoginActivity : BaseActivity()
when (v?.id) {
R.id.ivLoginBack -> {
if (!loginFlag) {
finish()
return
}
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !loginFlag) {
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE)) {
finish()
}
}
......@@ -193,7 +203,7 @@ class LoginActivity : BaseActivity()
}
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !loginFlag) {
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE)) {
readyGo(MainActivity::class.java)
}
......
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