Commit 0b8b4ec9 authored by Geoffrey Métais's avatar Geoffrey Métais

TV: Focus helper for player advanced options

parent 40ccbc2f
...@@ -22,6 +22,7 @@ import androidx.lifecycle.OnLifecycleEvent ...@@ -22,6 +22,7 @@ import androidx.lifecycle.OnLifecycleEvent
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.videolan.vlc.PlaybackService import org.videolan.vlc.PlaybackService
import org.videolan.vlc.R import org.videolan.vlc.R
...@@ -128,6 +129,11 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba ...@@ -128,6 +129,11 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
setup() setup()
} }
rootView.visibility = View.VISIBLE rootView.visibility = View.VISIBLE
if (AndroidDevices.showTvUi(activity)) AppScope.launch {
delay(100L)
val position = (recyclerview.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition()
(recyclerview.layoutManager as LinearLayoutManager).findViewByPosition(position)?.requestFocus()
}
} }
fun hide() { fun hide() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment