mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
refactor: Use Compose for About page
This commit is contained in:
parent
37f1f0e330
commit
cab40214d2
19 changed files with 571 additions and 301 deletions
|
@ -0,0 +1,31 @@
|
|||
package yokai.presentation.core.components
|
||||
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun LinkIcon(
|
||||
label: String,
|
||||
icon: ImageVector,
|
||||
url: String,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val uriHandler = LocalUriHandler.current
|
||||
IconButton(
|
||||
modifier = modifier.padding(4.dp),
|
||||
onClick = { uriHandler.openUri(url) },
|
||||
) {
|
||||
Icon(
|
||||
imageVector = icon,
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
contentDescription = label,
|
||||
)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package yokai.presentation.core.icons
|
||||
|
||||
object CustomIcons
|
|
@ -0,0 +1,86 @@
|
|||
package yokai.presentation.core.icons
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
|
||||
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.graphics.vector.ImageVector.Builder
|
||||
import androidx.compose.ui.graphics.vector.path
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Suppress("UnusedReceiverParameter", "BooleanLiteralArgument")
|
||||
val CustomIcons.Discord: ImageVector
|
||||
get() {
|
||||
if (_discord != null) {
|
||||
return _discord!!
|
||||
}
|
||||
_discord = Builder(
|
||||
name = "Discord",
|
||||
defaultWidth = 24.0.dp,
|
||||
defaultHeight = 24.0.dp,
|
||||
viewportWidth = 24.0f,
|
||||
viewportHeight = 24.0f,
|
||||
).apply {
|
||||
path(
|
||||
fill = SolidColor(Color(0xFF000000)),
|
||||
stroke = null,
|
||||
strokeLineWidth = 0.0f,
|
||||
strokeLineCap = Butt,
|
||||
strokeLineJoin = Miter,
|
||||
strokeLineMiter = 4.0f,
|
||||
pathFillType = NonZero,
|
||||
) {
|
||||
moveTo(20.317f, 4.3698f)
|
||||
arcToRelative(19.7913f, 19.7913f, 0.0f, false, false, -4.8851f, -1.5152f)
|
||||
arcToRelative(0.0741f, 0.0741f, 0.0f, false, false, -0.0785f, 0.0371f)
|
||||
curveToRelative(-0.211f, 0.3753f, -0.4447f, 0.8648f, -0.6083f, 1.2495f)
|
||||
curveToRelative(-1.8447f, -0.2762f, -3.68f, -0.2762f, -5.4868f, 0.0f)
|
||||
curveToRelative(-0.1636f, -0.3933f, -0.4058f, -0.8742f, -0.6177f, -1.2495f)
|
||||
arcToRelative(0.077f, 0.077f, 0.0f, false, false, -0.0785f, -0.037f)
|
||||
arcToRelative(19.7363f, 19.7363f, 0.0f, false, false, -4.8852f, 1.515f)
|
||||
arcToRelative(0.0699f, 0.0699f, 0.0f, false, false, -0.0321f, 0.0277f)
|
||||
curveTo(0.5334f, 9.0458f, -0.319f, 13.5799f, 0.0992f, 18.0578f)
|
||||
arcToRelative(0.0824f, 0.0824f, 0.0f, false, false, 0.0312f, 0.0561f)
|
||||
curveToRelative(2.0528f, 1.5076f, 4.0413f, 2.4228f, 5.9929f, 3.0294f)
|
||||
arcToRelative(0.0777f, 0.0777f, 0.0f, false, false, 0.0842f, -0.0276f)
|
||||
curveToRelative(0.4616f, -0.6304f, 0.8731f, -1.2952f, 1.226f, -1.9942f)
|
||||
arcToRelative(0.076f, 0.076f, 0.0f, false, false, -0.0416f, -0.1057f)
|
||||
curveToRelative(-0.6528f, -0.2476f, -1.2743f, -0.5495f, -1.8722f, -0.8923f)
|
||||
arcToRelative(0.077f, 0.077f, 0.0f, false, true, -0.0076f, -0.1277f)
|
||||
curveToRelative(0.1258f, -0.0943f, 0.2517f, -0.1923f, 0.3718f, -0.2914f)
|
||||
arcToRelative(0.0743f, 0.0743f, 0.0f, false, true, 0.0776f, -0.0105f)
|
||||
curveToRelative(3.9278f, 1.7933f, 8.18f, 1.7933f, 12.0614f, 0.0f)
|
||||
arcToRelative(0.0739f, 0.0739f, 0.0f, false, true, 0.0785f, 0.0095f)
|
||||
curveToRelative(0.1202f, 0.099f, 0.246f, 0.1981f, 0.3728f, 0.2924f)
|
||||
arcToRelative(0.077f, 0.077f, 0.0f, false, true, -0.0066f, 0.1276f)
|
||||
arcToRelative(12.2986f, 12.2986f, 0.0f, false, true, -1.873f, 0.8914f)
|
||||
arcToRelative(0.0766f, 0.0766f, 0.0f, false, false, -0.0407f, 0.1067f)
|
||||
curveToRelative(0.3604f, 0.698f, 0.7719f, 1.3628f, 1.225f, 1.9932f)
|
||||
arcToRelative(0.076f, 0.076f, 0.0f, false, false, 0.0842f, 0.0286f)
|
||||
curveToRelative(1.961f, -0.6067f, 3.9495f, -1.5219f, 6.0023f, -3.0294f)
|
||||
arcToRelative(0.077f, 0.077f, 0.0f, false, false, 0.0313f, -0.0552f)
|
||||
curveToRelative(0.5004f, -5.177f, -0.8382f, -9.6739f, -3.5485f, -13.6604f)
|
||||
arcToRelative(0.061f, 0.061f, 0.0f, false, false, -0.0312f, -0.0286f)
|
||||
close()
|
||||
moveTo(8.02f, 15.3312f)
|
||||
curveToRelative(-1.1825f, 0.0f, -2.1569f, -1.0857f, -2.1569f, -2.419f)
|
||||
curveToRelative(0.0f, -1.3332f, 0.9555f, -2.4189f, 2.157f, -2.4189f)
|
||||
curveToRelative(1.2108f, 0.0f, 2.1757f, 1.0952f, 2.1568f, 2.419f)
|
||||
curveToRelative(0.0f, 1.3332f, -0.9555f, 2.4189f, -2.1569f, 2.4189f)
|
||||
close()
|
||||
moveTo(15.9948f, 15.3312f)
|
||||
curveToRelative(-1.1825f, 0.0f, -2.1569f, -1.0857f, -2.1569f, -2.419f)
|
||||
curveToRelative(0.0f, -1.3332f, 0.9554f, -2.4189f, 2.1569f, -2.4189f)
|
||||
curveToRelative(1.2108f, 0.0f, 2.1757f, 1.0952f, 2.1568f, 2.419f)
|
||||
curveToRelative(0.0f, 1.3332f, -0.946f, 2.4189f, -2.1568f, 2.4189f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
.build()
|
||||
return _discord!!
|
||||
}
|
||||
|
||||
@Suppress("ObjectPropertyName")
|
||||
private var _discord: ImageVector? = null
|
|
@ -0,0 +1,68 @@
|
|||
package yokai.presentation.core.icons
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
|
||||
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.graphics.vector.ImageVector.Builder
|
||||
import androidx.compose.ui.graphics.vector.path
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Suppress("UnusedReceiverParameter")
|
||||
val CustomIcons.GitHub: ImageVector
|
||||
get() {
|
||||
if (_github != null) {
|
||||
return _github!!
|
||||
}
|
||||
_github = Builder(
|
||||
name = "GitHub",
|
||||
defaultWidth = 24.0.dp,
|
||||
defaultHeight = 24.0.dp,
|
||||
viewportWidth = 24.0f,
|
||||
viewportHeight = 24.0f,
|
||||
).apply {
|
||||
path(
|
||||
fill = SolidColor(Color(0xFF000000)),
|
||||
stroke = null,
|
||||
strokeLineWidth = 0.0f,
|
||||
strokeLineCap = Butt,
|
||||
strokeLineJoin = Miter,
|
||||
strokeLineMiter = 4.0f,
|
||||
pathFillType = NonZero,
|
||||
) {
|
||||
moveTo(12.0f, 0.297f)
|
||||
curveToRelative(-6.63f, 0.0f, -12.0f, 5.373f, -12.0f, 12.0f)
|
||||
curveToRelative(0.0f, 5.303f, 3.438f, 9.8f, 8.205f, 11.385f)
|
||||
curveToRelative(0.6f, 0.113f, 0.82f, -0.258f, 0.82f, -0.577f)
|
||||
curveToRelative(0.0f, -0.285f, -0.01f, -1.04f, -0.015f, -2.04f)
|
||||
curveToRelative(-3.338f, 0.724f, -4.042f, -1.61f, -4.042f, -1.61f)
|
||||
curveTo(4.422f, 18.07f, 3.633f, 17.7f, 3.633f, 17.7f)
|
||||
curveToRelative(-1.087f, -0.744f, 0.084f, -0.729f, 0.084f, -0.729f)
|
||||
curveToRelative(1.205f, 0.084f, 1.838f, 1.236f, 1.838f, 1.236f)
|
||||
curveToRelative(1.07f, 1.835f, 2.809f, 1.305f, 3.495f, 0.998f)
|
||||
curveToRelative(0.108f, -0.776f, 0.417f, -1.305f, 0.76f, -1.605f)
|
||||
curveToRelative(-2.665f, -0.3f, -5.466f, -1.332f, -5.466f, -5.93f)
|
||||
curveToRelative(0.0f, -1.31f, 0.465f, -2.38f, 1.235f, -3.22f)
|
||||
curveToRelative(-0.135f, -0.303f, -0.54f, -1.523f, 0.105f, -3.176f)
|
||||
curveToRelative(0.0f, 0.0f, 1.005f, -0.322f, 3.3f, 1.23f)
|
||||
curveToRelative(0.96f, -0.267f, 1.98f, -0.399f, 3.0f, -0.405f)
|
||||
curveToRelative(1.02f, 0.006f, 2.04f, 0.138f, 3.0f, 0.405f)
|
||||
curveToRelative(2.28f, -1.552f, 3.285f, -1.23f, 3.285f, -1.23f)
|
||||
curveToRelative(0.645f, 1.653f, 0.24f, 2.873f, 0.12f, 3.176f)
|
||||
curveToRelative(0.765f, 0.84f, 1.23f, 1.91f, 1.23f, 3.22f)
|
||||
curveToRelative(0.0f, 4.61f, -2.805f, 5.625f, -5.475f, 5.92f)
|
||||
curveToRelative(0.42f, 0.36f, 0.81f, 1.096f, 0.81f, 2.22f)
|
||||
curveToRelative(0.0f, 1.606f, -0.015f, 2.896f, -0.015f, 3.286f)
|
||||
curveToRelative(0.0f, 0.315f, 0.21f, 0.69f, 0.825f, 0.57f)
|
||||
curveTo(20.565f, 22.092f, 24.0f, 17.592f, 24.0f, 12.297f)
|
||||
curveToRelative(0.0f, -6.627f, -5.373f, -12.0f, -12.0f, -12.0f)
|
||||
}
|
||||
}
|
||||
.build()
|
||||
return _github!!
|
||||
}
|
||||
|
||||
@Suppress("ObjectPropertyName")
|
||||
private var _github: ImageVector? = null
|
|
@ -0,0 +1,56 @@
|
|||
package yokai.presentation.core.icons
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
|
||||
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.graphics.vector.ImageVector.Builder
|
||||
import androidx.compose.ui.graphics.vector.path
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Suppress("UnusedReceiverParameter")
|
||||
val CustomIcons.LocalSource: ImageVector
|
||||
get() {
|
||||
if (_localSource != null) {
|
||||
return _localSource!!
|
||||
}
|
||||
_localSource = Builder(
|
||||
name = "localSource",
|
||||
defaultWidth = 24.0.dp,
|
||||
defaultHeight = 24.0.dp,
|
||||
viewportWidth = 24.0f,
|
||||
viewportHeight = 24.0f,
|
||||
).apply {
|
||||
path(
|
||||
fill = SolidColor(Color(0xFF000000)),
|
||||
stroke = null,
|
||||
strokeLineWidth = 0.0f,
|
||||
strokeLineCap = Butt,
|
||||
strokeLineJoin = Miter,
|
||||
strokeLineMiter = 4.0f,
|
||||
pathFillType = NonZero,
|
||||
) {
|
||||
moveTo(12f, 11.55f)
|
||||
curveTo(9.64f, 9.35f, 6.48f, 8f, 3f, 8f)
|
||||
verticalLineToRelative(11f)
|
||||
curveToRelative(3.48f, 0f, 6.64f, 1.35f, 9f, 3.55f)
|
||||
curveToRelative(2.36f, -2.19f, 5.52f, -3.55f, 9f, -3.55f)
|
||||
verticalLineTo(8f)
|
||||
curveToRelative(-3.48f, 0f, -6.64f, 1.35f, -9f, 3.55f)
|
||||
close()
|
||||
moveTo(12f, 8f)
|
||||
curveToRelative(1.66f, 0f, 3f, -1.34f, 3f, -3f)
|
||||
reflectiveCurveToRelative(-1.34f, -3f, -3f, -3f)
|
||||
reflectiveCurveToRelative(-3f, 1.34f, -3f, 3f)
|
||||
reflectiveCurveToRelative(1.34f, 3f, 3f, 3f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
.build()
|
||||
return _localSource!!
|
||||
}
|
||||
|
||||
@Suppress("ObjectPropertyName")
|
||||
private var _localSource: ImageVector? = null
|
Loading…
Add table
Add a link
Reference in a new issue