mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-28 11:56:50 +02:00
Adds #tunestr icon
This commit is contained in:
@@ -5,7 +5,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.vitorpamplona.amethyst.R
|
import com.vitorpamplona.amethyst.R
|
||||||
fun checkForHashtagWithIcon(tag: String): HashtagIcon? {
|
fun checkForHashtagWithIcon(tag: String, primary: Color): HashtagIcon? {
|
||||||
return when (tag.lowercase()) {
|
return when (tag.lowercase()) {
|
||||||
"bitcoin", "btc", "timechain" -> HashtagIcon(R.drawable.ht_btc, "Bitcoin", Color.Unspecified, Modifier.padding(2.dp, 2.dp, 0.dp, 0.dp))
|
"bitcoin", "btc", "timechain" -> HashtagIcon(R.drawable.ht_btc, "Bitcoin", Color.Unspecified, Modifier.padding(2.dp, 2.dp, 0.dp, 0.dp))
|
||||||
"nostr", "nostrich", "nostriches" -> HashtagIcon(R.drawable.ht_nostr, "Nostr", Color.Unspecified, Modifier.padding(1.dp, 2.dp, 0.dp, 0.dp))
|
"nostr", "nostrich", "nostriches" -> HashtagIcon(R.drawable.ht_nostr, "Nostr", Color.Unspecified, Modifier.padding(1.dp, 2.dp, 0.dp, 0.dp))
|
||||||
@@ -18,6 +18,7 @@ fun checkForHashtagWithIcon(tag: String): HashtagIcon? {
|
|||||||
"skullofsatoshi" -> HashtagIcon(R.drawable.skull, "SkullofSatoshi", Color.Unspecified, Modifier.padding(2.dp, 1.dp, 0.dp, 0.dp))
|
"skullofsatoshi" -> HashtagIcon(R.drawable.skull, "SkullofSatoshi", Color.Unspecified, Modifier.padding(2.dp, 1.dp, 0.dp, 0.dp))
|
||||||
"grownostr", "gardening", "garden" -> HashtagIcon(R.drawable.grownostr, "GrowNostr", Color.Unspecified, Modifier.padding(0.dp, 1.dp, 0.dp, 1.dp))
|
"grownostr", "gardening", "garden" -> HashtagIcon(R.drawable.grownostr, "GrowNostr", Color.Unspecified, Modifier.padding(0.dp, 1.dp, 0.dp, 1.dp))
|
||||||
"footstr" -> HashtagIcon(R.drawable.footstr, "Footstr", Color.Unspecified, Modifier.padding(1.dp, 1.dp, 0.dp, 0.dp))
|
"footstr" -> HashtagIcon(R.drawable.footstr, "Footstr", Color.Unspecified, Modifier.padding(1.dp, 1.dp, 0.dp, 0.dp))
|
||||||
|
"tunestr", "music", "nowplaying" -> HashtagIcon(R.drawable.tunestr, "Tunestr", primary, Modifier.padding(1.dp, 1.dp, 0.dp, 0.dp))
|
||||||
"weed", "weedstr", "420", "cannabis", "marijuana" -> HashtagIcon(R.drawable.weed, "Weed", Color.Unspecified, Modifier.padding(0.dp, 0.dp, 0.dp, 0.dp))
|
"weed", "weedstr", "420", "cannabis", "marijuana" -> HashtagIcon(R.drawable.weed, "Weed", Color.Unspecified, Modifier.padding(0.dp, 0.dp, 0.dp, 0.dp))
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
@@ -835,7 +835,8 @@ private fun RenderHashtag(
|
|||||||
tagPair: HashWordWithExtra,
|
tagPair: HashWordWithExtra,
|
||||||
nav: (String) -> Unit
|
nav: (String) -> Unit
|
||||||
) {
|
) {
|
||||||
val hashtagIcon = remember(tagPair.hashtag) { checkForHashtagWithIcon(tagPair.hashtag) }
|
val primary = MaterialTheme.colors.primary
|
||||||
|
val hashtagIcon = remember(tagPair.hashtag) { checkForHashtagWithIcon(tagPair.hashtag, primary) }
|
||||||
ClickableText(
|
ClickableText(
|
||||||
text = buildAnnotatedString {
|
text = buildAnnotatedString {
|
||||||
withStyle(
|
withStyle(
|
||||||
|
31
app/src/main/res/drawable/tunestr.xml
Normal file
31
app/src/main/res/drawable/tunestr.xml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="600dp"
|
||||||
|
android:height="600dp"
|
||||||
|
android:viewportWidth="600"
|
||||||
|
android:viewportHeight="600">
|
||||||
|
<path
|
||||||
|
android:pathData="m171.93,82.63 l405.17,-82.63 0,112.99 -405.17,82.63z"
|
||||||
|
android:fillColor="#712F8F"
|
||||||
|
android:strokeColor="#00000000"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M171.93,82.54l65.23,0l0,422.37l-65.23,0z"
|
||||||
|
android:fillColor="#712F8F"
|
||||||
|
android:strokeColor="#00000000"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m235.04,488.2c11.66,43.5 -25.91,91.36 -83.91,106.9 -58,15.54 -114.46,-7.12 -126.12,-50.62 -11.66,-43.5 25.91,-91.36 83.91,-106.9 58,-15.54 114.46,7.12 126.12,50.62z"
|
||||||
|
android:fillColor="#712F8F"
|
||||||
|
android:strokeColor="#00000000"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M511.87,13.54l65.23,0l0,422.37l-65.23,0z"
|
||||||
|
android:fillColor="#712F8F"
|
||||||
|
android:strokeColor="#00000000"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m574.98,419.21c11.66,43.5 -25.91,91.36 -83.91,106.9 -58,15.54 -114.46,-7.12 -126.12,-50.62 -11.66,-43.5 25.91,-91.36 83.91,-106.9 58,-15.54 114.46,7.12 126.12,50.62z"
|
||||||
|
android:fillColor="#712F8F"
|
||||||
|
android:strokeColor="#00000000"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
</vector>
|
Reference in New Issue
Block a user