Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
532
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
fbea3a05
You need to sign in or sign up before continuing.
Commit
fbea3a05
authored
5 years ago
by
Nicolas Pomepuy
Committed by
Geoffrey Métais
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Open a playlist from home screen
parent
e67584ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
+4
-0
4 additions, 0 deletions
vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
vlc-android/src/org/videolan/vlc/viewmodels/tv/MainTvModel.kt
+5
-5
5 additions, 5 deletions
...android/src/org/videolan/vlc/viewmodels/tv/MainTvModel.kt
with
9 additions
and
5 deletions
vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
+
4
−
0
View file @
fbea3a05
...
...
@@ -28,10 +28,12 @@ import android.graphics.Bitmap
import
android.graphics.drawable.BitmapDrawable
import
android.net.Uri
import
android.os.Build
import
android.provider.MediaStore.Video.VideoColumns.CATEGORY
import
android.text.TextUtils
import
android.view.View
import
androidx.annotation.RequiresApi
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat.startActivity
import
androidx.fragment.app.FragmentActivity
import
androidx.leanback.app.BackgroundManager
import
androidx.leanback.widget.DiffCallback
...
...
@@ -56,6 +58,7 @@ import org.videolan.vlc.util.*
import
org.videolan.vlc.viewmodels.BaseModel
import
org.videolan.vlc.viewmodels.browser.BrowserModel
import
kotlin.collections.ArrayList
@ExperimentalCoroutinesApi
@ObsoleteCoroutinesApi
@TargetApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN
)
...
...
@@ -292,6 +295,7 @@ object TvUtil {
fun
openAudioCategory
(
context
:
Activity
,
mediaLibraryItem
:
MediaLibraryItem
)
{
when
{
mediaLibraryItem
.
itemType
==
MediaLibraryItem
.
TYPE_ALBUM
->
playAudioList
(
context
,
mediaLibraryItem
.
tracks
,
0
)
mediaLibraryItem
.
itemType
==
MediaLibraryItem
.
TYPE_PLAYLIST
->
playAudioList
(
context
,
mediaLibraryItem
.
tracks
,
0
)
mediaLibraryItem
.
itemType
==
MediaLibraryItem
.
TYPE_MEDIA
->
{
val
list
=
ArrayList
<
MediaWrapper
>().
apply
{
add
(
mediaLibraryItem
as
MediaWrapper
)
}
playAudioList
(
context
,
list
,
0
)
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/viewmodels/tv/MainTvModel.kt
+
5
−
5
View file @
fbea3a05
...
...
@@ -69,10 +69,10 @@ class MainTvModel(app: Application) : AndroidViewModel(app), Medialibrary.OnMedi
private
set
// LiveData
private
val
favorites
:
LiveData
<
List
<
BrowserFav
>>
=
browserFavRepository
.
browserFavorites
val
videos
:
LiveData
<
List
<
MediaLibraryItem
>>
=
MutableLiveData
()
val
audioCategories
:
LiveData
<
List
<
MediaLibraryItem
>>
=
MutableLiveData
()
val
browsers
:
LiveData
<
List
<
MediaLibraryItem
>>
=
MutableLiveData
()
val
history
:
LiveData
<
List
<
MediaWrapper
>>
=
MutableLiveData
()
val
videos
:
LiveData
<
List
<
MediaLibraryItem
>>
=
MutableLiveData
()
val
audioCategories
:
LiveData
<
List
<
MediaLibraryItem
>>
=
MutableLiveData
()
val
browsers
:
LiveData
<
List
<
MediaLibraryItem
>>
=
MutableLiveData
()
val
history
:
LiveData
<
List
<
MediaWrapper
>>
=
MutableLiveData
()
val
playlist
:
LiveData
<
List
<
MediaLibraryItem
>>
=
MutableLiveData
()
private
val
nowPlayingDelegate
=
NowPlayingDelegate
(
this
)
...
...
@@ -238,7 +238,7 @@ class MainTvModel(app: Application) : AndroidViewModel(app), Medialibrary.OnMedi
fun
Fragment
.
getMainTvModel
()
=
ViewModelProviders
.
of
(
requireActivity
(),
Factory
(
requireActivity
().
application
)).
get
(
MainTvModel
::
class
.
java
)
}
class
Factory
(
private
val
app
:
Application
):
ViewModelProvider
.
NewInstanceFactory
()
{
class
Factory
(
private
val
app
:
Application
)
:
ViewModelProvider
.
NewInstanceFactory
()
{
override
fun
<
T
:
ViewModel
>
create
(
modelClass
:
Class
<
T
>):
T
{
@Suppress
(
"UNCHECKED_CAST"
)
return
MainTvModel
(
app
)
as
T
...
...
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