diff --git a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt index 30c16940d..3ed4fe322 100644 --- a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt +++ b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt @@ -35,7 +35,7 @@ object PushNotificationUtils { accounts: List, okHttpClient: (String) -> OkHttpClient, ) = with(Dispatchers.IO) { - if (!pushHandler.savedDistributorExists()) return + if (!pushHandler.savedDistributorExists()) return@with val currentDistributor = PushDistributorHandler.getSavedDistributor() PushDistributorHandler.saveDistributor(currentDistributor) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt index d0a7be95c..7fae24e83 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt @@ -18,6 +18,8 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +@file:Suppress("DEPRECATION") + package com.vitorpamplona.amethyst.model import android.util.LruCache diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/relayLists/GenericRelayListCache.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/relayLists/GenericRelayListCache.kt index e7301e059..961f8f160 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/relayLists/GenericRelayListCache.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/relayLists/GenericRelayListCache.kt @@ -42,6 +42,7 @@ open class GenericRelayListCache( suspend fun relays(event: T) = cachedPrivateLists.mergeTagList(event).relaySet() + @Suppress("UNCHECKED_CAST") fun fastStartValueForRelayList(note: Note): RelayListCard { val noteEvent = note.event as? T return if (noteEvent != null) { @@ -52,6 +53,7 @@ open class GenericRelayListCache( } @OptIn(ExperimentalCoroutinesApi::class) + @Suppress("UNCHECKED_CAST") fun observeDecryptedRelayList(note: Note): Flow = note .flow() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt index dfb319822..85a875363 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt @@ -41,6 +41,7 @@ import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.sample import kotlinx.coroutines.flow.stateIn +@Suppress("UNCHECKED_CAST") class MergedFollowListsState( val kind3List: Kind3FollowListState, val peopleList: PeopleListsState, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt index 78546d965..e7bccbbc5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip01Notifications/FilterNotificationsToPubkey.kt @@ -18,6 +18,8 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +@file:Suppress("DEPRECATION") + package com.vitorpamplona.amethyst.service.relayClient.reqCommand.account.nip01Notifications import com.vitorpamplona.quartz.experimental.attestations.recommendation.AttestorRecommendationEvent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/SetDialogToEdgeToEdge.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/SetDialogToEdgeToEdge.kt index 81e1a8c22..1bfc73fca 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/SetDialogToEdgeToEdge.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/SetDialogToEdgeToEdge.kt @@ -44,7 +44,6 @@ fun SetDialogToEdgeToEdge() { attributes.copyFrom(activityWindow.attributes) attributes.type = dialogWindow.attributes.type dialogWindow.attributes = attributes - dialogWindow.statusBarColor parentView.layoutParams = FrameLayout.LayoutParams( activityWindow.decorView.width, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/BadgeCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/BadgeCompose.kt index 321187de8..338eb71b6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/BadgeCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/BadgeCompose.kt @@ -66,71 +66,67 @@ fun BadgeCompose( val context = LocalContext.current.applicationContext - if (note == null) { - BlankNote(Modifier) - } else { - val backgroundColor = - calculateBackgroundColor( - createdAt = likeSetCard.createdAt(), - routeForLastRead = routeForLastRead, - accountViewModel = accountViewModel, - ) + val backgroundColor = + calculateBackgroundColor( + createdAt = likeSetCard.createdAt(), + routeForLastRead = routeForLastRead, + accountViewModel = accountViewModel, + ) - Column( + Column( + modifier = + Modifier + .background(backgroundColor.value) + .clickable( + onClick = { + routeFor( + note, + accountViewModel.account, + )?.let { nav.nav(it) } + }, + ), + ) { + Row( modifier = - Modifier - .background(backgroundColor.value) - .clickable( - onClick = { - routeFor( - note, - accountViewModel.account, - )?.let { nav.nav(it) } - }, - ), + Modifier.padding( + start = if (!isInnerNote) 12.dp else 0.dp, + end = if (!isInnerNote) 12.dp else 0.dp, + top = 10.dp, + ), ) { - Row( - modifier = - Modifier.padding( - start = if (!isInnerNote) 12.dp else 0.dp, - end = if (!isInnerNote) 12.dp else 0.dp, - top = 10.dp, - ), - ) { - // Draws the like picture outside the boosted card. - if (!isInnerNote) { - Box( - modifier = Modifier.width(55.dp).padding(0.dp), - ) { - Icon( - imageVector = Icons.Default.MilitaryTech, - null, - modifier = Modifier.size(25.dp).align(Alignment.TopEnd), - tint = MaterialTheme.colorScheme.primary, - ) - } + // Draws the like picture outside the boosted card. + if (!isInnerNote) { + Box( + modifier = Modifier.width(55.dp).padding(0.dp), + ) { + Icon( + imageVector = Icons.Default.MilitaryTech, + null, + modifier = Modifier.size(25.dp).align(Alignment.TopEnd), + tint = MaterialTheme.colorScheme.primary, + ) + } + } + + Column(modifier = Modifier.padding(start = if (!isInnerNote) 10.dp else 0.dp)) { + Row { + Text( + stringRes(R.string.new_badge_award_notif), + fontWeight = FontWeight.Bold, + modifier = Modifier.padding(bottom = 5.dp).weight(1f), + ) + + Text( + timeAgo(note.createdAt(), context = context), + color = MaterialTheme.colorScheme.placeholderText, + maxLines = 1, + ) + + MoreOptionsButton(note, null, accountViewModel, nav) } - Column(modifier = Modifier.padding(start = if (!isInnerNote) 10.dp else 0.dp)) { - Row { - Text( - stringRes(R.string.new_badge_award_notif), - fontWeight = FontWeight.Bold, - modifier = Modifier.padding(bottom = 5.dp).weight(1f), - ) - - Text( - timeAgo(note.createdAt(), context = context), - color = MaterialTheme.colorScheme.placeholderText, - maxLines = 1, - ) - - MoreOptionsButton(note, null, accountViewModel, nav) - } - - note.replyTo?.firstOrNull()?.let { - BadgeDisplay(baseNote = it, accountViewModel) - } + note.replyTo?.firstOrNull()?.let { + BadgeDisplay(baseNote = it, accountViewModel) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt index 566ead599..4907d07e6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt @@ -22,6 +22,7 @@ package com.vitorpamplona.amethyst.ui.note.elements import android.content.Intent import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.outlined.PlaylistAdd import androidx.compose.material.icons.outlined.Bookmark import androidx.compose.material.icons.outlined.BookmarkAdd import androidx.compose.material.icons.outlined.BookmarkRemove @@ -185,7 +186,7 @@ fun NoteDropDownMenu( onDismiss() } } - M3ActionRow(icon = Icons.Outlined.PlaylistAdd, text = stringRes(R.string.follow_set_add_author_from_note_action)) { + M3ActionRow(icon = Icons.AutoMirrored.Outlined.PlaylistAdd, text = stringRes(R.string.follow_set_add_author_from_note_action)) { val authorHexKey = note.author?.pubkeyHex ?: return@M3ActionRow nav.nav(Route.PeopleListManagement(authorHexKey)) onDismiss() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Attestation.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Attestation.kt index 76cd1f644..2f55e9630 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Attestation.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Attestation.kt @@ -34,6 +34,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.Send import androidx.compose.material.icons.filled.CheckCircle import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.ErrorOutline @@ -308,7 +309,7 @@ fun RenderAttestationRequest( horizontalArrangement = Arrangement.spacedBy(8.dp), ) { Icon( - imageVector = Icons.Default.Send, + imageVector = Icons.AutoMirrored.Filled.Send, contentDescription = stringRes(R.string.attestation_request), tint = MaterialTheme.colorScheme.primary, modifier = Modifier.size(24.dp), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/RelayInformationScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/RelayInformationScreen.kt index 9be2e718c..ad98c32bf 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/RelayInformationScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/RelayInformationScreen.kt @@ -18,6 +18,8 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +@file:Suppress("DEPRECATION") + package com.vitorpamplona.amethyst.ui.screen.loggedIn.relays import androidx.compose.foundation.clickable diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/compose/editor/MarkdownToolbar.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/compose/editor/MarkdownToolbar.kt index 4709625b1..09ea759fd 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/compose/editor/MarkdownToolbar.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/compose/editor/MarkdownToolbar.kt @@ -26,6 +26,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.FormatListBulleted import androidx.compose.material.icons.filled.Checklist import androidx.compose.material.icons.filled.Code import androidx.compose.material.icons.filled.FormatBold @@ -83,7 +84,7 @@ fun MarkdownToolbar( Separator() // --- Lists --- - ToolbarIconButton(Icons.Default.FormatListBulleted, "Bullet list", state.isUnorderedList) { state.toggleUnorderedList() } + ToolbarIconButton(Icons.AutoMirrored.Filled.FormatListBulleted, "Bullet list", state.isUnorderedList) { state.toggleUnorderedList() } ToolbarIconButton(Icons.Default.FormatListNumbered, "Numbered list", state.isOrderedList) { state.toggleOrderedList() } ToolbarIconButton(Icons.Default.Checklist, "Task list", state.isTaskList) { state.toggleTaskList() }