diff --git a/core/strings/src/main/res/values-fr/strings.xml b/core/strings/src/main/res/values-fr/strings.xml index 9b1c16c7..9d3b7737 100644 --- a/core/strings/src/main/res/values-fr/strings.xml +++ b/core/strings/src/main/res/values-fr/strings.xml @@ -199,7 +199,6 @@ Arrêter le lecteur Démarrer le lecteur Éditer - Options de partage Copier Copié Métadonnées diff --git a/core/strings/src/main/res/values-ru/strings.xml b/core/strings/src/main/res/values-ru/strings.xml index 60547153..359e7b27 100644 --- a/core/strings/src/main/res/values-ru/strings.xml +++ b/core/strings/src/main/res/values-ru/strings.xml @@ -204,7 +204,6 @@ Остановить проигрыватель Запустить проигрыватель Редактировать - Параметры обмена Копировать Скопировано Метаданные diff --git a/core/strings/src/main/res/values-tr/strings.xml b/core/strings/src/main/res/values-tr/strings.xml index 418f45d0..616d5493 100644 --- a/core/strings/src/main/res/values-tr/strings.xml +++ b/core/strings/src/main/res/values-tr/strings.xml @@ -204,7 +204,6 @@ Oynatıcıyı durdur Oynatıcıyı başlat Düzenle - Paylaşım seçenekleri Kopyala Kopyalandı Meta veriler diff --git a/core/strings/src/main/res/values/strings.xml b/core/strings/src/main/res/values/strings.xml index 209e1e91..4ded1086 100644 --- a/core/strings/src/main/res/values/strings.xml +++ b/core/strings/src/main/res/values/strings.xml @@ -126,8 +126,9 @@ Web browser not found Can\'t find any application to share Reset - NEW + Mark all as viewed + NEW %s new tracks Filters Favorite status @@ -240,7 +241,6 @@ Stop player Start player Edit - Share options Copy Copied Metadata diff --git a/feature/library/src/main/java/com/mrsep/musicrecognizer/feature/library/presentation/library/LibraryScreen.kt b/feature/library/src/main/java/com/mrsep/musicrecognizer/feature/library/presentation/library/LibraryScreen.kt index ff105a1f..5f3bfd90 100644 --- a/feature/library/src/main/java/com/mrsep/musicrecognizer/feature/library/presentation/library/LibraryScreen.kt +++ b/feature/library/src/main/java/com/mrsep/musicrecognizer/feature/library/presentation/library/LibraryScreen.kt @@ -93,6 +93,7 @@ internal fun LibraryScreen( LaunchedEffect(uiState.trackFilter) { if (newFilterApplied) { lazyGridState.animateScrollToItem(0) + topBarBehaviour.state.contentOffset = 0f newFilterApplied = false } } @@ -111,6 +112,7 @@ internal fun LibraryScreen( LaunchedEffect(uiState.trackFilter) { if (newFilterApplied) { lazyListState.animateScrollToItem(0) + topBarBehaviour.state.contentOffset = 0f newFilterApplied = false } } diff --git a/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceClickableItem.kt b/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceClickableItem.kt index f754a467..d6744190 100644 --- a/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceClickableItem.kt +++ b/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceClickableItem.kt @@ -21,7 +21,7 @@ internal fun PreferenceClickableItem( verticalArrangement = Arrangement.Center, modifier = modifier .fillMaxWidth() - .heightIn(min = 76.dp) + .heightIn(min = 80.dp) .clickable { onItemClick() } .padding(16.dp) .alpha(if (enabled) 1f else 0.7f) diff --git a/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceSwitchItem.kt b/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceSwitchItem.kt index f99b42f1..e6274afb 100644 --- a/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceSwitchItem.kt +++ b/feature/preferences/src/main/java/com/mrsep/musicrecognizer/feature/preferences/presentation/common/PreferenceSwitchItem.kt @@ -23,7 +23,7 @@ internal fun PreferenceSwitchItem( verticalAlignment = Alignment.CenterVertically, modifier = modifier .fillMaxWidth() - .heightIn(min = 76.dp) + .heightIn(min = 80.dp) .clickable( onClick = onClick, enabled = enabled diff --git a/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsScreen.kt b/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsScreen.kt index 6e36bfac..5adb62e6 100644 --- a/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsScreen.kt +++ b/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsScreen.kt @@ -3,6 +3,9 @@ package com.mrsep.musicrecognizer.feature.track.presentation.lyrics import androidx.activity.compose.BackHandler import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.LinearEasing +import androidx.compose.animation.core.Spring +import androidx.compose.animation.core.animate +import androidx.compose.animation.core.spring import androidx.compose.animation.core.tween import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut @@ -238,6 +241,22 @@ internal fun LyricsScreen( } var autoScrollSpeed by rememberSaveable { mutableFloatStateOf(1f) } val scrollInProgress = lyricsScrollState.isScrollInProgress + // Top bar doesn't collapse on manual (auto) scroll, so do it here + LaunchedEffect(autoScrollStarted) { + if (!autoScrollStarted) return@LaunchedEffect + with(topBarBehaviour) { + if (state.collapsedFraction < 0.99f) { + animate( + initialValue = state.heightOffset, + targetValue = state.heightOffsetLimit, + animationSpec = spring(stiffness = Spring.StiffnessMedium) + ) { value, _ -> + state.heightOffset = value + } + state.contentOffset = state.heightOffsetLimit + } + } + } LaunchedEffect( autoScrollStarted, autoScrollSpeed, @@ -247,13 +266,13 @@ internal fun LyricsScreen( if (autoScrollStarted) { val scrollFraction = 1 - lyricsScrollState.value.toFloat() / lyricsScrollState.maxValue - // 3.5 min default, adjust in 1.75..7 min - val scrollDuration = - (210 / autoScrollSpeed * scrollFraction * 1000).toInt() + // 3.5 min default (210 seconds), adjust in 1.75..7 min + val trackDurationMs = uiState.trackDurationMs ?: 210_000 + val scrollDurationMs = trackDurationMs / autoScrollSpeed * scrollFraction lyricsScrollState.animateScrollTo( value = lyricsScrollState.maxValue, animationSpec = tween( - durationMillis = scrollDuration, + durationMillis = scrollDurationMs.toInt(), easing = LinearEasing ) ) diff --git a/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsViewModel.kt b/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsViewModel.kt index 46703838..6c239c24 100644 --- a/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsViewModel.kt +++ b/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/lyrics/LyricsViewModel.kt @@ -40,6 +40,7 @@ internal class LyricsViewModel @Inject constructor( artworkBasedThemeEnabled = preferences.artworkBasedThemeEnabled, themeMode = preferences.themeMode, isTrackViewed = track.isViewed, + trackDurationMs = track.duration?.toMillis()?.toInt() ) } } ?: LyricsUiState.LyricsNotFound @@ -81,6 +82,7 @@ internal sealed class LyricsUiState { val artworkBasedThemeEnabled: Boolean, val themeMode: ThemeMode, val isTrackViewed: Boolean, + val trackDurationMs: Int?, ) : LyricsUiState() } \ No newline at end of file diff --git a/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/track/ShareBottomSheet.kt b/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/track/ShareBottomSheet.kt index f96e2453..6dd66ee4 100644 --- a/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/track/ShareBottomSheet.kt +++ b/feature/track/src/main/java/com/mrsep/musicrecognizer/feature/track/presentation/track/ShareBottomSheet.kt @@ -59,7 +59,7 @@ internal fun ShareBottomSheet( yearSelected || selectedMusicServices.isNotEmpty() || lyricsSelected Text( - text = stringResource(StringsR.string.share_options), + text = stringResource(StringsR.string.share), style = MaterialTheme.typography.titleLarge, modifier = Modifier.align(Alignment.CenterHorizontally) )