diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/DebugUtils.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/DebugUtils.kt index 2b04f99f2d..a5f949e5a5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/DebugUtils.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/DebugUtils.kt @@ -164,7 +164,7 @@ inline fun logTime( block() } -inline fun debug( +fun debug( tag: String, debugMessage: String, ) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 7fcb11a90a..5c203f20de 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -181,6 +181,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow @@ -1086,6 +1087,7 @@ class Account( ) } + @OptIn(FlowPreview::class) val decryptBookmarks: Flow by lazy { userProfile() .flow() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/images/ImageLoaderSetup.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/images/ImageLoaderSetup.kt index 31097217c0..72806c7aa0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/images/ImageLoaderSetup.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/images/ImageLoaderSetup.kt @@ -24,6 +24,7 @@ import android.app.Application import android.os.Build import coil3.ImageLoader import coil3.SingletonImageLoader +import coil3.annotation.DelicateCoilApi import coil3.disk.DiskCache import coil3.gif.AnimatedImageDecoder import coil3.gif.GifDecoder @@ -37,6 +38,7 @@ import okhttp3.Call class ImageLoaderSetup { companion object { + @OptIn(DelicateCoilApi::class) fun setup( app: Application, diskCache: DiskCache, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/event/EventObservers.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/event/EventObservers.kt index e43f6129df..6f382acf83 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/event/EventObservers.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/event/EventObservers.kt @@ -50,7 +50,7 @@ fun observeNote(note: Note): State { } @Suppress("UNCHECKED_CAST") -@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) +@OptIn(ExperimentalCoroutinesApi::class) @Composable fun observeNoteEvent(note: Note): State { // Subscribe in the relay for changes in this note. @@ -68,7 +68,7 @@ fun observeNoteEvent(note: Note): State { return flow.collectAsStateWithLifecycle(note.event as? T?) } -@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) +@OptIn(ExperimentalCoroutinesApi::class) @Composable fun observeNoteAndMap( note: Note, @@ -91,8 +91,8 @@ fun observeNoteAndMap( return flow.collectAsStateWithLifecycle(map(note)) } +@OptIn(ExperimentalCoroutinesApi::class) @Suppress("UNCHECKED_CAST") -@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) @Composable fun observeNoteEventAndMap( note: Note, @@ -116,7 +116,7 @@ fun observeNoteEventAndMap( return flow.collectAsStateWithLifecycle((note.event as? T)?.let { map(it) }) } -@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) +@OptIn(ExperimentalCoroutinesApi::class) @Composable fun observeNoteHasEvent(note: Note): State { // Subscribe in the relay for changes in this note. @@ -225,7 +225,7 @@ fun observeNoteReposts(note: Note): State { .collectAsStateWithLifecycle() } -@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) +@OptIn(ExperimentalCoroutinesApi::class) @Composable fun observeNoteRepostsBy( note: Note, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt index 8904190fa2..db3302ab01 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt @@ -565,7 +565,7 @@ data class RelayUsage( val userRelayList: List = emptyList(), ) -@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) +@OptIn(FlowPreview::class) @Composable fun observeUserRelaysUsing(user: User): State { // Subscribe in the relay for changes in the metadata of this user. diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AccountSwitchBottomSheet.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AccountSwitchBottomSheet.kt index 06e8d16f81..15be32fce9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AccountSwitchBottomSheet.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AccountSwitchBottomSheet.kt @@ -32,7 +32,7 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Logout +import androidx.compose.material.icons.automirrored.filled.Logout import androidx.compose.material.icons.filled.RadioButtonChecked import androidx.compose.material3.AlertDialog import androidx.compose.material3.ExperimentalMaterial3Api @@ -285,7 +285,7 @@ private fun LogoutButton( onClick = { logoutDialog = true }, ) { Icon( - imageVector = Icons.Default.Logout, + imageVector = Icons.AutoMirrored.Filled.Logout, contentDescription = stringRes(R.string.log_out), tint = MaterialTheme.colorScheme.onSurface, ) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt index 429878b0fe..b7bb586fb4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt @@ -26,7 +26,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.OpenInNew -import androidx.compose.material.icons.filled.OpenInNew import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.LocalTextStyle diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/previews/PreviewState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/previews/PreviewState.kt index 95ba457499..53e2ce17d5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/previews/PreviewState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/previews/PreviewState.kt @@ -23,6 +23,7 @@ package com.vitorpamplona.amethyst.ui.note.creators.previews import androidx.compose.ui.text.input.TextFieldValue import com.vitorpamplona.amethyst.commons.richtext.RichTextParser import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged @@ -32,6 +33,7 @@ import kotlinx.coroutines.flow.map class PreviewState { var source = MutableStateFlow(TextFieldValue("")) + @OptIn(FlowPreview::class) val results = source .debounce(200) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/userSuggestions/UserSuggestionState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/userSuggestions/UserSuggestionState.kt index ebad5f11a9..bef45fbb7c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/userSuggestions/UserSuggestionState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/userSuggestions/UserSuggestionState.kt @@ -52,6 +52,7 @@ class UserSuggestionState( .map(::userSearchTermOrNull) .onEach(::updateDataSource) + @OptIn(FlowPreview::class) val results = combine(searchTerm, invalidations.debounce(100)) { prefix, version -> if (prefix != null) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/utils/ThinSendButton.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/utils/ThinSendButton.kt index f3a0d42cee..cef4d1da4f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/utils/ThinSendButton.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/utils/ThinSendButton.kt @@ -21,7 +21,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.utils import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Send +import androidx.compose.material.icons.automirrored.filled.Send import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.runtime.Composable @@ -42,7 +42,7 @@ fun ThinSendButton( onClick = onClick, ) { Icon( - imageVector = Icons.Default.Send, + imageVector = Icons.AutoMirrored.Filled.Send, contentDescription = stringRes(id = R.string.accessibility_send), modifier = Size20Modifier, ) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/relays/RelayFeedViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/relays/RelayFeedViewModel.kt index 84422fd341..7f75b0b10a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/relays/RelayFeedViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/relays/RelayFeedViewModel.kt @@ -33,6 +33,7 @@ import com.vitorpamplona.ammolite.relays.BundledUpdate import com.vitorpamplona.quartz.nip02FollowList.ReadWrite import com.vitorpamplona.quartz.nip65RelayList.RelayUrlFormatter import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.Job import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow @@ -96,6 +97,7 @@ class RelayFeedViewModel : return (userRelaysBeingUsed + currentUserRelays).sortedWith(order) } + @OptIn(FlowPreview::class) fun subscribeTo(user: User) { if (currentUser != user) { currentUser = user