Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
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
0139d3f8
Commit
0139d3f8
authored
4 years ago
by
Geoffrey Métais
Committed by
Nicolas Pomepuy
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
No need for I/O queries for folders count
parent
283f3e17
No related branches found
No related tags found
1 merge request
!460
Folders count
Pipeline
#14074
passed with stage
in 35 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
+3
-7
3 additions, 7 deletions
...ndroid/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
with
3 additions
and
7 deletions
application/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
+
3
−
7
View file @
0139d3f8
...
...
@@ -129,8 +129,6 @@ class VideoListAdapter(private var isSeenMediaMarkerVisible: Boolean
override
fun
onViewRecycled
(
holder
:
ViewHolder
)
{
holder
.
binding
.
setVariable
(
BR
.
cover
,
UiTools
.
getDefaultVideoDrawable
(
holder
.
itemView
.
context
))
holder
.
job
?.
cancel
()
holder
.
job
=
null
}
override
fun
getItem
(
position
:
Int
)
=
if
(
isPositionValid
(
position
))
super
.
getItem
(
position
)
else
null
...
...
@@ -139,14 +137,13 @@ class VideoListAdapter(private var isSeenMediaMarkerVisible: Boolean
private
fun
fillView
(
holder
:
ViewHolder
,
item
:
MediaLibraryItem
)
{
when
(
item
)
{
is
Folder
->
holder
.
job
=
holder
.
itemView
.
scope
.
launch
(
start
=
CoroutineStart
.
UNDISPATCHED
)
{
val
count
=
withContext
(
Dispatchers
.
IO
)
{
item
.
mediaCount
(
Folder
.
TYPE_FOLDER_VIDEO
)
}
holder
.
binding
.
setVariable
(
BR
.
time
,
holder
.
itemView
.
context
.
resources
.
getQuantityString
(
R
.
plurals
.
videos_quantity
,
count
,
count
))
is
Folder
->
{
holder
.
title
.
text
=
item
.
title
if
(!
isListMode
)
holder
.
binding
.
setVariable
(
BR
.
resolution
,
null
)
holder
.
binding
.
setVariable
(
BR
.
seen
,
0L
)
holder
.
binding
.
setVariable
(
BR
.
max
,
0
)
holder
.
job
=
null
val
count
=
item
.
mediaCount
(
Folder
.
TYPE_FOLDER_VIDEO
)
holder
.
binding
.
setVariable
(
BR
.
time
,
holder
.
itemView
.
context
.
resources
.
getQuantityString
(
R
.
plurals
.
videos_quantity
,
count
,
count
))
}
is
VideoGroup
->
holder
.
itemView
.
scope
.
launch
{
val
count
=
item
.
mediaCount
()
...
...
@@ -200,7 +197,6 @@ class VideoListAdapter(private var isSeenMediaMarkerVisible: Boolean
inner
class
ViewHolder
(
binding
:
ViewDataBinding
)
:
SelectorViewHolder
<
ViewDataBinding
>(
binding
)
{
val
overlay
:
ImageView
=
itemView
.
findViewById
(
R
.
id
.
ml_item_overlay
)
val
title
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
ml_item_title
)
var
job
:
Job
?
=
null
init
{
binding
.
setVariable
(
BR
.
holder
,
this
)
...
...
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