Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grayjay
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoStreaming
Grayjay
Commits
ef284ba5
Verified
Commit
ef284ba5
authored
9 months ago
by
Kai DeLorenzo
Browse files
Options
Downloads
Patches
Plain Diff
fixed tab changing when adding the playlist tab
parent
5edd389e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!18
add support for channel playlists on the channel page
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/ChannelFragment.kt
+16
-2
16 additions, 2 deletions
...tformplayer/fragment/mainactivity/main/ChannelFragment.kt
with
16 additions
and
2 deletions
app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/ChannelFragment.kt
+
16
−
2
View file @
ef284ba5
...
...
@@ -459,17 +459,31 @@ class ChannelFragment : MainFragment() {
val
supportsPlaylists
=
StatePlatform
.
instance
.
getChannelClient
(
channel
.
url
).
capabilities
.
hasGetChannelPlaylists
val
playlistPosition
=
2
if
(
supportsPlaylists
&&
!(
_viewPager
.
adapter
as
ChannelViewPagerAdapter
).
containsItem
(
ChannelTab
.
PLAYLISTS
.
ordinal
.
toLong
()
)
)
{
(
_viewPager
.
adapter
as
ChannelViewPagerAdapter
).
insert
(
2
,
ChannelTab
.
PLAYLISTS
)
// keep the current tab selected
if
(
_viewPager
.
currentItem
>=
playlistPosition
)
{
_viewPager
.
setCurrentItem
(
_viewPager
.
currentItem
+
1
,
false
)
}
(
_viewPager
.
adapter
as
ChannelViewPagerAdapter
).
insert
(
playlistPosition
,
ChannelTab
.
PLAYLISTS
)
}
if
(!
supportsPlaylists
&&
(
_viewPager
.
adapter
as
ChannelViewPagerAdapter
).
containsItem
(
ChannelTab
.
PLAYLISTS
.
ordinal
.
toLong
()
)
)
{
(
_viewPager
.
adapter
as
ChannelViewPagerAdapter
).
remove
(
2
)
// keep the current tab selected
if
(
_viewPager
.
currentItem
>=
playlistPosition
)
{
_viewPager
.
setCurrentItem
(
_viewPager
.
currentItem
-
1
,
false
)
}
(
_viewPager
.
adapter
as
ChannelViewPagerAdapter
).
remove
(
playlistPosition
)
}
// sets the channel for each tab
...
...
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