mirror of
https://github.com/lizongying/my-tv.git
synced 2026-10-27 06:36:29 +08:00
fix time error
This commit is contained in:
@@ -18,16 +18,22 @@ import android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
import android.view.WindowManager
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.lizongying.mytv.models.TVViewModel
|
||||
import kotlinx.coroutines.CoroutineStart
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.launch
|
||||
import java.security.MessageDigest
|
||||
|
||||
|
||||
class MainActivity : FragmentActivity() {
|
||||
|
||||
var playerFragment = PlayerFragment()
|
||||
private val mainFragment = MainFragment()
|
||||
private val infoFragment = InfoFragment()
|
||||
private val channelFragment = ChannelFragment()
|
||||
private var ready = 0
|
||||
private var playerFragment = PlayerFragment()
|
||||
private var mainFragment = MainFragment()
|
||||
private var infoFragment = InfoFragment()
|
||||
private var channelFragment = ChannelFragment()
|
||||
private lateinit var settingFragment: SettingFragment
|
||||
|
||||
private var doubleBackToExitPressedOnce = false
|
||||
@@ -44,6 +50,16 @@ class MainActivity : FragmentActivity() {
|
||||
|
||||
private var versionName = ""
|
||||
|
||||
init {
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
val utilsJob = async(start = CoroutineStart.LAZY) { Utils.init() }
|
||||
|
||||
utilsJob.start()
|
||||
|
||||
utilsJob.await()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
Log.i(TAG, "onCreate")
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -156,7 +172,11 @@ class MainActivity : FragmentActivity() {
|
||||
}
|
||||
|
||||
fun fragmentReady() {
|
||||
mainFragment.fragmentReady()
|
||||
ready++
|
||||
Log.i(TAG, "ready $ready")
|
||||
if (ready == 4) {
|
||||
mainFragment.fragmentReady()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||
@@ -496,7 +516,7 @@ class MainActivity : FragmentActivity() {
|
||||
override fun onResume() {
|
||||
Log.i(TAG, "onResume")
|
||||
super.onResume()
|
||||
if (!mainFragment.isHidden){
|
||||
if (!mainFragment.isHidden) {
|
||||
handler.postDelayed(hideMain, delayHideMain)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user