mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 08:17:04 +05:30
all: migrate from drawables to generated ImageVectors
This commit is contained in:
parent
67389c8acd
commit
0a1634bb83
19 changed files with 314 additions and 99 deletions
|
@ -21,7 +21,6 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
|
@ -42,10 +41,10 @@ import dev.msfjarvis.claw.android.ui.lists.HottestPosts
|
|||
import dev.msfjarvis.claw.android.ui.navigation.Destinations
|
||||
import dev.msfjarvis.claw.android.viewmodel.ClawViewModel
|
||||
import dev.msfjarvis.claw.api.LobstersApi
|
||||
import dev.msfjarvis.claw.common.R as commonR
|
||||
import dev.msfjarvis.claw.common.comments.CommentsPage
|
||||
import dev.msfjarvis.claw.common.comments.HTMLConverter
|
||||
import dev.msfjarvis.claw.common.comments.LocalHTMLConverter
|
||||
import dev.msfjarvis.claw.common.res.ClawIcons
|
||||
import dev.msfjarvis.claw.common.theme.LobstersTheme
|
||||
import dev.msfjarvis.claw.common.urllauncher.UrlLauncher
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -85,12 +84,12 @@ fun LobstersApp(
|
|||
NavigationItem(
|
||||
label = "Hottest",
|
||||
route = Destinations.Hottest.getRoute(),
|
||||
icon = painterResource(R.drawable.ic_whatshot_24dp),
|
||||
icon = ClawIcons.Flame,
|
||||
) { coroutineScope.launch { networkListState.animateScrollToItem(index = 0) } },
|
||||
NavigationItem(
|
||||
label = "Saved",
|
||||
route = Destinations.Saved.getRoute(),
|
||||
icon = painterResource(commonR.drawable.ic_favorite_24dp),
|
||||
icon = ClawIcons.Heart,
|
||||
) { coroutineScope.launch { savedListState.animateScrollToItem(index = 0) } },
|
||||
)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import androidx.compose.material3.NavigationBarItem
|
|||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.navigation.NavController
|
||||
import dev.msfjarvis.claw.android.ui.navigation.Destinations
|
||||
import dev.msfjarvis.claw.android.ui.slideInAnimation
|
||||
|
@ -29,7 +29,7 @@ fun ClawNavigationBar(
|
|||
NavigationBar(modifier = modifier) {
|
||||
items.forEach { navItem ->
|
||||
NavigationBarItem(
|
||||
icon = { Icon(painter = navItem.icon, contentDescription = navItem.label) },
|
||||
icon = { Icon(imageVector = navItem.icon, contentDescription = navItem.label) },
|
||||
label = { Text(text = navItem.label) },
|
||||
selected = navController.currentDestination?.route == navItem.route,
|
||||
onClick = {
|
||||
|
@ -51,6 +51,6 @@ fun ClawNavigationBar(
|
|||
class NavigationItem(
|
||||
val label: String,
|
||||
val route: String,
|
||||
val icon: Painter,
|
||||
val icon: ImageVector,
|
||||
val listStateResetCallback: () -> Unit,
|
||||
)
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M13.5,0.67s0.74,2.65 0.74,4.8c0,2.06 -1.35,3.73 -3.41,3.73 -2.07,0 -3.63,-1.67 -3.63,-3.73l0.03,-0.36C5.21,7.51 4,10.62 4,14c0,4.42 3.58,8 8,8s8,-3.58 8,-8C20,8.61 17.41,3.8 13.5,0.67zM11.71,19c-1.78,0 -3.22,-1.4 -3.22,-3.14 0,-1.62 1.05,-2.76 2.81,-3.12 1.77,-0.36 3.6,-1.21 4.62,-2.58 0.39,1.29 0.59,2.65 0.59,4.04 0,2.65 -2.15,4.8 -4.8,4.8z" />
|
||||
</vector>
|
|
@ -1,14 +0,0 @@
|
|||
package dev.msfjarvis.claw.common.res
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import dev.msfjarvis.claw.common.R
|
||||
|
||||
actual val commentIcon
|
||||
@Composable get() = painterResource(R.drawable.ic_insert_comment_24dp)
|
||||
actual val heartIcon
|
||||
@Composable get() = painterResource(R.drawable.ic_favorite_24dp)
|
||||
actual val heartBorderIcon
|
||||
@Composable get() = painterResource(R.drawable.ic_favorite_border_24dp)
|
||||
actual val webIcon
|
||||
@Composable get() = painterResource(R.drawable.ic_web_24dp)
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z" />
|
||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M16.5,3c-1.74,0 -3.41,0.81 -4.5,2.09C10.91,3.81 9.24,3 7.5,3 4.42,3 2,5.42 2,8.5c0,3.78 3.4,6.86 8.55,11.54L12,21.35l1.45,-1.32C18.6,15.36 22,12.28 22,8.5 22,5.42 19.58,3 16.5,3zM12.1,18.55l-0.1,0.1 -0.1,-0.1C7.14,14.24 4,11.39 4,8.5 4,6.5 5.5,5 7.5,5c1.54,0 3.04,0.99 3.57,2.36h1.87C13.46,5.99 14.96,5 16.5,5c2,0 3.5,1.5 3.5,3.5 0,2.89 -3.14,5.74 -7.9,10.05z" />
|
||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14l4,4L22,4c0,-1.1 -0.9,-2 -2,-2zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z" />
|
||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-0.61 0.08,-1.21 0.21,-1.78L8.99,15v1c0,1.1 0.9,2 2,2v1.93C7.06,19.43 4,16.07 4,12zM17.89,17.4c-0.26,-0.81 -1,-1.4 -1.9,-1.4h-1v-3c0,-0.55 -0.45,-1 -1,-1h-6v-2h2c0.55,0 1,-0.45 1,-1L10.99,7h2c1.1,0 2,-0.9 2,-2v-0.41C17.92,5.77 20,8.65 20,12c0,2.08 -0.81,3.98 -2.11,5.4z" />
|
||||
</vector>
|
|
@ -38,7 +38,7 @@ import dev.msfjarvis.claw.common.posts.PostActions
|
|||
import dev.msfjarvis.claw.common.posts.PostTitle
|
||||
import dev.msfjarvis.claw.common.posts.Submitter
|
||||
import dev.msfjarvis.claw.common.posts.TagRow
|
||||
import dev.msfjarvis.claw.common.res.webIcon
|
||||
import dev.msfjarvis.claw.common.res.ClawIcons
|
||||
import dev.msfjarvis.claw.model.Comment
|
||||
import dev.msfjarvis.claw.model.LobstersPostDetails
|
||||
|
||||
|
@ -104,7 +104,7 @@ fun PostLink(
|
|||
) {
|
||||
Row(modifier = Modifier.padding(16.dp), horizontalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
Icon(
|
||||
painter = webIcon,
|
||||
imageVector = ClawIcons.Web,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSecondary,
|
||||
)
|
||||
|
|
|
@ -38,9 +38,7 @@ import androidx.compose.ui.semantics.Role
|
|||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.google.accompanist.flowlayout.FlowRow
|
||||
import dev.msfjarvis.claw.common.res.commentIcon
|
||||
import dev.msfjarvis.claw.common.res.heartBorderIcon
|
||||
import dev.msfjarvis.claw.common.res.heartIcon
|
||||
import dev.msfjarvis.claw.common.res.ClawIcons
|
||||
import dev.msfjarvis.claw.common.ui.Divider
|
||||
import dev.msfjarvis.claw.common.ui.NetworkImage
|
||||
import dev.msfjarvis.claw.database.local.SavedPost
|
||||
|
@ -160,7 +158,7 @@ fun SaveButton(
|
|||
Crossfade(targetState = isSaved) { saved ->
|
||||
Box(modifier = modifier.padding(12.dp)) {
|
||||
Icon(
|
||||
painter = if (saved) heartIcon else heartBorderIcon,
|
||||
imageVector = if (saved) ClawIcons.Heart else ClawIcons.HeartBorder,
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
contentDescription = if (saved) "Remove from saved posts" else "Add to saved posts",
|
||||
modifier = Modifier.align(Alignment.Center)
|
||||
|
@ -192,7 +190,7 @@ fun CommentsButton(
|
|||
},
|
||||
) {
|
||||
Icon(
|
||||
painter = commentIcon,
|
||||
imageVector = ClawIcons.Comment,
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
contentDescription = "Open comments",
|
||||
modifier = Modifier.align(Alignment.Center),
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package dev.msfjarvis.claw.common.res
|
||||
|
||||
import dev.msfjarvis.claw.common.res.clawicons.commentIcon
|
||||
import dev.msfjarvis.claw.common.res.clawicons.flameIcon
|
||||
import dev.msfjarvis.claw.common.res.clawicons.heartBorderIcon
|
||||
import dev.msfjarvis.claw.common.res.clawicons.heartIcon
|
||||
import dev.msfjarvis.claw.common.res.clawicons.webIcon
|
||||
|
||||
object ClawIcons {
|
||||
val Comment = commentIcon
|
||||
|
||||
val Flame = flameIcon
|
||||
|
||||
val Heart = heartIcon
|
||||
|
||||
val HeartBorder = heartBorderIcon
|
||||
|
||||
val Web = webIcon
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
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
|
||||
import dev.msfjarvis.claw.common.unsafeLazy
|
||||
|
||||
internal val commentIcon: ImageVector by unsafeLazy {
|
||||
Builder(
|
||||
name = "CommentIcon",
|
||||
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.0f, 2.0f)
|
||||
lineTo(4.0f, 2.0f)
|
||||
curveToRelative(-1.1f, 0.0f, -2.0f, 0.9f, -2.0f, 2.0f)
|
||||
verticalLineToRelative(12.0f)
|
||||
curveToRelative(0.0f, 1.1f, 0.9f, 2.0f, 2.0f, 2.0f)
|
||||
horizontalLineToRelative(14.0f)
|
||||
lineToRelative(4.0f, 4.0f)
|
||||
lineTo(22.0f, 4.0f)
|
||||
curveToRelative(0.0f, -1.1f, -0.9f, -2.0f, -2.0f, -2.0f)
|
||||
close()
|
||||
moveTo(18.0f, 14.0f)
|
||||
lineTo(6.0f, 14.0f)
|
||||
verticalLineToRelative(-2.0f)
|
||||
horizontalLineToRelative(12.0f)
|
||||
verticalLineToRelative(2.0f)
|
||||
close()
|
||||
moveTo(18.0f, 11.0f)
|
||||
lineTo(6.0f, 11.0f)
|
||||
lineTo(6.0f, 9.0f)
|
||||
horizontalLineToRelative(12.0f)
|
||||
verticalLineToRelative(2.0f)
|
||||
close()
|
||||
moveTo(18.0f, 8.0f)
|
||||
lineTo(6.0f, 8.0f)
|
||||
lineTo(6.0f, 6.0f)
|
||||
horizontalLineToRelative(12.0f)
|
||||
verticalLineToRelative(2.0f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
.build()
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
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
|
||||
import dev.msfjarvis.claw.common.unsafeLazy
|
||||
|
||||
internal val flameIcon: ImageVector by unsafeLazy {
|
||||
Builder(
|
||||
name = "FlameIcon",
|
||||
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(13.5f, 0.67f)
|
||||
reflectiveCurveToRelative(0.74f, 2.65f, 0.74f, 4.8f)
|
||||
curveToRelative(0.0f, 2.06f, -1.35f, 3.73f, -3.41f, 3.73f)
|
||||
curveToRelative(-2.07f, 0.0f, -3.63f, -1.67f, -3.63f, -3.73f)
|
||||
lineToRelative(0.03f, -0.36f)
|
||||
curveTo(5.21f, 7.51f, 4.0f, 10.62f, 4.0f, 14.0f)
|
||||
curveToRelative(0.0f, 4.42f, 3.58f, 8.0f, 8.0f, 8.0f)
|
||||
reflectiveCurveToRelative(8.0f, -3.58f, 8.0f, -8.0f)
|
||||
curveTo(20.0f, 8.61f, 17.41f, 3.8f, 13.5f, 0.67f)
|
||||
close()
|
||||
moveTo(11.71f, 19.0f)
|
||||
curveToRelative(-1.78f, 0.0f, -3.22f, -1.4f, -3.22f, -3.14f)
|
||||
curveToRelative(0.0f, -1.62f, 1.05f, -2.76f, 2.81f, -3.12f)
|
||||
curveToRelative(1.77f, -0.36f, 3.6f, -1.21f, 4.62f, -2.58f)
|
||||
curveToRelative(0.39f, 1.29f, 0.59f, 2.65f, 0.59f, 4.04f)
|
||||
curveToRelative(0.0f, 2.65f, -2.15f, 4.8f, -4.8f, 4.8f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
.build()
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
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
|
||||
import dev.msfjarvis.claw.common.unsafeLazy
|
||||
|
||||
internal val heartBorderIcon: ImageVector by unsafeLazy {
|
||||
Builder(
|
||||
name = "HeartBorder",
|
||||
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(16.5f, 3.0f)
|
||||
curveToRelative(-1.74f, 0.0f, -3.41f, 0.81f, -4.5f, 2.09f)
|
||||
curveTo(10.91f, 3.81f, 9.24f, 3.0f, 7.5f, 3.0f)
|
||||
curveTo(4.42f, 3.0f, 2.0f, 5.42f, 2.0f, 8.5f)
|
||||
curveToRelative(0.0f, 3.78f, 3.4f, 6.86f, 8.55f, 11.54f)
|
||||
lineTo(12.0f, 21.35f)
|
||||
lineToRelative(1.45f, -1.32f)
|
||||
curveTo(18.6f, 15.36f, 22.0f, 12.28f, 22.0f, 8.5f)
|
||||
curveTo(22.0f, 5.42f, 19.58f, 3.0f, 16.5f, 3.0f)
|
||||
close()
|
||||
moveTo(12.1f, 18.55f)
|
||||
lineToRelative(-0.1f, 0.1f)
|
||||
lineToRelative(-0.1f, -0.1f)
|
||||
curveTo(7.14f, 14.24f, 4.0f, 11.39f, 4.0f, 8.5f)
|
||||
curveTo(4.0f, 6.5f, 5.5f, 5.0f, 7.5f, 5.0f)
|
||||
curveToRelative(1.54f, 0.0f, 3.04f, 0.99f, 3.57f, 2.36f)
|
||||
horizontalLineToRelative(1.87f)
|
||||
curveTo(13.46f, 5.99f, 14.96f, 5.0f, 16.5f, 5.0f)
|
||||
curveToRelative(2.0f, 0.0f, 3.5f, 1.5f, 3.5f, 3.5f)
|
||||
curveToRelative(0.0f, 2.89f, -3.14f, 5.74f, -7.9f, 10.05f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
.build()
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
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
|
||||
import dev.msfjarvis.claw.common.unsafeLazy
|
||||
|
||||
internal val heartIcon: ImageVector by unsafeLazy {
|
||||
Builder(
|
||||
name = "HeartIcon",
|
||||
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, 21.35f)
|
||||
lineToRelative(-1.45f, -1.32f)
|
||||
curveTo(5.4f, 15.36f, 2.0f, 12.28f, 2.0f, 8.5f)
|
||||
curveTo(2.0f, 5.42f, 4.42f, 3.0f, 7.5f, 3.0f)
|
||||
curveToRelative(1.74f, 0.0f, 3.41f, 0.81f, 4.5f, 2.09f)
|
||||
curveTo(13.09f, 3.81f, 14.76f, 3.0f, 16.5f, 3.0f)
|
||||
curveTo(19.58f, 3.0f, 22.0f, 5.42f, 22.0f, 8.5f)
|
||||
curveToRelative(0.0f, 3.78f, -3.4f, 6.86f, -8.55f, 11.54f)
|
||||
lineTo(12.0f, 21.35f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
.build()
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
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
|
||||
import dev.msfjarvis.claw.common.unsafeLazy
|
||||
|
||||
internal val webIcon: ImageVector by unsafeLazy {
|
||||
Builder(
|
||||
name = "WebIcon",
|
||||
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, 2.0f)
|
||||
curveTo(6.48f, 2.0f, 2.0f, 6.48f, 2.0f, 12.0f)
|
||||
reflectiveCurveToRelative(4.48f, 10.0f, 10.0f, 10.0f)
|
||||
reflectiveCurveToRelative(10.0f, -4.48f, 10.0f, -10.0f)
|
||||
reflectiveCurveTo(17.52f, 2.0f, 12.0f, 2.0f)
|
||||
close()
|
||||
moveTo(4.0f, 12.0f)
|
||||
curveToRelative(0.0f, -0.61f, 0.08f, -1.21f, 0.21f, -1.78f)
|
||||
lineTo(8.99f, 15.0f)
|
||||
verticalLineToRelative(1.0f)
|
||||
curveToRelative(0.0f, 1.1f, 0.9f, 2.0f, 2.0f, 2.0f)
|
||||
verticalLineToRelative(1.93f)
|
||||
curveTo(7.06f, 19.43f, 4.0f, 16.07f, 4.0f, 12.0f)
|
||||
close()
|
||||
moveTo(17.89f, 17.4f)
|
||||
curveToRelative(-0.26f, -0.81f, -1.0f, -1.4f, -1.9f, -1.4f)
|
||||
horizontalLineToRelative(-1.0f)
|
||||
verticalLineToRelative(-3.0f)
|
||||
curveToRelative(0.0f, -0.55f, -0.45f, -1.0f, -1.0f, -1.0f)
|
||||
horizontalLineToRelative(-6.0f)
|
||||
verticalLineToRelative(-2.0f)
|
||||
horizontalLineToRelative(2.0f)
|
||||
curveToRelative(0.55f, 0.0f, 1.0f, -0.45f, 1.0f, -1.0f)
|
||||
lineTo(10.99f, 7.0f)
|
||||
horizontalLineToRelative(2.0f)
|
||||
curveToRelative(1.1f, 0.0f, 2.0f, -0.9f, 2.0f, -2.0f)
|
||||
verticalLineToRelative(-0.41f)
|
||||
curveTo(17.92f, 5.77f, 20.0f, 8.65f, 20.0f, 12.0f)
|
||||
curveToRelative(0.0f, 2.08f, -0.81f, 3.98f, -2.11f, 5.4f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
.build()
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package dev.msfjarvis.claw.common.res
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
|
||||
expect val commentIcon: Painter
|
||||
@Composable get
|
||||
expect val heartIcon: Painter
|
||||
@Composable get
|
||||
expect val heartBorderIcon: Painter
|
||||
@Composable get
|
||||
expect val webIcon: Painter
|
||||
@Composable get
|
|
@ -0,0 +1,3 @@
|
|||
package dev.msfjarvis.claw.common
|
||||
|
||||
fun <T> unsafeLazy(initializer: () -> T) = lazy(LazyThreadSafetyMode.NONE, initializer)
|
|
@ -1,13 +0,0 @@
|
|||
package dev.msfjarvis.claw.common.res
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.painterResource
|
||||
|
||||
actual val commentIcon
|
||||
@Composable get() = painterResource("ic_insert_comment_24dp.xml")
|
||||
actual val heartIcon
|
||||
@Composable get() = painterResource("ic_favorite_24dp.xml")
|
||||
actual val heartBorderIcon
|
||||
@Composable get() = painterResource("ic_favorite_border_24dp.xml")
|
||||
actual val webIcon
|
||||
@Composable get() = painterResource("ic_web_24dp.xml")
|
Loading…
Add table
Add a link
Reference in a new issue