From 8ede4eb3d605b40b7b06d984885a74f54b632e6b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 6 Sep 2024 17:29:06 -0400 Subject: [PATCH] Updates navigation compose, lifecycle, fragment, activity and composeBoms --- .../amethyst/ui/components/ClickableBox.kt | 7 +++---- .../amethyst/ui/navigation/AppBottomBar.kt | 5 ++++- .../com/vitorpamplona/amethyst/ui/note/PollNote.kt | 4 ++-- .../com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt | 5 ++--- .../com/vitorpamplona/amethyst/ui/note/RelayListRow.kt | 4 ++++ .../amethyst/ui/screen/loggedIn/video/VideoScreen.kt | 2 +- .../java/com/vitorpamplona/amethyst/ui/theme/Shape.kt | 3 +++ gradle/libs.versions.toml | 10 +++++----- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableBox.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableBox.kt index b8e522911..f1400a132 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableBox.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableBox.kt @@ -25,13 +25,12 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box -import androidx.compose.material.ripple.rememberRipple import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.semantics.Role -import com.vitorpamplona.amethyst.ui.theme.Size24dp +import com.vitorpamplona.amethyst.ui.theme.ripple24dp @Composable fun ClickableBox( @@ -43,7 +42,7 @@ fun ClickableBox( modifier.clickable( role = Role.Button, interactionSource = remember { MutableInteractionSource() }, - indication = rememberRipple(bounded = false, radius = Size24dp), + indication = ripple24dp, onClick = onClick, ), contentAlignment = Alignment.Center, @@ -64,7 +63,7 @@ fun ClickableBox( modifier.combinedClickable( role = Role.Button, interactionSource = remember { MutableInteractionSource() }, - indication = rememberRipple(bounded = false, radius = Size24dp), + indication = ripple24dp, onClick = onClick, onLongClick = onLongClick, ), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt index 5157a598d..a0327460c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt @@ -141,7 +141,10 @@ private fun RenderBottomMenu( HorizontalDivider( thickness = DividerThickness, ) - NavigationBar(tonalElevation = Size0dp) { + NavigationBar( + containerColor = MaterialTheme.colorScheme.background, + tonalElevation = Size0dp, + ) { bottomNavigationItems.forEach { item -> HasNewItemsIcon(item == selectedRoute, item, accountViewModel, nav) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/PollNote.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/PollNote.kt index a6200c359..21ddc9e02 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/PollNote.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/PollNote.kt @@ -38,7 +38,6 @@ import androidx.compose.foundation.layout.width import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Bolt import androidx.compose.material.icons.outlined.Bolt -import androidx.compose.material.ripple.rememberRipple import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.CircularProgressIndicator @@ -85,6 +84,7 @@ import com.vitorpamplona.amethyst.ui.theme.Font14SP import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.mediumImportanceLink import com.vitorpamplona.amethyst.ui.theme.placeholderText +import com.vitorpamplona.amethyst.ui.theme.ripple24dp import com.vitorpamplona.quartz.events.EmptyTagList import com.vitorpamplona.quartz.events.ImmutableListOfLists import com.vitorpamplona.quartz.events.toImmutableListOfLists @@ -357,7 +357,7 @@ fun ZapVote( Modifier.combinedClickable( role = Role.Button, interactionSource = remember { MutableInteractionSource() }, - indication = rememberRipple(bounded = false, radius = 24.dp), + indication = ripple24dp, onClick = { if (!accountViewModel.isWriteable()) { accountViewModel.toast( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index 340fd5a07..d49eb73d5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -48,7 +48,6 @@ 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.material.ripple.rememberRipple import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.CardDefaults @@ -129,7 +128,6 @@ import com.vitorpamplona.amethyst.ui.theme.Size19Modifier import com.vitorpamplona.amethyst.ui.theme.Size20Modifier import com.vitorpamplona.amethyst.ui.theme.Size20dp import com.vitorpamplona.amethyst.ui.theme.Size22Modifier -import com.vitorpamplona.amethyst.ui.theme.Size24dp import com.vitorpamplona.amethyst.ui.theme.Size28Modifier import com.vitorpamplona.amethyst.ui.theme.SmallBorder import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonColumn @@ -137,6 +135,7 @@ import com.vitorpamplona.amethyst.ui.theme.TinyBorders import com.vitorpamplona.amethyst.ui.theme.mediumImportanceLink import com.vitorpamplona.amethyst.ui.theme.placeholderText import com.vitorpamplona.amethyst.ui.theme.reactionBox +import com.vitorpamplona.amethyst.ui.theme.ripple24dp import com.vitorpamplona.amethyst.ui.theme.selectedReactionBoxModifier import com.vitorpamplona.quartz.encoders.Nip30CustomEmoji import com.vitorpamplona.quartz.events.BaseTextNoteEvent @@ -1008,7 +1007,7 @@ fun ZapReaction( iconSizeModifier.combinedClickable( role = Role.Button, interactionSource = remember { MutableInteractionSource() }, - indication = rememberRipple(bounded = false, radius = Size24dp), + indication = ripple24dp, onClick = { zapClick( baseNote, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListRow.kt index dedbd61ca..56100bb34 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListRow.kt @@ -23,6 +23,7 @@ package com.vitorpamplona.amethyst.ui.note import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.combinedClickable +import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding @@ -65,6 +66,7 @@ import com.vitorpamplona.amethyst.ui.theme.Size17dp import com.vitorpamplona.amethyst.ui.theme.StdStartPadding import com.vitorpamplona.amethyst.ui.theme.placeholderText import com.vitorpamplona.amethyst.ui.theme.relayIconModifier +import com.vitorpamplona.amethyst.ui.theme.ripple24dp import com.vitorpamplona.ammolite.relays.RelayBriefInfoCache @Composable @@ -154,6 +156,8 @@ fun RenderRelay( Modifier .size(Size17dp) .combinedClickable( + indication = ripple24dp, + interactionSource = MutableInteractionSource(), onLongClick = { clipboardManager.setText(AnnotatedString(relay.url)) }, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt index a9ad3ae2e..ea2d0f342 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt @@ -258,7 +258,7 @@ fun SlidingCarousel( VerticalPager( state = pagerState, - beyondBoundsPageCount = 1, + beyondViewportPageCount = 1, modifier = Modifier.fillMaxSize(), key = { index -> items.list.getOrNull(index)?.idHex ?: "$index" }, ) { index -> diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt index ff1844eab..705165b83 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt @@ -34,6 +34,7 @@ import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Shapes +import androidx.compose.material3.ripple import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color @@ -284,3 +285,5 @@ val reactionBox = .padding(horizontal = 6.dp, vertical = 6.dp) .size(Size40dp) .padding(5.dp) + +val ripple24dp = ripple(bounded = false, radius = Size24dp) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 913f78a3e..f50fd11a8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] accompanistAdaptive = "0.34.0" -activityCompose = "1.9.1" +activityCompose = "1.9.2" agp = "8.6.0" android-compileSdk = "34" android-minSdk = "26" @@ -14,11 +14,11 @@ benchmarkJunit4 = "1.3.0" biometricKtx = "1.2.0-alpha05" blurhash = "1.0.0" coil = "2.7.0" -composeBom = "2024.08.00" +composeBom = "2024.09.00" coreKtx = "1.13.1" espressoCore = "3.6.1" firebaseBom = "33.2.0" -fragmentKtx = "1.8.2" +fragmentKtx = "1.8.3" gms = "4.4.2" jacksonModuleKotlin = "2.17.2" jna = "5.14.0" @@ -29,12 +29,12 @@ kotlinxSerialization = "1.7.2" kotlinxSerializationPlugin = "2.0.0" languageId = "17.0.6" lazysodiumAndroid = "5.1.0" -lifecycleRuntimeKtx = "2.8.4" +lifecycleRuntimeKtx = "2.8.5" lightcompressor = "1.3.2" markdown = "077a2cde64" media3 = "1.4.1" mockk = "1.13.12" -navigationCompose = "2.7.7" +navigationCompose = "2.8.0" okhttp = "5.0.0-alpha.14" runner = "1.6.2" rfc3986 = "0.1.0"