mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Fix next up episode back handling
This commit is contained in:
parent
61a69f206b
commit
3906eb196a
2 changed files with 8 additions and 7 deletions
|
|
@ -183,17 +183,17 @@ fun PlaybackPage(
|
|||
|
||||
Box(
|
||||
modifier
|
||||
.background(Color.Black)
|
||||
.onKeyEvent(keyHandler::onKeyEvent)
|
||||
.focusRequester(focusRequester)
|
||||
.focusable(),
|
||||
.background(Color.Black),
|
||||
) {
|
||||
val playerSize by animateFloatAsState(if (nextUp == null) 1f else .66f)
|
||||
Box(
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxSize(playerSize)
|
||||
.align(Alignment.TopCenter),
|
||||
.align(Alignment.TopCenter)
|
||||
.onKeyEvent(keyHandler::onKeyEvent)
|
||||
.focusRequester(focusRequester)
|
||||
.focusable(),
|
||||
) {
|
||||
PlayerSurface(
|
||||
player = player,
|
||||
|
|
@ -354,7 +354,7 @@ fun PlaybackPage(
|
|||
|
||||
// Next up episode
|
||||
BackHandler(nextUp != null) {
|
||||
viewModel.cancelUpNextEpisode()
|
||||
viewModel.navigationManager.goBack()
|
||||
}
|
||||
AnimatedVisibility(
|
||||
nextUp != null,
|
||||
|
|
@ -374,7 +374,6 @@ fun PlaybackPage(
|
|||
preferences.appPreferences.playbackPreferences.autoPlayNextDelaySeconds,
|
||||
)
|
||||
}
|
||||
// TODO need extra back press for some reason
|
||||
BackHandler(timeLeft > 0 && autoPlayEnabled) {
|
||||
timeLeft = -1
|
||||
autoPlayEnabled = false
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.github.damontecres.dolphin.preferences.UserPreferences
|
|||
import com.github.damontecres.dolphin.ui.DefaultItemFields
|
||||
import com.github.damontecres.dolphin.ui.indexOfFirstOrNull
|
||||
import com.github.damontecres.dolphin.ui.nav.Destination
|
||||
import com.github.damontecres.dolphin.ui.nav.NavigationManager
|
||||
import com.github.damontecres.dolphin.util.ApiRequestPager
|
||||
import com.github.damontecres.dolphin.util.EqualityMutableLiveData
|
||||
import com.github.damontecres.dolphin.util.ExceptionHandler
|
||||
|
|
@ -85,6 +86,7 @@ class PlaybackViewModel
|
|||
constructor(
|
||||
@ApplicationContext context: Context,
|
||||
val api: ApiClient,
|
||||
val navigationManager: NavigationManager,
|
||||
) : ViewModel() {
|
||||
val player: ExoPlayer =
|
||||
ExoPlayer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue