|
@@ -1,15 +1,19 @@
|
|
package jx.cn.escort.ui.activity
|
|
package jx.cn.escort.ui.activity
|
|
|
|
|
|
|
|
|
|
|
|
+import android.annotation.SuppressLint
|
|
import android.content.Context
|
|
import android.content.Context
|
|
import android.content.SharedPreferences
|
|
import android.content.SharedPreferences
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
import android.view.View
|
|
import android.view.View
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
+import androidx.lifecycle.lifecycleScope
|
|
import jx.cn.escort.databinding.ActivityLoginBinding
|
|
import jx.cn.escort.databinding.ActivityLoginBinding
|
|
import jx.cn.escort.extension.ExtensionBinding.Companion.binding
|
|
import jx.cn.escort.extension.ExtensionBinding.Companion.binding
|
|
import jx.cn.escort.utils.ActivityUtils
|
|
import jx.cn.escort.utils.ActivityUtils
|
|
import jx.cn.escort.utils.ActivityUtils.Companion.startActivity
|
|
import jx.cn.escort.utils.ActivityUtils.Companion.startActivity
|
|
|
|
+import kotlinx.coroutines.delay
|
|
|
|
+import kotlinx.coroutines.launch
|
|
|
|
|
|
|
|
|
|
import org.koin.core.component.KoinComponent
|
|
import org.koin.core.component.KoinComponent
|
|
@@ -28,13 +32,20 @@ class LoginActivity : AppCompatActivity(), KoinComponent {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
super.onCreate(savedInstanceState)
|
|
super.onCreate(savedInstanceState)
|
|
setContentView(mBinding.root)
|
|
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()
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|