fix typo error s/vissibible/visible

This commit is contained in:
Christian Schabesberger 2024-08-19 11:37:35 +02:00
parent 2ca274423e
commit 151ab85ea8
7 changed files with 12 additions and 15 deletions

View File

@ -28,8 +28,7 @@ import net.newpipe.newplayer.ui.ContentScale
data class VideoPlayerUIState( data class VideoPlayerUIState(
val playing: Boolean, val playing: Boolean,
var fullscreen: Boolean, var fullscreen: Boolean,
val uiVissible: Boolean, val uiVisible: Boolean,
var uiVisible: Boolean,
val contentRatio: Float, val contentRatio: Float,
val embeddedUiRatio: Float, val embeddedUiRatio: Float,
val contentFitMode: ContentScale, val contentFitMode: ContentScale,
@ -48,7 +47,6 @@ data class VideoPlayerUIState(
val DEFAULT = VideoPlayerUIState( val DEFAULT = VideoPlayerUIState(
playing = false, playing = false,
fullscreen = false, fullscreen = false,
uiVissible = false,
uiVisible = false, uiVisible = false,
contentRatio = 16 / 9f, contentRatio = 16 / 9f,
embeddedUiRatio = 16f / 9f, embeddedUiRatio = 16f / 9f,

View File

@ -210,7 +210,7 @@ class VideoPlayerViewModelImpl @Inject constructor(
override fun showUi() { override fun showUi() {
mutableUiState.update { mutableUiState.update {
it.copy(uiVissible = true) it.copy(uiVisible = true)
} }
resetHideUiDelayedJob() resetHideUiDelayedJob()
resetProgressUpdatePeriodicallyJob() resetProgressUpdatePeriodicallyJob()
@ -255,7 +255,7 @@ class VideoPlayerViewModelImpl @Inject constructor(
progressUpdaterJob?.cancel() progressUpdaterJob?.cancel()
uiVisibilityJob?.cancel() uiVisibilityJob?.cancel()
mutableUiState.update { mutableUiState.update {
it.copy(uiVissible = false) it.copy(uiVisible = false)
} }
} }
@ -336,7 +336,7 @@ class VideoPlayerViewModelImpl @Inject constructor(
uiVisibilityJob?.cancel() uiVisibilityJob?.cancel()
finishFastSeek() finishFastSeek()
mutableUiState.update { mutableUiState.update {
it.copy(fullscreen = false, uiVissible = false) it.copy(fullscreen = false, uiVisible = false)
} }
} }
@ -345,7 +345,7 @@ class VideoPlayerViewModelImpl @Inject constructor(
uiVisibilityJob?.cancel() uiVisibilityJob?.cancel()
finishFastSeek() finishFastSeek()
mutableUiState.update { mutableUiState.update {
it.copy(fullscreen = true, uiVissible = false) it.copy(fullscreen = true, uiVisible = false)
} }
} }

View File

@ -33,7 +33,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.systemGestures
import androidx.compose.foundation.layout.union import androidx.compose.foundation.layout.union
import androidx.compose.foundation.layout.waterfall import androidx.compose.foundation.layout.waterfall
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
@ -51,7 +50,6 @@ import androidx.compose.ui.unit.dp
import net.newpipe.newplayer.model.VideoPlayerUIState import net.newpipe.newplayer.model.VideoPlayerUIState
import net.newpipe.newplayer.model.VideoPlayerViewModel import net.newpipe.newplayer.model.VideoPlayerViewModel
import net.newpipe.newplayer.model.VideoPlayerViewModelDummy import net.newpipe.newplayer.model.VideoPlayerViewModelDummy
import net.newpipe.newplayer.model.VideoPlayerViewModelImpl
import net.newpipe.newplayer.ui.theme.VideoPlayerTheme import net.newpipe.newplayer.ui.theme.VideoPlayerTheme
import net.newpipe.newplayer.ui.videoplayer.BottomUI import net.newpipe.newplayer.ui.videoplayer.BottomUI
import net.newpipe.newplayer.ui.videoplayer.CenterUI import net.newpipe.newplayer.ui.videoplayer.CenterUI
@ -83,7 +81,7 @@ fun VideoPlayerControllerUI(
.union(WindowInsets.displayCutout) .union(WindowInsets.displayCutout)
.union(WindowInsets.waterfall) .union(WindowInsets.waterfall)
AnimatedVisibility(uiState.uiVissible) { AnimatedVisibility(uiState.uiVisible) {
Surface( Surface(
modifier = Modifier.fillMaxSize(), color = Color(0x75000000) modifier = Modifier.fillMaxSize(), color = Color(0x75000000)
) {} ) {}
@ -108,7 +106,8 @@ fun VideoPlayerControllerUI(
} }
} }
AnimatedVisibility(uiState.uiVissible) { AnimatedVisibility(uiState.uiVisible) {
Box(modifier = Modifier.fillMaxSize()) { Box(modifier = Modifier.fillMaxSize()) {
CenterUI( CenterUI(
modifier = Modifier.align(Alignment.Center), modifier = Modifier.align(Alignment.Center),

View File

@ -94,7 +94,7 @@ fun VideoPlayerUI(
} }
// Setup immersive mode // Setup immersive mode
if (uiState.fullscreen && !uiState.uiVissible) { if (uiState.fullscreen && !uiState.uiVisible) {
LaunchedEffect(key1 = true) { LaunchedEffect(key1 = true) {
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()) windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
} }

View File

@ -79,7 +79,7 @@ fun VideoPlayerControllerUIPreviewEmbeddedColorPreview() {
uiState = VideoPlayerUIState.DEFAULT.copy( uiState = VideoPlayerUIState.DEFAULT.copy(
playing = true, playing = true,
fullscreen = false, fullscreen = false,
uiVissible = true, uiVisible = true,
seekerPosition = 0.3f, seekerPosition = 0.3f,
isLoading = false, isLoading = false,
durationInMs = 9 * 60 * 1000, durationInMs = 9 * 60 * 1000,

View File

@ -54,7 +54,7 @@ fun EmbeddedGestureUI(
} }
val defaultOnRegularTap = { val defaultOnRegularTap = {
if (uiState.uiVissible) { if (uiState.uiVisible) {
viewModel.hideUi() viewModel.hideUi()
} else { } else {
viewModel.showUi() viewModel.showUi()

View File

@ -290,7 +290,7 @@ fun FullscreenGestureUIPreviewInteractive() {
} }
}, },
uiState = VideoPlayerUIState.DEFAULT.copy( uiState = VideoPlayerUIState.DEFAULT.copy(
uiVissible = uiVisible, uiVisible = uiVisible,
fastSeekSeconds = seekSeconds, fastSeekSeconds = seekSeconds,
soundVolume = soundVolume, soundVolume = soundVolume,
brightness = brightnessValue brightness = brightnessValue