diff --git a/composeApp/src/commonMain/composeResources/drawable/plugin_logo_newpipe.png b/composeApp/src/commonMain/composeResources/drawable/plugin_logo_newpipe.png new file mode 100644 index 00000000..3bcf0799 Binary files /dev/null and b/composeApp/src/commonMain/composeResources/drawable/plugin_logo_newpipe.png differ diff --git a/composeApp/src/commonMain/composeResources/drawable/plugin_logo_newpipe.svg b/composeApp/src/commonMain/composeResources/drawable/plugin_logo_newpipe.svg deleted file mode 100644 index 7cb4554d..00000000 --- a/composeApp/src/commonMain/composeResources/drawable/plugin_logo_newpipe.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/webview/PlatformWebviewScreen.kt b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/webview/PlatformWebviewScreen.kt index d166f722..583ba6e2 100644 --- a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/webview/PlatformWebviewScreen.kt +++ b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/webview/PlatformWebviewScreen.kt @@ -32,7 +32,6 @@ 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.statusBarsPadding import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicTextField @@ -156,7 +155,7 @@ fun PlatformWebViewScreen(webViewController: WebViewController) { ApplicationMainBar( title = { Row( - modifier = Modifier.fillMaxWidth().statusBarsPadding().height(56.dp), + modifier = Modifier.fillMaxWidth().height(56.dp), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { @@ -227,4 +226,4 @@ fun PlatformWebViewScreen(webViewController: WebViewController) { navigator.evaluateJavaScript(bridgeBootstrapScript) }) } -} \ No newline at end of file +} diff --git a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShell.kt b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShell.kt index bdd89d61..f5c9e948 100644 --- a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShell.kt +++ b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShell.kt @@ -30,7 +30,6 @@ import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.navigationBars -import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider @@ -128,7 +127,11 @@ fun AppShell( Box(modifier = Modifier.fillMaxSize()) { val useSidebar = viewModel.useSidebar() - val bottomOverlayInset = viewModel.bottomOverlayInset(useSidebar) + val density = LocalDensity.current + val navigationBarInset = with(density) { + WindowInsets.navigationBars.getBottom(this).toDp() + } + val bottomOverlayInset = viewModel.bottomOverlayInset(useSidebar) + navigationBarInset CompositionLocalProvider(LocalAppShellBottomInset provides bottomOverlayInset) { if (useSidebar) { @@ -278,7 +281,9 @@ private fun CompactPlayerOverlay( val floatingPlayerHeightPx = with(density) { viewModel.floatingPlayerHeight.toPx() } val bottomBarHeightPx = with(density) { viewModel.bottomBarHeight.toPx() } val navBarInsetPx = WindowInsets.navigationBars.getBottom(density).toFloat() - val peekHeightPx = floatingPlayerHeightPx + bottomBarHeightPx + navBarInsetPx + val playerBarSpacingPx = with(density) { viewModel.floatingPlayerSpacing.toPx() } + val peekHeightPx = + floatingPlayerHeightPx + bottomBarHeightPx + navBarInsetPx + playerBarSpacingPx val peekHeight = with(density) { peekHeightPx.toDp() } val partialDetent = remember(peekHeight) { @@ -318,7 +323,6 @@ private fun CompactPlayerOverlay( Column(modifier = Modifier.fillMaxWidth()) { AppFloatingPlayer( modifier = Modifier - .offset(y = 12.dp) .graphicsLayer { alpha = uiState.floatingPlayerAlpha }) @@ -332,9 +336,12 @@ private fun CompactPlayerOverlay( AppBottombar( navigator = navigator, navigationState = navigationState, - modifier = Modifier.fillMaxWidth().align(Alignment.BottomCenter).graphicsLayer { - alpha = uiState.floatingPlayerAlpha - }) + modifier = Modifier + .fillMaxWidth() + .align(Alignment.BottomCenter) + .graphicsLayer { + alpha = uiState.floatingPlayerAlpha + }) } } } diff --git a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShellViewModel.kt b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShellViewModel.kt index 1e8fd536..768f44c1 100644 --- a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShellViewModel.kt +++ b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/AppShellViewModel.kt @@ -42,9 +42,9 @@ data class LyricsOverlayState( class AppShellViewModel : ViewModel() { val sidebarMinWidth = 840.dp - val bottomBarEstimatedHeight = 58.dp val bottomBarHeight = 80.dp - val floatingPlayerHeight = 74.dp + val floatingPlayerHeight = 76.dp + val floatingPlayerSpacing = 12.dp val largePlayerInset = 100.dp val floatingPlayerDismissProgress = 0.7f val expandedPlayerVisibilityThreshold = 0.001f @@ -53,11 +53,8 @@ class AppShellViewModel : ViewModel() { val isLyricsOverlayVisible: StateFlow = lyricsOverlayVisible.asStateFlow() - val floatingPlayerBottomOffset: Dp - get() = bottomBarEstimatedHeight + 8.dp - val compactChromeInset: Dp - get() = floatingPlayerBottomOffset + floatingPlayerHeight + 10.dp + get() = bottomBarHeight + floatingPlayerHeight + floatingPlayerSpacing @Composable fun useSidebar(maxWidth: Dp? = null): Boolean { diff --git a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/player_queue/QueueSheet.kt b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/player_queue/QueueSheet.kt index 6175b72a..207bec37 100644 --- a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/player_queue/QueueSheet.kt +++ b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/shell/player_queue/QueueSheet.kt @@ -34,6 +34,9 @@ import org.spotube.millennium.composables.MillenniumModalBottomSheet import org.spotube.millennium.composables.rememberMillenniumDrawerState private val SlidingSheetBreakpoint = 840.dp +private val MaxHeightSheetDetent = SheetDetent("max-height-85-percent") { containerHeight, sheetHeight -> + minOf(sheetHeight, containerHeight * 0.85f) +} @Composable fun QueueSheet( @@ -85,7 +88,10 @@ internal fun BottomSheetContent( content: @Composable () -> Unit ) { if (!isVisible) return - val sheetState = rememberModalBottomSheetState(initialDetent = SheetDetent.FullyExpanded) + val sheetState = rememberModalBottomSheetState( + initialDetent = MaxHeightSheetDetent, + detents = listOf(SheetDetent.Hidden, MaxHeightSheetDetent) + ) LaunchedEffect(sheetState.bottomSheetState.currentDetent) { if (sheetState.bottomSheetState.currentDetent == SheetDetent.Hidden) { onDismiss() diff --git a/composeApp/src/mobileMain/kotlin/dev/krtirtho/spotube/core/ui/component/ApplicationMainBar.mobile.kt b/composeApp/src/mobileMain/kotlin/dev/krtirtho/spotube/core/ui/component/ApplicationMainBar.mobile.kt index fd455041..b60bd16c 100644 --- a/composeApp/src/mobileMain/kotlin/dev/krtirtho/spotube/core/ui/component/ApplicationMainBar.mobile.kt +++ b/composeApp/src/mobileMain/kotlin/dev/krtirtho/spotube/core/ui/component/ApplicationMainBar.mobile.kt @@ -18,6 +18,8 @@ package dev.krtirtho.spotube.core.ui.component import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.statusBars import org.spotube.millennium.composables.MillenniumTopAppBar import androidx.compose.ui.graphics.Color import androidx.compose.runtime.Composable @@ -33,10 +35,11 @@ actual fun ApplicationMainBar( title = title, subtitle = subtitle, actions = actions, + windowInsets = WindowInsets.statusBars, navigationIcon = { if (backButton) { ApplicationBackButton() } } ) -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index b96a5a61..e2904b99 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,4 +27,8 @@ org.gradle.caching=true #Android android.nonTransitiveRClass=true -android.useAndroidX=true \ No newline at end of file +android.useAndroidX=true +# Preserve compatibility with this project's current Kotlin Multiplatform Android setup on AGP 9. +android.builtInKotlin=false +android.newDsl=false +android.sourceset.disallowProvider=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index efeac1e2..24df3449 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ # along with this program. If not, see . [versions] -agp = "8.13.2" +agp = "9.1.0" android-compileSdk = "37" android-minSdk = "28" android-targetSdk = "36" @@ -193,4 +193,4 @@ uniffi = { id = "dev.gobley.uniffi", version.ref = "uniffi" } cargo = { id = "dev.gobley.cargo", version.ref = "uniffi" } mokkery = { id = "dev.mokkery", version.ref = "mokkery" } vanniktechMavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktechMavenPublish" } -neucleusFramework = { id = "dev.nucleusframework", version.ref = "nucleusNucleusApplication" } \ No newline at end of file +neucleusFramework = { id = "dev.nucleusframework", version.ref = "nucleusNucleusApplication" }