diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/GestureHandler.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/GestureHandler.kt index 97c6acadf7..ad0aa2d9dd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/GestureHandler.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/GestureHandler.kt @@ -125,17 +125,18 @@ fun GestureHandler( if (controlsShown) viewModel.hideControls() else viewModel.showControls() }, onDoubleTap = { - if (isDoubleTapSeeking) return@detectTapGestures + if (areControlsLocked || isDoubleTapSeeking) return@detectTapGestures if (it.x > size.width * 3 / 5) { if (!isSeekingForwards) viewModel.updateSeekAmount(0) viewModel.handleRightDoubleTap() + isDoubleTapSeeking = true } else if (it.x < size.width * 2 / 5) { if (isSeekingForwards) viewModel.updateSeekAmount(0) viewModel.handleLeftDoubleTap() + isDoubleTapSeeking = true } else { viewModel.handleCenterDoubleTap() } - isDoubleTapSeeking = true }, onPress = { if (panelShown != Panels.None && !allowGesturesInPanels) { @@ -144,7 +145,7 @@ fun GestureHandler( val press = PressInteraction.Press( it.copy(x = if (it.x > size.width * 3 / 5) it.x - size.width * 0.6f else it.x), ) - if (isDoubleTapSeeking) { + if (!areControlsLocked && isDoubleTapSeeking && seekAmount != 0) { if (it.x > size.width * 3 / 5) { if (!isSeekingForwards) viewModel.updateSeekAmount(0) viewModel.handleRightDoubleTap() @@ -154,6 +155,8 @@ fun GestureHandler( } else { viewModel.handleCenterDoubleTap() } + } else { + isDoubleTapSeeking = false } interactionSource.emit(press) tryAwaitRelease() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/components/panels/SubtitleSettingsTypographyCard.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/components/panels/SubtitleSettingsTypographyCard.kt index 35767816c6..8c9cc092d2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/components/panels/SubtitleSettingsTypographyCard.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/controls/components/panels/SubtitleSettingsTypographyCard.kt @@ -18,8 +18,10 @@ package eu.kanade.tachiyomi.ui.player.controls.components.panels import android.annotation.SuppressLint +import androidx.compose.foundation.clickable import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -30,6 +32,7 @@ import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.rememberScrollState import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.BorderColor +import androidx.compose.material.icons.filled.BorderStyle import androidx.compose.material.icons.filled.Check import androidx.compose.material.icons.filled.FormatBold import androidx.compose.material.icons.filled.FormatClear @@ -269,24 +272,54 @@ fun SubtitleSettingsTypographyCard( } var selectingBorderStyle by remember { mutableStateOf(false) } - DropdownMenu(expanded = selectingBorderStyle, onDismissRequest = { selectingBorderStyle = false }) { - SubtitlesBorderStyle.entries.map { - DropdownMenuItem( - text = { Text(stringResource(it.titleRes)) }, - onClick = { - borderStyle = it - preferences.borderStyleSubtitles().set(it) - MPVLib.setPropertyString("sub-border-style", it.value) - }, - trailingIcon = { - if (borderStyle == it) { - Icon( - imageVector = Icons.Default.Check, - contentDescription = null, - ) - } - }, - ) + Box { + Row( + modifier = Modifier + .fillMaxWidth() + .clickable( + onClick = { + selectingBorderStyle = !selectingBorderStyle + }, + ) + .padding( + horizontal = MaterialTheme.padding.medium, + vertical = MaterialTheme.padding.small, + ), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.large), + ) { + Icon(Icons.Default.BorderStyle, null) + Column { + Text( + text = stringResource(MR.strings.player_sheets_sub_typography_border_style), + style = MaterialTheme.typography.bodyLarge, + ) + Text( + text = stringResource(borderStyle.titleRes), + style = MaterialTheme.typography.bodyMedium, + ) + } + } + DropdownMenu(expanded = selectingBorderStyle, onDismissRequest = { selectingBorderStyle = false }) { + SubtitlesBorderStyle.entries.map { + DropdownMenuItem( + text = { Text(stringResource(it.titleRes)) }, + onClick = { + borderStyle = it + preferences.borderStyleSubtitles().set(it) + MPVLib.setPropertyString("sub-border-style", it.value) + selectingBorderStyle = false + }, + trailingIcon = { + if (borderStyle == it) { + Icon( + imageVector = Icons.Default.Check, + contentDescription = null, + ) + } + }, + ) + } } } SliderItem( diff --git a/i18n/src/commonMain/moko-resources/base/strings.xml b/i18n/src/commonMain/moko-resources/base/strings.xml index e326697e1f..74683a7530 100644 --- a/i18n/src/commonMain/moko-resources/base/strings.xml +++ b/i18n/src/commonMain/moko-resources/base/strings.xml @@ -399,6 +399,7 @@ Typography Font Font size + Border style Border size Shadow offset Outline and shadow