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
32915c82
Commit
32915c82
authored
3 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Remove useless audio item size calculation
parent
f650bbc7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1193
Tablet UI
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
+3
-7
3 additions, 7 deletions
...id/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
with
3 additions
and
7 deletions
application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
+
3
−
7
View file @
32915c82
...
...
@@ -158,14 +158,12 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>() {
override
fun
onConfigurationChanged
(
newConfig
:
Configuration
)
{
super
.
onConfigurationChanged
(
newConfig
)
val
itemSize
=
RecyclerSectionItemGridDecoration
.
getItemSize
(
requireActivity
().
getScreenWidth
(),
nbColumns
,
spacing
)
for
(
i
in
0
until
MODE_TOTAL
)
{
if
(
i
>=
lists
.
size
||
i
>=
adapters
.
size
)
continue
if
(
lists
[
i
].
layoutManager
is
GridLayoutManager
)
{
val
gridLayoutManager
=
lists
[
i
].
layoutManager
as
GridLayoutManager
gridLayoutManager
.
spanCount
=
nbColumns
lists
[
i
].
layoutManager
=
gridLayoutManager
adapters
[
i
].
cardSize
=
itemSize
adapters
[
i
].
notifyItemRangeChanged
(
gridLayoutManager
.
findFirstVisibleItemPosition
(),
gridLayoutManager
.
findLastVisibleItemPosition
()
-
gridLayoutManager
.
findFirstVisibleItemPosition
())
}
}
...
...
@@ -184,11 +182,9 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>() {
viewModel
=
getViewModel
()
currentTab
=
viewModel
.
currentTab
val
itemSize
=
RecyclerSectionItemGridDecoration
.
getItemSize
(
requireActivity
().
getScreenWidth
(),
nbColumns
,
spacing
)
artistsAdapter
=
AudioBrowserAdapter
(
MediaLibraryItem
.
TYPE_ARTIST
,
this
,
cardSize
=
if
(
viewModel
.
providersInCard
[
0
])
itemSize
else
-
1
)
albumsAdapter
=
AudioBrowserAdapter
(
MediaLibraryItem
.
TYPE_ALBUM
,
this
,
cardSize
=
if
(
viewModel
.
providersInCard
[
1
])
itemSize
else
-
1
)
songsAdapter
=
AudioBrowserAdapter
(
MediaLibraryItem
.
TYPE_MEDIA
,
this
,
cardSize
=
if
(
viewModel
.
providersInCard
[
2
])
itemSize
else
-
1
)
artistsAdapter
=
AudioBrowserAdapter
(
MediaLibraryItem
.
TYPE_ARTIST
,
this
)
albumsAdapter
=
AudioBrowserAdapter
(
MediaLibraryItem
.
TYPE_ALBUM
,
this
)
songsAdapter
=
AudioBrowserAdapter
(
MediaLibraryItem
.
TYPE_MEDIA
,
this
)
genresAdapter
=
AudioBrowserAdapter
(
MediaLibraryItem
.
TYPE_GENRE
,
this
)
adapters
=
arrayOf
(
artistsAdapter
,
albumsAdapter
,
songsAdapter
,
genresAdapter
)
setupProvider
()
...
...
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