將跳轉加上coroutine

This commit is contained in:
Raymond Yang 2023-02-02 12:20:35 +08:00
parent 9fc8673715
commit b4346f142b

View File

@ -141,6 +141,7 @@ class SplitViewFragment : Fragment() {
return@setOnClickListener return@setOnClickListener
} }
stopAll() stopAll()
MainScope().launch {
val item = data[position] val item = data[position]
val bundle = Bundle().apply { val bundle = Bundle().apply {
//putInt(MonitoringActivity.BUNDLE_DEVICE_ID, item.id) //putInt(MonitoringActivity.BUNDLE_DEVICE_ID, item.id)
@ -158,6 +159,7 @@ class SplitViewFragment : Fragment() {
} }
} }
} }
}
private fun setAllUrl() { private fun setAllUrl() {
for (index in data.indices) { for (index in data.indices) {
@ -179,9 +181,9 @@ class SplitViewFragment : Fragment() {
for (index in data.indices) { for (index in data.indices) {
videoViews[index].stopRetryCount() videoViews[index].stopRetryCount()
videoViews[index].stop() videoViews[index].stop()
delay(500) delay(300)
}
} }
}.start()
companion object { companion object {
private val TAG = SplitViewFragment::class.java.simpleName private val TAG = SplitViewFragment::class.java.simpleName