package com.future.dispatch.ui.pub
|
|
import android.os.Handler
|
import android.os.Looper
|
import com.future.dispatch.R
|
import com.future.dispatch.base.BaseStartActivity
|
import com.future.dispatch.utils.Cache.CacheKey
|
import com.future.dispatch.utils.gone
|
import org.jetbrains.anko.startActivity
|
|
class StartActivity : BaseStartActivity() {
|
|
var isTo = false
|
override fun havePermissions() {
|
if (!isTo) {
|
Handler(Looper.getMainLooper()).postDelayed({
|
if (isTo) {
|
return@postDelayed
|
}
|
isTo = true
|
if (CacheKey.getUserId().isEmpty()) {
|
startActivity<LoginActivity>()
|
} else {
|
startActivity<MainActivity>()
|
}
|
finish()
|
}, 1000)
|
}
|
}
|
|
override fun setContentView() {
|
setContentView(R.layout.activity_start)
|
}
|
|
override fun initView() {
|
tv_Left.gone()
|
}
|
|
override fun onResume() {
|
super.onResume()
|
isTo = false
|
}
|
|
override fun setOnclick() {
|
|
}
|
}
|