diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt index b1557de3a..30d7e9a14 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt @@ -85,6 +85,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.hashtag.HashtagPostScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.hashtag.HashtagScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.home.HomeScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.home.ShortNotePostScreen +import com.vitorpamplona.amethyst.ui.screen.loggedIn.home.VoiceReplyScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.display.lists.PeopleListScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.display.packs.FollowPackScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.list.ListOfPeopleListsScreen @@ -289,6 +290,18 @@ fun AppNavigation( nav = nav, ) } + + composableFromBottomArgs { + VoiceReplyScreen( + replyToNoteId = it.replyToNoteId, + recordingFilePath = it.recordingFilePath, + mimeType = it.mimeType, + duration = it.duration, + amplitudesJson = it.amplitudes, + accountViewModel = accountViewModel, + nav = nav, + ) + } } } 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 716d0191f..7a1e53541 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 @@ -169,6 +169,7 @@ import kotlinx.collections.immutable.toImmutableSet import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlinx.serialization.json.Json import kotlin.math.roundToInt import kotlin.uuid.ExperimentalUuidApi import kotlin.uuid.Uuid @@ -585,7 +586,7 @@ private fun ReplyReactionWithDialog( nav: INav, ) { if (baseNote.event is BaseVoiceEvent) { - ReplyViaVoiceReaction(baseNote, grayTint, accountViewModel) + ReplyViaVoiceReaction(baseNote, grayTint, accountViewModel, nav) } else { ReplyReaction(baseNote, grayTint, accountViewModel) { nav.nav { routeReplyTo(baseNote, accountViewModel.account) } @@ -599,15 +600,22 @@ fun ReplyViaVoiceReaction( baseNote: Note, grayTint: Color, accountViewModel: AccountViewModel, + nav: INav, showCounter: Boolean = true, iconSizeModifier: Modifier = Size19Modifier, ) { - val context = LocalContext.current - RecordAudioBox( modifier = iconSizeModifier, onRecordTaken = { audio -> - accountViewModel.sendVoiceReply(baseNote, audio, context) + nav.nav { + Route.VoiceReply( + replyToNoteId = baseNote.idHex, + recordingFilePath = audio.file.absolutePath, + mimeType = audio.mimeType, + duration = audio.duration, + amplitudes = Json.encodeToString(audio.amplitudes), + ) + } }, ) { _, _ -> VoiceReplyIcon(iconSizeModifier, grayTint)