Skip to content
Snippets Groups Projects
Commit 3f1ab488 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Auto close storage dialog after 30s

(cherry picked from commit 08946ca7)
parent c66d5705
No related branches found
No related tags found
No related merge requests found
Pipeline #6622 passed with stage
in 3 minutes and 59 seconds
......@@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import kotlinx.coroutines.*
import org.videolan.vlc.R
import org.videolan.vlc.StartActivity
import org.videolan.vlc.databinding.DialogExtDeviceBinding
......@@ -14,7 +15,7 @@ import org.videolan.vlc.util.EXTRA_PATH
private const val TAG = "VLC/DeviceDialog"
class DeviceDialog : DialogFragment() {
class DeviceDialog : DialogFragment(), CoroutineScope by MainScope() {
private lateinit var path : String
private lateinit var uuid : String
......@@ -22,7 +23,7 @@ class DeviceDialog : DialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(DialogFragment.STYLE_NO_FRAME, 0)
setStyle(STYLE_NO_FRAME, 0)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
......@@ -33,8 +34,17 @@ class DeviceDialog : DialogFragment() {
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
launch {
delay(30_000L)
dismiss()
}
}
override fun onDestroy() {
super.onDestroy()
cancel()
activity?.finish()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment