@@ -23,7 +23,11 @@ package net.newpipe.newplayer.ui.videoplayer
2323import android.os.Build
2424import androidx.annotation.OptIn
2525import androidx.compose.animation.AnimatedVisibility
26- import androidx.compose.foundation.clickable
26+ import androidx.compose.animation.core.snap
27+ import androidx.compose.animation.expandIn
28+ import androidx.compose.animation.fadeIn
29+ import androidx.compose.animation.fadeOut
30+ import androidx.compose.animation.shrinkOut
2731import androidx.compose.foundation.layout.Box
2832import androidx.compose.foundation.layout.aspectRatio
2933import androidx.compose.foundation.layout.fillMaxSize
@@ -44,14 +48,14 @@ import androidx.compose.ui.layout.boundsInWindow
4448import androidx.compose.ui.layout.onGloballyPositioned
4549import androidx.core.graphics.toRect
4650import androidx.media3.common.util.UnstableApi
47- import net.newpipe.newplayer.uiModel.NewPlayerUIState
48- import net.newpipe.newplayer.uiModel.InternalNewPlayerViewModel
49- import net.newpipe.newplayer.ui.selection_ui.StreamSelectUI
5051import net.newpipe.newplayer.data.NewPlayerException
5152import net.newpipe.newplayer.ui.common.activity
5253import net.newpipe.newplayer.ui.selection_ui.ChapterSelectUI
54+ import net.newpipe.newplayer.ui.selection_ui.StreamSelectUI
5355import net.newpipe.newplayer.ui.videoplayer.pip.getPipParams
5456import net.newpipe.newplayer.ui.videoplayer.pip.supportsPip
57+ import net.newpipe.newplayer.uiModel.InternalNewPlayerViewModel
58+ import net.newpipe.newplayer.uiModel.NewPlayerUIState
5559import net.newpipe.newplayer.uiModel.UIModeState
5660
5761@OptIn(UnstableApi ::class )
@@ -93,7 +97,7 @@ internal fun VideoPlayerUi(viewModel: InternalNewPlayerViewModel, uiState: NewPl
9397 && supportsPip(activity)
9498 ) {
9599 val pipParams = getPipParams(uiState.contentRatio, videoViewBounds)
96- if (pipParams != null )
100+ if (pipParams != null )
97101 activity.setPictureInPictureParams(pipParams)
98102 }
99103 }
@@ -131,7 +135,11 @@ internal fun VideoPlayerUi(viewModel: InternalNewPlayerViewModel, uiState: NewPl
131135 viewModel, uiState = uiState
132136 )
133137
134- AnimatedVisibility (visible = uiState.uiMode.isStreamSelect) {
138+ AnimatedVisibility (
139+ visible = uiState.uiMode.isStreamSelect,
140+ enter = fadeIn() + expandIn(),
141+ exit = fadeOut(animationSpec = snap(0 ))
142+ ) {
135143 Surface (
136144 modifier = Modifier .fillMaxSize(),
137145 color = STREAMSELECT_UI_BACKGROUND_COLOR
@@ -144,7 +152,11 @@ internal fun VideoPlayerUi(viewModel: InternalNewPlayerViewModel, uiState: NewPl
144152 }
145153 }
146154
147- AnimatedVisibility (visible = uiState.uiMode.isChapterSelect) {
155+ AnimatedVisibility (
156+ visible = uiState.uiMode.isChapterSelect,
157+ enter = fadeIn() + expandIn(),
158+ exit = fadeOut(animationSpec = snap(0 ))
159+ ) {
148160 Surface (
149161 modifier = Modifier .fillMaxSize(),
150162 color = STREAMSELECT_UI_BACKGROUND_COLOR
0 commit comments