Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
90f89efc
Commit
90f89efc
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
TV: ensure media list has focus
Menu button were taking focus while recyclerview was being populated
parent
b506c8b9
No related branches found
No related tags found
No related merge requests found
Pipeline
#7465
passed with stage
in 3 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseBrowserTvFragment.kt
+12
-5
12 additions, 5 deletions
.../org/videolan/vlc/gui/tv/browser/BaseBrowserTvFragment.kt
with
12 additions
and
5 deletions
vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseBrowserTvFragment.kt
+
12
−
5
View file @
90f89efc
...
...
@@ -45,10 +45,7 @@ import androidx.leanback.app.BackgroundManager
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
kotlinx.android.synthetic.main.song_browser.*
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.ExperimentalCoroutinesApi
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.ObsoleteCoroutinesApi
import
kotlinx.coroutines.*
import
org.videolan.medialibrary.Medialibrary
import
org.videolan.medialibrary.media.MediaLibraryItem
import
org.videolan.medialibrary.media.MediaWrapper
...
...
@@ -87,6 +84,7 @@ abstract class BaseBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEv
private
var
currentArt
:
String
?
=
null
private
lateinit
var
backgroundManager
:
BackgroundManager
internal
lateinit
var
animationDelegate
:
MediaBrowserAnimatorDelegate
private
var
setFocus
=
true
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
binding
=
SongBrowserBinding
.
inflate
(
inflater
,
container
,
false
)
...
...
@@ -185,6 +183,11 @@ abstract class BaseBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEv
super
.
onViewCreated
(
view
,
savedInstanceState
)
}
override
fun
onStart
()
{
super
.
onStart
()
setFocus
=
true
}
private
fun
calculateNbColumns
()
{
viewModel
.
nbColumns
=
getColumnNumber
()
}
...
...
@@ -343,10 +346,14 @@ abstract class BaseBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEv
fun
submitList
(
pagedList
:
Any
)
{
adapter
.
submitList
(
pagedList
)
if
(
setFocus
)
{
setFocus
=
false
launch
{
binding
.
list
.
requestFocus
()
}
}
animationDelegate
.
setVisibility
(
imageButtonHeader
,
if
(
viewModel
.
provider
.
headers
.
isEmpty
)
View
.
GONE
else
View
.
VISIBLE
)
animationDelegate
.
setVisibility
(
headerButton
,
if
(
viewModel
.
provider
.
headers
.
isEmpty
)
View
.
GONE
else
View
.
VISIBLE
)
animationDelegate
.
setVisibility
(
headerDescription
,
if
(
viewModel
.
provider
.
headers
.
isEmpty
)
View
.
GONE
else
View
.
VISIBLE
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment