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
13
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
c8d59d68
Commit
c8d59d68
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Upgrade paging to v 2.1.0 with ktx extension
parent
244825ea
No related branches found
No related tags found
No related merge requests found
Pipeline
#5635
passed with stage
in 25 minutes and 42 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
build.gradle
+1
-1
1 addition, 1 deletion
build.gradle
vlc-android/build.gradle
+1
-1
1 addition, 1 deletion
vlc-android/build.gradle
vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
+10
-9
10 additions, 9 deletions
...oid/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
with
12 additions
and
11 deletions
build.gradle
+
1
−
1
View file @
c8d59d68
...
...
@@ -42,7 +42,7 @@ ext {
constraintLayoutVersion
=
'1.1.3'
archVersion
=
'2.0.0'
roomVersion
=
'2.0.0'
pagingVersion
=
'2.
0
.0'
pagingVersion
=
'2.
1
.0'
junitVersion
=
'4.12'
mockito
=
'2.8.9'
powerMock
=
'1.7.4'
...
...
This diff is collapsed.
Click to expand it.
vlc-android/build.gradle
+
1
−
1
View file @
c8d59d68
...
...
@@ -231,7 +231,7 @@ dependencies {
kapt
"androidx.lifecycle:lifecycle-compiler:$rootProject.ext.archVersion"
implementation
"androidx.room:room-runtime:$rootProject.ext.roomVersion"
kapt
"androidx.room:room-compiler:$rootProject.ext.roomVersion"
implementation
"androidx.paging:paging-runtime:$rootProject.ext.pagingVersion"
implementation
"androidx.paging:paging-runtime
-ktx
:$rootProject.ext.pagingVersion"
// Retrofit
implementation
"com.squareup.retrofit2:retrofit:$rootProject.ext.retrofit"
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
+
10
−
9
View file @
c8d59d68
...
...
@@ -5,10 +5,10 @@ import androidx.annotation.MainThread
import
androidx.collection.SparseArrayCompat
import
androidx.lifecycle.LiveData
import
androidx.lifecycle.MutableLiveData
import
androidx.paging.Config
import
androidx.paging.DataSource
import
androidx.paging.LivePagedListBuilder
import
androidx.paging.PagedList
import
androidx.paging.PositionalDataSource
import
androidx.paging.toLiveData
import
kotlinx.coroutines.*
import
org.videolan.medialibrary.Medialibrary
import
org.videolan.medialibrary.media.MediaLibraryItem
...
...
@@ -29,14 +29,15 @@ abstract class MLPagedModel<T : MediaLibraryItem>(context: Context) : SortableMo
private
val
headers
=
HeadersIndex
()
val
liveHeaders
:
LiveData
<
HeadersIndex
>
=
MutableLiveData
<
HeadersIndex
>()
private
val
pagingConfig
=
PagedList
.
Config
.
Builder
()
.
setPageSize
(
MEDIALIBRARY_PAGE_SIZE
)
.
setPrefetchDistance
(
MEDIALIBRARY_PAGE_SIZE
/
5
)
.
setEnablePlaceholders
(
true
)
.
build
()
private
val
pagingConfig
=
Config
(
pageSize
=
MEDIALIBRARY_PAGE_SIZE
,
prefetchDistance
=
MEDIALIBRARY_PAGE_SIZE
/
5
,
enablePlaceholders
=
true
,
initialLoadSizeHint
=
MEDIALIBRARY_PAGE_SIZE
*
3
,
maxSize
=
MEDIALIBRARY_PAGE_SIZE
*
3
)
val
pagedList
=
LivePagedListBuilder
(
MLDatasourceFactory
(),
pagingConfig
)
.
build
()
val
pagedList
=
MLDatasourceFactory
().
toLiveData
(
pagingConfig
)
init
{
medialibrary
.
addOnMedialibraryReadyListener
(
this
)
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
012ef479
·
5 years ago
mentioned in commit
012ef479
mentioned in commit 012ef47972e8f6c4cac08f52cfa7a36a3edf8573
Toggle commit list
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