From 7235eaabb6d106a78eeb5101115ee3efff29078d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 23 Apr 2026 21:01:59 +0000 Subject: [PATCH] feat(icons): swap post + incognito_off drawables for Material Symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - BookmarkGroupItem: replace R.drawable.post with MaterialSymbols.News (codepoint U+E032). Drop now-unused post.xml. - IncognitoBadge: drop the NIP-17 "encrypted" indicator (encryption is the expected default; no need to flag) and replace the legacy NIP-04 unencrypted indicator with MaterialSymbols.NoEncryption (U+F03F). Drop now-unused incognito_off.xml. incognito.xml is kept — still used by the "post anonymously" toggle in ToggleNip17Button, GenericCommentPostScreen, and ShortNotePostScreen. https://claude.ai/code/session_016gV9gEaSud6kDMdcaqy8ti --- .../bookmarkgroups/list/BookmarkGroupItem.kt | 5 ++--- .../chats/privateDM/IncognitoBadge.kt | 20 +++++-------------- .../src/main/res/drawable/incognito_off.xml | 9 --------- amethyst/src/main/res/drawable/post.xml | 1 - .../commons/icons/symbols/MaterialSymbols.kt | 2 ++ 5 files changed, 9 insertions(+), 28 deletions(-) delete mode 100644 amethyst/src/main/res/drawable/incognito_off.xml delete mode 100644 amethyst/src/main/res/drawable/post.xml diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/BookmarkGroupItem.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/BookmarkGroupItem.kt index eca233ae4..9c7e679af 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/BookmarkGroupItem.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/BookmarkGroupItem.kt @@ -43,7 +43,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow @@ -172,7 +171,7 @@ private fun BookmarkGroupActions( onClick = openPostBookmarks, ) { Icon( - painter = painterResource(R.drawable.post), + symbol = MaterialSymbols.News, contentDescription = null, ) Text(stringRes(R.string.bookmark_list_posts_btn_label)) @@ -212,7 +211,7 @@ fun BookmarkMembershipStatusAndNumberDisplay( horizontalArrangement = SpacedBy2dp, ) { Icon( - painter = painterResource(R.drawable.post), + symbol = MaterialSymbols.News, modifier = Size10Modifier, contentDescription = null, ) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/IncognitoBadge.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/IncognitoBadge.kt index 1b681818e..7e7416e40 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/IncognitoBadge.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/IncognitoBadge.kt @@ -21,32 +21,22 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.privateDM import androidx.compose.foundation.layout.Spacer -import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable -import com.vitorpamplona.amethyst.R +import com.vitorpamplona.amethyst.commons.icons.symbols.Icon +import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.model.Note -import com.vitorpamplona.amethyst.ui.painterRes import com.vitorpamplona.amethyst.ui.theme.IncognitoIconModifier import com.vitorpamplona.amethyst.ui.theme.StdHorzSpacer import com.vitorpamplona.amethyst.ui.theme.placeholderText import com.vitorpamplona.quartz.nip04Dm.messages.PrivateDmEvent -import com.vitorpamplona.quartz.nip17Dm.base.NIP17Group @Composable fun IncognitoBadge(baseNote: Note) { - if (baseNote.event is NIP17Group) { + if (baseNote.event is PrivateDmEvent) { Icon( - painter = painterRes(resourceId = R.drawable.incognito, 1), - null, - modifier = IncognitoIconModifier, - tint = MaterialTheme.colorScheme.placeholderText, - ) - Spacer(modifier = StdHorzSpacer) - } else if (baseNote.event is PrivateDmEvent) { - Icon( - painter = painterRes(resourceId = R.drawable.incognito_off, 1), - null, + symbol = MaterialSymbols.NoEncryption, + contentDescription = null, modifier = IncognitoIconModifier, tint = MaterialTheme.colorScheme.placeholderText, ) diff --git a/amethyst/src/main/res/drawable/incognito_off.xml b/amethyst/src/main/res/drawable/incognito_off.xml deleted file mode 100644 index 4f9e79d6e..000000000 --- a/amethyst/src/main/res/drawable/incognito_off.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/amethyst/src/main/res/drawable/post.xml b/amethyst/src/main/res/drawable/post.xml deleted file mode 100644 index e7e168441..000000000 --- a/amethyst/src/main/res/drawable/post.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbols.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbols.kt index 467bb7b70..c6de11d51 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbols.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbols.kt @@ -142,6 +142,8 @@ object MaterialSymbols { val MoreVert = MaterialSymbol("\uE5D4") val MoveToInbox = MaterialSymbol("\uE168") val MusicNote = MaterialSymbol("\uE405") + val News = MaterialSymbol("\uE032") + val NoEncryption = MaterialSymbol("\uF03F") val Notifications = MaterialSymbol("\uE7F5") val Numbers = MaterialSymbol("\uEAC7") val OpenInBrowser = MaterialSymbol("\uE89D")