|
@@ -1,15 +1,19 @@
|
|
|
package jx.cn.escort.ui.activity
|
|
|
|
|
|
|
|
|
+import android.annotation.SuppressLint
|
|
|
import android.content.Context
|
|
|
import android.content.SharedPreferences
|
|
|
import android.os.Bundle
|
|
|
import android.view.View
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
+import androidx.lifecycle.lifecycleScope
|
|
|
import jx.cn.escort.databinding.ActivityLoginBinding
|
|
|
import jx.cn.escort.extension.ExtensionBinding.Companion.binding
|
|
|
import jx.cn.escort.utils.ActivityUtils
|
|
|
import jx.cn.escort.utils.ActivityUtils.Companion.startActivity
|
|
|
+import kotlinx.coroutines.delay
|
|
|
+import kotlinx.coroutines.launch
|
|
|
|
|
|
|
|
|
import org.koin.core.component.KoinComponent
|
|
@@ -28,13 +32,20 @@ class LoginActivity : AppCompatActivity(), KoinComponent {
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
setContentView(mBinding.root)
|
|
|
- mBinding.btnLogin.setOnClickListener {
|
|
|
- defaultSharedPreferences.edit().putString("isAuth", "是").apply()
|
|
|
- ActivityUtils.startActivity(this,MainActivity::class.java)
|
|
|
- finish()
|
|
|
+ mBinding.btnLogin
|
|
|
+ mBinding.btnLoginAction.setOnClickListener {
|
|
|
+ lifecycleScope.launch {
|
|
|
+ mBinding.loginTitle.text = "正在登陆中......"
|
|
|
+ delay(5000L)
|
|
|
+ defaultSharedPreferences.edit().putString("isAuth", "是").apply()
|
|
|
+ ActivityUtils.startActivity(this@LoginActivity,MainActivity::class.java)
|
|
|
+ finish()
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|