Skip to content

Commit e7cd08c

Browse files
committed
Add custom Discord icon and use it in Support screen settings
1 parent aa2c331 commit e7cd08c

2 files changed

Lines changed: 110 additions & 2 deletions

File tree

app/src/main/java/eu/darken/myperm/common/compose/LucideIcons.kt

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
package eu.darken.myperm.common.compose
22

3+
import androidx.compose.foundation.layout.Arrangement
4+
import androidx.compose.foundation.layout.Row
5+
import androidx.compose.foundation.layout.padding
6+
import androidx.compose.foundation.layout.size
7+
import androidx.compose.material3.Icon
8+
import androidx.compose.material3.MaterialTheme
9+
import androidx.compose.material3.Text
10+
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.Alignment
12+
import androidx.compose.ui.Modifier
313
import androidx.compose.ui.graphics.Color
414
import androidx.compose.ui.graphics.SolidColor
515
import androidx.compose.ui.graphics.StrokeCap
@@ -108,3 +118,101 @@ val LucideRadar: ImageVector
108118
}
109119

110120
private var _LucideRadar: ImageVector? = null
121+
122+
val DiscordIcon: ImageVector
123+
get() {
124+
if (_DiscordIcon != null) return _DiscordIcon!!
125+
126+
_DiscordIcon = ImageVector.Builder(
127+
name = "discord",
128+
defaultWidth = 24.dp,
129+
defaultHeight = 24.dp,
130+
viewportWidth = 24f,
131+
viewportHeight = 24f
132+
).apply {
133+
path(
134+
fill = SolidColor(Color.Black),
135+
) {
136+
moveTo(20.317f, 4.37f)
137+
arcToRelative(19.791f, 19.791f, 0f, false, false, -4.885f, -1.515f)
138+
arcToRelative(0.074f, 0.074f, 0f, false, false, -0.079f, 0.037f)
139+
curveToRelative(-0.211f, 0.375f, -0.445f, 0.865f, -0.608f, 1.25f)
140+
arcToRelative(18.27f, 18.27f, 0f, false, false, -5.487f, 0f)
141+
curveToRelative(-0.164f, -0.393f, -0.406f, -0.874f, -0.618f, -1.25f)
142+
arcToRelative(0.077f, 0.077f, 0f, false, false, -0.079f, -0.037f)
143+
arcToRelative(19.736f, 19.736f, 0f, false, false, -4.885f, 1.515f)
144+
arcToRelative(0.07f, 0.07f, 0f, false, false, -0.032f, 0.028f)
145+
curveTo(0.533f, 9.046f, -0.319f, 13.58f, 0.099f, 18.058f)
146+
arcToRelative(0.082f, 0.082f, 0f, false, false, 0.031f, 0.056f)
147+
curveToRelative(2.053f, 1.508f, 4.041f, 2.423f, 5.993f, 3.03f)
148+
arcToRelative(0.078f, 0.078f, 0f, false, false, 0.084f, -0.028f)
149+
curveToRelative(0.462f, -0.63f, 0.873f, -1.295f, 1.226f, -1.994f)
150+
arcToRelative(0.076f, 0.076f, 0f, false, false, -0.042f, -0.106f)
151+
arcToRelative(13.107f, 13.107f, 0f, false, true, -1.872f, -0.892f)
152+
arcToRelative(0.077f, 0.077f, 0f, false, true, -0.008f, -0.128f)
153+
curveToRelative(0.126f, -0.094f, 0.252f, -0.192f, 0.372f, -0.291f)
154+
arcToRelative(0.074f, 0.074f, 0f, false, true, 0.078f, -0.01f)
155+
curveToRelative(3.928f, 1.793f, 8.18f, 1.793f, 12.062f, 0f)
156+
arcToRelative(0.074f, 0.074f, 0f, false, true, 0.078f, 0.01f)
157+
curveToRelative(0.12f, 0.099f, 0.246f, 0.198f, 0.373f, 0.292f)
158+
arcToRelative(0.077f, 0.077f, 0f, false, true, -0.007f, 0.128f)
159+
arcToRelative(12.299f, 12.299f, 0f, false, true, -1.873f, 0.891f)
160+
arcToRelative(0.077f, 0.077f, 0f, false, false, -0.041f, 0.107f)
161+
curveToRelative(0.36f, 0.698f, 0.772f, 1.363f, 1.225f, 1.993f)
162+
arcToRelative(0.076f, 0.076f, 0f, false, false, 0.084f, 0.029f)
163+
curveToRelative(1.961f, -0.607f, 3.95f, -1.522f, 6.002f, -3.029f)
164+
arcToRelative(0.077f, 0.077f, 0f, false, false, 0.031f, -0.055f)
165+
curveToRelative(0.5f, -5.177f, -0.838f, -9.674f, -3.549f, -13.66f)
166+
arcToRelative(0.061f, 0.061f, 0f, false, false, -0.031f, -0.029f)
167+
close()
168+
moveTo(8.02f, 15.331f)
169+
curveToRelative(-1.183f, 0f, -2.157f, -1.086f, -2.157f, -2.419f)
170+
curveToRelative(0f, -1.333f, 0.956f, -2.419f, 2.157f, -2.419f)
171+
curveToRelative(1.21f, 0f, 2.176f, 1.095f, 2.157f, 2.419f)
172+
curveToRelative(0f, 1.333f, -0.956f, 2.419f, -2.157f, 2.419f)
173+
close()
174+
moveTo(15.995f, 15.331f)
175+
curveToRelative(-1.182f, 0f, -2.157f, -1.086f, -2.157f, -2.419f)
176+
curveToRelative(0f, -1.333f, 0.955f, -2.419f, 2.157f, -2.419f)
177+
curveToRelative(1.21f, 0f, 2.176f, 1.095f, 2.157f, 2.419f)
178+
curveToRelative(0f, 1.333f, -0.946f, 2.419f, -2.157f, 2.419f)
179+
close()
180+
}
181+
}.build()
182+
183+
return _DiscordIcon!!
184+
}
185+
186+
private var _DiscordIcon: ImageVector? = null
187+
188+
@Composable
189+
private fun IconPreviewRow(icon: ImageVector, label: String) {
190+
Row(
191+
verticalAlignment = Alignment.CenterVertically,
192+
horizontalArrangement = Arrangement.spacedBy(12.dp),
193+
modifier = Modifier.padding(8.dp),
194+
) {
195+
Icon(
196+
imageVector = icon,
197+
contentDescription = null,
198+
modifier = Modifier.size(24.dp),
199+
tint = MaterialTheme.colorScheme.onSurface,
200+
)
201+
Text(
202+
text = label,
203+
style = MaterialTheme.typography.bodyMedium,
204+
)
205+
}
206+
}
207+
208+
@Preview2
209+
@Composable
210+
private fun LucideRadarPreview() = PreviewWrapper {
211+
IconPreviewRow(LucideRadar, "LucideRadar")
212+
}
213+
214+
@Preview2
215+
@Composable
216+
private fun DiscordIconPreview() = PreviewWrapper {
217+
IconPreviewRow(DiscordIcon, "DiscordIcon")
218+
}

app/src/main/java/eu/darken/myperm/settings/ui/support/SupportScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import androidx.compose.foundation.lazy.LazyColumn
1717
import androidx.compose.material.icons.Icons
1818
import androidx.compose.material.icons.automirrored.filled.ArrowBack
1919
import androidx.compose.material.icons.twotone.BugReport
20-
import androidx.compose.material.icons.twotone.ChatBubble
2120
import androidx.compose.material.icons.twotone.CheckCircle
2221
import androidx.compose.material.icons.twotone.Delete
2322
import androidx.compose.material.icons.twotone.Email
@@ -53,6 +52,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
5352
import androidx.lifecycle.compose.LifecycleResumeEffect
5453
import androidx.lifecycle.compose.collectAsStateWithLifecycle
5554
import eu.darken.myperm.R
55+
import eu.darken.myperm.common.compose.DiscordIcon
5656
import eu.darken.myperm.common.compose.Preview2
5757
import eu.darken.myperm.common.compose.PreviewWrapper
5858
import eu.darken.myperm.common.debug.recording.core.DebugSession
@@ -264,7 +264,7 @@ fun SupportScreen(
264264
SettingsBaseItem(
265265
title = stringResource(R.string.discord_label),
266266
subtitle = stringResource(R.string.discord_description),
267-
icon = Icons.TwoTone.ChatBubble,
267+
icon = DiscordIcon,
268268
onClick = onDiscord,
269269
)
270270
}

0 commit comments

Comments
 (0)