From fbbc35289c0b7b3c937d373d14b8c68bfd8a15b3 Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 13:36:30 +0100 Subject: [PATCH 1/9] wip --- app/build.gradle.kts | 1 + .../composables/MiniPlayerComposable.kt | 196 ++++++++++++------ 2 files changed, 132 insertions(+), 65 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 19bdfeaf..ec93524e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -117,6 +117,7 @@ dependencies { implementation(libs.androidx.glance) implementation(libs.androidx.glance.appwidget) implementation (libs.androidx.glance.material3) + implementation (libs.androidx.navigation.compose) implementation(libs.acra.core) implementation(libs.acra.http) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index c1e2890b..03c81a67 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -6,17 +6,29 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.DismissValue.Default +import androidx.compose.material.DismissValue.DismissedToEnd +import androidx.compose.material.DismissValue.DismissedToStart +import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material.SwipeToDismiss import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.PlayArrow +import androidx.compose.material.icons.outlined.Close import androidx.compose.material.icons.outlined.Pause +import androidx.compose.material.rememberDismissState import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.MaterialTheme.colorScheme +import androidx.compose.material3.MaterialTheme.typography import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -40,6 +52,7 @@ import org.grakovne.lissen.ui.components.AsyncShimmeringImage import org.grakovne.lissen.ui.navigation.AppNavigationService import org.grakovne.lissen.viewmodel.PlayerViewModel +@OptIn(ExperimentalMaterialApi::class) @Composable fun MiniPlayerComposable( navController: AppNavigationService, @@ -50,80 +63,133 @@ fun MiniPlayerComposable( ) { val isPlaying: Boolean by playerViewModel.isPlaying.observeAsState(false) - Surface( - shadowElevation = 4.dp, - modifier = modifier.clickable { navController.showPlayer(book.id, book.title) }, + val dismissState = rememberDismissState( + confirmStateChange = { dismissValue -> + when (dismissValue) { + DismissedToEnd, DismissedToStart -> { + playerViewModel.clearPlayingBook() + true + } + + Default -> false + } + }, + ) + SwipeToDismiss( + state = dismissState, + background = { + Row( + modifier = Modifier + .fillMaxSize() + .padding(horizontal = 12.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically, + ) { + CloseActionBackground() // left Side + CloseActionBackground() // Right Side + } + }, ) { - Row( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 20.dp, vertical = 8.dp), - verticalAlignment = Alignment.CenterVertically, + Surface( + shadowElevation = 4.dp, + modifier = modifier.clickable { navController.showPlayer(book.id, book.title) }, ) { - val context = LocalContext.current - val imageRequest = remember(book.id) { - ImageRequest.Builder(context) - .data(book.id) - .size(coil.size.Size.ORIGINAL) - .build() - } - - AsyncShimmeringImage( - imageRequest = imageRequest, - imageLoader = imageLoader, - contentDescription = "${book.title} cover", - contentScale = ContentScale.FillBounds, + Row( modifier = Modifier - .size(48.dp) - .aspectRatio(1f) - .clip(RoundedCornerShape(4.dp)), - error = painterResource(R.drawable.cover_fallback), - ) - - Spacer(modifier = Modifier.width(16.dp)) - - Column( - modifier = Modifier.weight(1f), + .fillMaxWidth() + .padding(horizontal = 20.dp, vertical = 8.dp), + verticalAlignment = Alignment.CenterVertically, ) { - Text( - text = book.title, - style = MaterialTheme.typography.bodyMedium.copy( - fontWeight = FontWeight.SemiBold, - color = MaterialTheme.colorScheme.onBackground, - ), - maxLines = 2, - overflow = TextOverflow.Ellipsis, + val context = LocalContext.current + val imageRequest = remember(book.id) { + ImageRequest.Builder(context) + .data(book.id) + .size(coil.size.Size.ORIGINAL) + .build() + } + + AsyncShimmeringImage( + imageRequest = imageRequest, + imageLoader = imageLoader, + contentDescription = "${book.title} cover", + contentScale = ContentScale.FillBounds, + modifier = Modifier + .size(48.dp) + .aspectRatio(1f) + .clip(RoundedCornerShape(4.dp)), + error = painterResource(R.drawable.cover_fallback), ) - book - .author - ?.let { - Text( - text = it, - style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.6f), - ), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - } - } - Column( - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center, - ) { - Row { - IconButton( - onClick = { playerViewModel.togglePlayPause() }, - ) { - Icon( - imageVector = if (isPlaying) Icons.Outlined.Pause else Icons.Filled.PlayArrow, - contentDescription = if (isPlaying) "Pause" else "Play", - modifier = Modifier.size(36.dp), - ) + Spacer(modifier = Modifier.width(16.dp)) + + Column( + modifier = Modifier.weight(1f), + ) { + Text( + text = book.title, + style = MaterialTheme.typography.bodyMedium.copy( + fontWeight = FontWeight.SemiBold, + color = MaterialTheme.colorScheme.onBackground, + ), + maxLines = 2, + overflow = TextOverflow.Ellipsis, + ) + book + .author + ?.let { + Text( + text = it, + style = typography.bodyMedium.copy( + color = colorScheme.onBackground.copy(alpha = 0.6f), + ), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } + } + + Column( + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, + ) { + Row { + IconButton( + onClick = { playerViewModel.togglePlayPause() }, + ) { + Icon( + imageVector = if (isPlaying) Icons.Outlined.Pause else Icons.Filled.PlayArrow, + contentDescription = if (isPlaying) "Pause" else "Play", + modifier = Modifier.size(36.dp), + ) + } } } } } } } + +@Composable +fun CloseActionBackground() { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier + .width(80.dp) + .padding(vertical = 8.dp), + ) { + Icon( + imageVector = Icons.Outlined.Close, + contentDescription = "Close", + tint = colorScheme.onSurface, + modifier = Modifier.size(24.dp), + ) + + Spacer(modifier = Modifier.height(4.dp)) + + Text( + text = "Close", + style = typography.labelSmall, + color = colorScheme.onSurface, + ) + } +} From 00ac450c8d908c4133c920c07c377e58fb738d4e Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 13:44:54 +0100 Subject: [PATCH 2/9] wip --- .../ui/screens/library/composables/MiniPlayerComposable.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index 03c81a67..69969ab1 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -17,6 +17,7 @@ import androidx.compose.material.DismissValue.Default import androidx.compose.material.DismissValue.DismissedToEnd import androidx.compose.material.DismissValue.DismissedToStart import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material.FractionalThreshold import androidx.compose.material.SwipeToDismiss import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Close @@ -40,6 +41,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow @@ -61,6 +63,7 @@ fun MiniPlayerComposable( imageLoader: ImageLoader, playerViewModel: PlayerViewModel, ) { + val density = LocalDensity.current val isPlaying: Boolean by playerViewModel.isPlaying.observeAsState(false) val dismissState = rememberDismissState( @@ -75,8 +78,10 @@ fun MiniPlayerComposable( } }, ) + SwipeToDismiss( state = dismissState, + dismissThresholds = { FractionalThreshold(0.5f) }, background = { Row( modifier = Modifier From bdee8aecb562465c2244e3e6c625059be25eed8f Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 13:52:15 +0100 Subject: [PATCH 3/9] wip --- .../composables/MiniPlayerComposable.kt | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index 69969ab1..13be2655 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -31,7 +31,10 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme.colorScheme import androidx.compose.material3.MaterialTheme.typography import androidx.compose.material3.Surface +import androidx.compose.material3.SwipeToDismissBox +import androidx.compose.material3.SwipeToDismissBoxValue import androidx.compose.material3.Text +import androidx.compose.material3.rememberSwipeToDismissBoxState import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.livedata.observeAsState @@ -54,7 +57,6 @@ import org.grakovne.lissen.ui.components.AsyncShimmeringImage import org.grakovne.lissen.ui.navigation.AppNavigationService import org.grakovne.lissen.viewmodel.PlayerViewModel -@OptIn(ExperimentalMaterialApi::class) @Composable fun MiniPlayerComposable( navController: AppNavigationService, @@ -63,26 +65,26 @@ fun MiniPlayerComposable( imageLoader: ImageLoader, playerViewModel: PlayerViewModel, ) { - val density = LocalDensity.current val isPlaying: Boolean by playerViewModel.isPlaying.observeAsState(false) - val dismissState = rememberDismissState( - confirmStateChange = { dismissValue -> - when (dismissValue) { - DismissedToEnd, DismissedToStart -> { + val dismissState = rememberSwipeToDismissBoxState( + positionalThreshold = { it * 0.5f }, + confirmValueChange = { newValue: SwipeToDismissBoxValue -> + when (newValue) { + SwipeToDismissBoxValue.EndToStart, + SwipeToDismissBoxValue.StartToEnd -> { playerViewModel.clearPlayingBook() true } - Default -> false + else -> false } - }, + } ) - SwipeToDismiss( + SwipeToDismissBox( state = dismissState, - dismissThresholds = { FractionalThreshold(0.5f) }, - background = { + backgroundContent = { Row( modifier = Modifier .fillMaxSize() @@ -90,8 +92,8 @@ fun MiniPlayerComposable( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { - CloseActionBackground() // left Side - CloseActionBackground() // Right Side + CloseActionBackground() // Левая сторона + CloseActionBackground() // Правая сторона } }, ) { From c5cac6f51ff619ecdb28e602bcd91fc44d144ea7 Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 13:52:31 +0100 Subject: [PATCH 4/9] wip --- .../ui/screens/library/composables/MiniPlayerComposable.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index 13be2655..253236d8 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -92,8 +92,8 @@ fun MiniPlayerComposable( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { - CloseActionBackground() // Левая сторона - CloseActionBackground() // Правая сторона + CloseActionBackground() // left side + CloseActionBackground() // right side } }, ) { From cfe822ac1ddb9eacd15685da799f1943d6a5b44f Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 16:20:48 +0100 Subject: [PATCH 5/9] wip --- .../composables/MiniPlayerComposable.kt | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index 253236d8..aa5617d7 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -13,21 +13,13 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.DismissValue.Default -import androidx.compose.material.DismissValue.DismissedToEnd -import androidx.compose.material.DismissValue.DismissedToStart -import androidx.compose.material.ExperimentalMaterialApi -import androidx.compose.material.FractionalThreshold -import androidx.compose.material.SwipeToDismiss import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.PlayArrow import androidx.compose.material.icons.outlined.Close import androidx.compose.material.icons.outlined.Pause -import androidx.compose.material.rememberDismissState import androidx.compose.material3.Icon import androidx.compose.material3.IconButton -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme.colorScheme import androidx.compose.material3.MaterialTheme.typography import androidx.compose.material3.Surface @@ -39,12 +31,12 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.livedata.observeAsState import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow @@ -72,14 +64,15 @@ fun MiniPlayerComposable( confirmValueChange = { newValue: SwipeToDismissBoxValue -> when (newValue) { SwipeToDismissBoxValue.EndToStart, - SwipeToDismissBoxValue.StartToEnd -> { + SwipeToDismissBoxValue.StartToEnd, + -> { playerViewModel.clearPlayingBook() true } else -> false } - } + }, ) SwipeToDismissBox( @@ -134,9 +127,9 @@ fun MiniPlayerComposable( ) { Text( text = book.title, - style = MaterialTheme.typography.bodyMedium.copy( + style = typography.bodyMedium.copy( fontWeight = FontWeight.SemiBold, - color = MaterialTheme.colorScheme.onBackground, + color = colorScheme.onBackground, ), maxLines = 2, overflow = TextOverflow.Ellipsis, From bdee5e1739bcc8f93e03f7e9e58538584d381827 Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 18:12:51 +0100 Subject: [PATCH 6/9] wip --- .../ui/screens/library/LibraryScreen.kt | 15 +++--- .../composables/MiniPlayerComposable.kt | 47 ++++++++++++++----- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/LibraryScreen.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/LibraryScreen.kt index 752f8e82..9980428e 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/LibraryScreen.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/LibraryScreen.kt @@ -25,6 +25,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme.colorScheme import androidx.compose.material3.Scaffold +import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable @@ -235,12 +236,14 @@ fun LibraryScreen( }, bottomBar = { playingBook?.let { - MiniPlayerComposable( - navController = navController, - book = it, - imageLoader = imageLoader, - playerViewModel = playerViewModel, - ) + Surface(shadowElevation = 4.dp) { + MiniPlayerComposable( + navController = navController, + book = it, + imageLoader = imageLoader, + playerViewModel = playerViewModel, + ) + } } }, modifier = Modifier diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index aa5617d7..7f95bd70 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -1,5 +1,10 @@ package org.grakovne.lissen.ui.screens.library.composables +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.core.tween +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -14,7 +19,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.PlayArrow import androidx.compose.material.icons.outlined.Close import androidx.compose.material.icons.outlined.Pause @@ -22,14 +26,15 @@ import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme.colorScheme import androidx.compose.material3.MaterialTheme.typography -import androidx.compose.material3.Surface import androidx.compose.material3.SwipeToDismissBox import androidx.compose.material3.SwipeToDismissBoxValue import androidx.compose.material3.Text import androidx.compose.material3.rememberSwipeToDismissBoxState import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.livedata.observeAsState +import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment @@ -52,21 +57,21 @@ import org.grakovne.lissen.viewmodel.PlayerViewModel @Composable fun MiniPlayerComposable( navController: AppNavigationService, - modifier: Modifier = Modifier, book: DetailedItem, imageLoader: ImageLoader, playerViewModel: PlayerViewModel, ) { val isPlaying: Boolean by playerViewModel.isPlaying.observeAsState(false) + var backgroundVisible by remember { mutableStateOf(true) } val dismissState = rememberSwipeToDismissBoxState( - positionalThreshold = { it * 0.5f }, + positionalThreshold = { it * 0.2f }, confirmValueChange = { newValue: SwipeToDismissBoxValue -> when (newValue) { SwipeToDismissBoxValue.EndToStart, SwipeToDismissBoxValue.StartToEnd, -> { - playerViewModel.clearPlayingBook() + backgroundVisible = false true } @@ -75,6 +80,14 @@ fun MiniPlayerComposable( }, ) + LaunchedEffect(dismissState.currentValue) { + if (dismissState.currentValue == SwipeToDismissBoxValue.StartToEnd || + dismissState.currentValue == SwipeToDismissBoxValue.EndToStart + ) { + playerViewModel.clearPlayingBook() + } + } + SwipeToDismissBox( state = dismissState, backgroundContent = { @@ -82,21 +95,33 @@ fun MiniPlayerComposable( modifier = Modifier .fillMaxSize() .padding(horizontal = 12.dp), - horizontalArrangement = Arrangement.SpaceBetween, + horizontalArrangement = when (dismissState.targetValue) { + SwipeToDismissBoxValue.StartToEnd -> Arrangement.Start + SwipeToDismissBoxValue.EndToStart -> Arrangement.End + SwipeToDismissBoxValue.Settled -> Arrangement.Center + }, verticalAlignment = Alignment.CenterVertically, ) { - CloseActionBackground() // left side - CloseActionBackground() // right side + AnimatedVisibility( + visible = backgroundVisible, + enter = fadeIn(animationSpec = tween(300)), + exit = fadeOut(animationSpec = tween(300)), + ) { + CloseActionBackground() + } } }, ) { - Surface( - shadowElevation = 4.dp, - modifier = modifier.clickable { navController.showPlayer(book.id, book.title) }, + AnimatedVisibility( + visible = backgroundVisible, + enter = fadeIn(animationSpec = tween(300)), + exit = fadeOut(animationSpec = tween(300)), ) { Row( modifier = Modifier .fillMaxWidth() + .background(colorScheme.background) + .clickable { navController.showPlayer(book.id, book.title) } .padding(horizontal = 20.dp, vertical = 8.dp), verticalAlignment = Alignment.CenterVertically, ) { From 948e2db1c65a6912ed16094b78b4b4973ee55f00 Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 18:33:12 +0100 Subject: [PATCH 7/9] wip --- .../ui/screens/library/composables/MiniPlayerComposable.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index 7f95bd70..9b2c54b4 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -81,9 +81,7 @@ fun MiniPlayerComposable( ) LaunchedEffect(dismissState.currentValue) { - if (dismissState.currentValue == SwipeToDismissBoxValue.StartToEnd || - dismissState.currentValue == SwipeToDismissBoxValue.EndToStart - ) { + if (dismissState.currentValue != SwipeToDismissBoxValue.Settled) { playerViewModel.clearPlayingBook() } } @@ -104,7 +102,6 @@ fun MiniPlayerComposable( ) { AnimatedVisibility( visible = backgroundVisible, - enter = fadeIn(animationSpec = tween(300)), exit = fadeOut(animationSpec = tween(300)), ) { CloseActionBackground() @@ -114,7 +111,6 @@ fun MiniPlayerComposable( ) { AnimatedVisibility( visible = backgroundVisible, - enter = fadeIn(animationSpec = tween(300)), exit = fadeOut(animationSpec = tween(300)), ) { Row( From 0e8d020b9b98b2a3c51a585f7a57f49d50709c08 Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 18:34:29 +0100 Subject: [PATCH 8/9] wip --- app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ec93524e..2a9e9399 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -25,8 +25,8 @@ android { applicationId = "org.grakovne.lissen" minSdk = 28 targetSdk = 35 - versionCode = 45 - versionName = "1.1.14" + versionCode = 46 + versionName = "1.1.15" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { From fe1b935313f6d257429bf3548fa38ec1eafe2597 Mon Sep 17 00:00:00 2001 From: grakovne Date: Mon, 2 Dec 2024 18:45:47 +0100 Subject: [PATCH 9/9] wip --- app/build.gradle.kts | 1 - .../ui/screens/library/composables/MiniPlayerComposable.kt | 1 - gradle/libs.versions.toml | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2a9e9399..8dde2894 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -117,7 +117,6 @@ dependencies { implementation(libs.androidx.glance) implementation(libs.androidx.glance.appwidget) implementation (libs.androidx.glance.material3) - implementation (libs.androidx.navigation.compose) implementation(libs.acra.core) implementation(libs.acra.http) diff --git a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt index 9b2c54b4..f8ca1af6 100644 --- a/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt +++ b/app/src/main/java/org/grakovne/lissen/ui/screens/library/composables/MiniPlayerComposable.kt @@ -2,7 +2,6 @@ package org.grakovne.lissen.ui.screens.library.composables import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.tween -import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.background import androidx.compose.foundation.clickable diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bda4f045..69479a73 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ loggingInterceptor = "4.11.0" material = "1.7.5" material3 = "1.3.1" materialVersion = "1.12.0" -media3Exoplayer = "1.4.1" +media3Exoplayer = "1.5.0" navigationCompose = "2.8.4" okhttp = "4.12.0" pagingCompose = "3.3.4" @@ -31,8 +31,8 @@ retrofit = "2.9.0" roomRuntime = "2.6.1" rules = "1.6.1" runtimeLivedata = "1.7.5" -media3Session = "1.4.1" -media3DatasourceOkhttp = "1.4.1" +media3Session = "1.5.0" +media3DatasourceOkhttp = "1.5.0" [libraries] accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanistSystemuicontroller" }