From c1f8116a5a9b002c485515d2ed2f772c37e9a9bb Mon Sep 17 00:00:00 2001 From: Believethehype Date: Sat, 18 Mar 2023 03:12:24 +0100 Subject: [PATCH 1/3] simplified HashTagIcon code, new suggestions for #lightning and #zap --- .../amethyst/model/HashtagIcon.kt | 17 +++++------ app/src/main/res/drawable/ht_lightning.xml | 28 +++++++++++++++++++ app/src/main/res/drawable/zap.xml | 28 +++++++++++++++++++ 3 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 app/src/main/res/drawable/ht_lightning.xml create mode 100644 app/src/main/res/drawable/zap.xml diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/HashtagIcon.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/HashtagIcon.kt index 8aed40563..e1383ff1d 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/HashtagIcon.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/HashtagIcon.kt @@ -1,18 +1,15 @@ package com.vitorpamplona.amethyst.model - import androidx.compose.ui.graphics.Color import com.vitorpamplona.amethyst.R fun checkForHashtagWithIcon(tag: String): HashtagIcon? { - if (tag.lowercase() == "bitcoin" || tag.lowercase() == "btc") { - return HashtagIcon(R.drawable.ht_btc, "Bitcoin", Color.Unspecified) - } else if (tag.lowercase() == "nostr") { - return HashtagIcon(R.drawable.ht_nostr, "Nostr", Color.Unspecified) - } else if (tag.lowercase() == "zap" || tag.lowercase() == "zaps" || tag.lowercase() == "zapathon" || tag.lowercase() == "zapraiser" || tag.lowercase() == "zaplife" || tag.lowercase() == "lightning") { - return HashtagIcon(R.drawable.lightning, "Zap", Color.Unspecified) - } else if (tag.lowercase() == "amethyst") { - return HashtagIcon(R.drawable.amethyst, "Amethyst", Color.Unspecified) + when (tag.lowercase()) { + "bitcoin", "btc" -> return HashtagIcon(R.drawable.ht_btc, "Bitcoin", Color.Unspecified) + "nostr" -> return HashtagIcon(R.drawable.ht_nostr, "Nostr", Color.Unspecified) + "lightning", "lightningnetwork" -> return HashtagIcon(R.drawable.ht_lightning, "Lightning", Color.Unspecified) + "zap", "zaps", "zapathon", "zapraiser", "zaplife" -> return HashtagIcon(R.drawable.zap, "Zap", Color.Unspecified) + "amethyst" -> return HashtagIcon(R.drawable.amethyst, "Amethyst", Color.Unspecified) + else -> return null } - return null } class HashtagIcon( val icon: Int, diff --git a/app/src/main/res/drawable/ht_lightning.xml b/app/src/main/res/drawable/ht_lightning.xml new file mode 100644 index 000000000..e90da2c03 --- /dev/null +++ b/app/src/main/res/drawable/ht_lightning.xml @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/zap.xml b/app/src/main/res/drawable/zap.xml new file mode 100644 index 000000000..b0c051f42 --- /dev/null +++ b/app/src/main/res/drawable/zap.xml @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file From eb40540f0d3babecde782d74017263f967d527bc Mon Sep 17 00:00:00 2001 From: Believethehype Date: Sat, 18 Mar 2023 03:32:26 +0100 Subject: [PATCH 2/3] Update zap.xml --- app/src/main/res/drawable/zap.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/drawable/zap.xml b/app/src/main/res/drawable/zap.xml index b0c051f42..d1ea881f8 100644 --- a/app/src/main/res/drawable/zap.xml +++ b/app/src/main/res/drawable/zap.xml @@ -10,19 +10,19 @@ android:strokeWidth="1" android:pathData="M97 3C69.7119 22.6197 45.7508 46.6918 19 67C27.1406 70.4159 38.3826 67.0028 47 67C49.7247 66.9991 54.2659 66.2229 56.5733 68.0278C60.1981 70.8631 52.8246 79.2935 51.1998 82L35.6003 108C32.5028 113.163 28.8241 118.238 27 124C38.8349 118.579 49.4585 105.86 59 97.0856C69.6068 87.3314 80.5581 77.9729 91 68.0386C96.1811 63.1093 101.848 58.8943 106 53C91.9282 53 78.0109 53.3984 64 54C65.4064 48.5896 69.3227 44.4231 72.6258 40C78.044 32.7446 83.3124 25.3665 88.5787 18C91.4989 13.9152 97.4483 8.21129 97 3z" /> \ No newline at end of file From ab0361bf271b7aa2900f2344b6f1602cd944b7fc Mon Sep 17 00:00:00 2001 From: Believethehype Date: Sat, 18 Mar 2023 03:39:15 +0100 Subject: [PATCH 3/3] Update zap.xml --- app/src/main/res/drawable/zap.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/drawable/zap.xml b/app/src/main/res/drawable/zap.xml index d1ea881f8..88901877d 100644 --- a/app/src/main/res/drawable/zap.xml +++ b/app/src/main/res/drawable/zap.xml @@ -10,11 +10,11 @@ android:strokeWidth="1" android:pathData="M97 3C69.7119 22.6197 45.7508 46.6918 19 67C27.1406 70.4159 38.3826 67.0028 47 67C49.7247 66.9991 54.2659 66.2229 56.5733 68.0278C60.1981 70.8631 52.8246 79.2935 51.1998 82L35.6003 108C32.5028 113.163 28.8241 118.238 27 124C38.8349 118.579 49.4585 105.86 59 97.0856C69.6068 87.3314 80.5581 77.9729 91 68.0386C96.1811 63.1093 101.848 58.8943 106 53C91.9282 53 78.0109 53.3984 64 54C65.4064 48.5896 69.3227 44.4231 72.6258 40C78.044 32.7446 83.3124 25.3665 88.5787 18C91.4989 13.9152 97.4483 8.21129 97 3z" /> \ No newline at end of file