Switches Social Icons to faster SVG versions

This commit is contained in:
Vitor Pamplona
2024-06-18 18:15:02 -04:00
parent e18945b378
commit c27f4a62b6
52 changed files with 844 additions and 152 deletions
@@ -18,7 +18,7 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.labels
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
@@ -41,12 +41,9 @@ private fun VectorPreview() {
private var labelsFollowing: ImageVector? = null
public val Following: ImageVector
get() {
if (labelsFollowing != null) {
return labelsFollowing!!
}
labelsFollowing =
ImageVector.Builder(
get() =
labelsFollowing ?: ImageVector
.Builder(
name = "Following",
defaultWidth = 30.dp,
defaultHeight = 30.dp,
@@ -128,6 +125,4 @@ public val Following: ImageVector
close()
}
}.build()
return labelsFollowing!!
}
.also { labelsFollowing = it }
@@ -0,0 +1,82 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(Like, null)
}
private var labelsLike: ImageVector? = null
public val Like: ImageVector
get() =
labelsLike ?: Builder(
name = "Like",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0xFF000000)),
strokeLineWidth = 0.0f,
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(12.0f, 21.638f)
horizontalLineToRelative(-0.014f)
curveTo(9.403f, 21.59f, 1.95f, 14.856f, 1.95f, 8.478f)
curveToRelative(0.0f, -3.064f, 2.525f, -5.754f, 5.403f, -5.754f)
curveToRelative(2.29f, 0.0f, 3.83f, 1.58f, 4.646f, 2.73f)
curveToRelative(0.814f, -1.148f, 2.354f, -2.73f, 4.645f, -2.73f)
curveToRelative(2.88f, 0.0f, 5.404f, 2.69f, 5.404f, 5.755f)
curveToRelative(0.0f, 6.376f, -7.454f, 13.11f, -10.037f, 13.157f)
horizontalLineTo(12.0f)
close()
moveTo(7.354f, 4.225f)
curveToRelative(-2.08f, 0.0f, -3.903f, 1.988f, -3.903f, 4.255f)
curveToRelative(0.0f, 5.74f, 7.034f, 11.596f, 8.55f, 11.658f)
curveToRelative(1.518f, -0.062f, 8.55f, -5.917f, 8.55f, -11.658f)
curveToRelative(0.0f, -2.267f, -1.823f, -4.255f, -3.903f, -4.255f)
curveToRelative(-2.528f, 0.0f, -3.94f, 2.936f, -3.952f, 2.965f)
curveToRelative(-0.23f, 0.562f, -1.156f, 0.562f, -1.387f, 0.0f)
curveToRelative(-0.014f, -0.03f, -1.425f, -2.965f, -3.954f, -2.965f)
close()
}
}.build()
.also { labelsLike = it }
@@ -0,0 +1,73 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(Liked, null)
}
private var labelsLiked: ImageVector? = null
public val Liked: ImageVector
get() =
labelsLiked ?: Builder(
name = "Like",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0xFFCA395f)),
strokeLineWidth = 0.0f,
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(12.0f, 21.638f)
horizontalLineToRelative(-0.014f)
curveTo(9.403f, 21.59f, 1.95f, 14.856f, 1.95f, 8.478f)
curveToRelative(0.0f, -3.064f, 2.525f, -5.754f, 5.403f, -5.754f)
curveToRelative(2.29f, 0.0f, 3.83f, 1.58f, 4.646f, 2.73f)
curveToRelative(0.814f, -1.148f, 2.354f, -2.73f, 4.645f, -2.73f)
curveToRelative(2.88f, 0.0f, 5.404f, 2.69f, 5.404f, 5.755f)
curveToRelative(0.0f, 6.376f, -7.454f, 13.11f, -10.037f, 13.157f)
horizontalLineTo(12.0f)
close()
}
}.build()
.also { labelsLiked = it }
@@ -0,0 +1,90 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(Reply, null)
}
private var labelsReply: ImageVector? = null
public val Reply: ImageVector
get() =
labelsReply ?: Builder(
name = "Reply",
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(14.046f, 2.242f)
lineToRelative(-4.148f, -0.01f)
horizontalLineToRelative(-0.002f)
curveToRelative(-4.374f, 0.0f, -7.8f, 3.427f, -7.8f, 7.802f)
curveToRelative(0.0f, 4.098f, 3.186f, 7.206f, 7.465f, 7.37f)
verticalLineToRelative(3.828f)
curveToRelative(0.0f, 0.108f, 0.044f, 0.286f, 0.12f, 0.403f)
curveToRelative(0.142f, 0.225f, 0.384f, 0.347f, 0.632f, 0.347f)
curveToRelative(0.138f, 0.0f, 0.277f, -0.038f, 0.402f, -0.118f)
curveToRelative(0.264f, -0.168f, 6.473f, -4.14f, 8.088f, -5.506f)
curveToRelative(1.902f, -1.61f, 3.04f, -3.97f, 3.043f, -6.312f)
verticalLineToRelative(-0.017f)
curveToRelative(-0.006f, -4.367f, -3.43f, -7.787f, -7.8f, -7.788f)
close()
moveTo(17.833f, 15.214f)
curveToRelative(-1.134f, 0.96f, -4.862f, 3.405f, -6.772f, 4.643f)
lineTo(11.061f, 16.67f)
curveToRelative(0.0f, -0.414f, -0.335f, -0.75f, -0.75f, -0.75f)
horizontalLineToRelative(-0.396f)
curveToRelative(-3.66f, 0.0f, -6.318f, -2.476f, -6.318f, -5.886f)
curveToRelative(0.0f, -3.534f, 2.768f, -6.302f, 6.3f, -6.302f)
lineToRelative(4.147f, 0.01f)
horizontalLineToRelative(0.002f)
curveToRelative(3.532f, 0.0f, 6.3f, 2.766f, 6.302f, 6.296f)
curveToRelative(-0.003f, 1.91f, -0.942f, 3.844f, -2.514f, 5.176f)
close()
}
}.build()
.also { labelsReply = it }
@@ -0,0 +1,104 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(Repost, null)
}
private var labelsRepost: ImageVector? = null
public val Repost: ImageVector
get() =
labelsRepost ?: Builder(
name = "Repost",
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(23.77f, 15.67f)
curveToRelative(-0.292f, -0.293f, -0.767f, -0.293f, -1.06f, 0.0f)
lineToRelative(-2.22f, 2.22f)
lineTo(20.49f, 7.65f)
curveToRelative(0.0f, -2.068f, -1.683f, -3.75f, -3.75f, -3.75f)
horizontalLineToRelative(-5.85f)
curveToRelative(-0.414f, 0.0f, -0.75f, 0.336f, -0.75f, 0.75f)
reflectiveCurveToRelative(0.336f, 0.75f, 0.75f, 0.75f)
horizontalLineToRelative(5.85f)
curveToRelative(1.24f, 0.0f, 2.25f, 1.01f, 2.25f, 2.25f)
verticalLineToRelative(10.24f)
lineToRelative(-2.22f, -2.22f)
curveToRelative(-0.293f, -0.293f, -0.768f, -0.293f, -1.06f, 0.0f)
reflectiveCurveToRelative(-0.294f, 0.768f, 0.0f, 1.06f)
lineToRelative(3.5f, 3.5f)
curveToRelative(0.145f, 0.147f, 0.337f, 0.22f, 0.53f, 0.22f)
reflectiveCurveToRelative(0.383f, -0.072f, 0.53f, -0.22f)
lineToRelative(3.5f, -3.5f)
curveToRelative(0.294f, -0.292f, 0.294f, -0.767f, 0.0f, -1.06f)
close()
moveTo(13.11f, 18.95f)
lineTo(7.26f, 18.95f)
curveToRelative(-1.24f, 0.0f, -2.25f, -1.01f, -2.25f, -2.25f)
lineTo(5.01f, 6.46f)
lineToRelative(2.22f, 2.22f)
curveToRelative(0.148f, 0.147f, 0.34f, 0.22f, 0.532f, 0.22f)
reflectiveCurveToRelative(0.384f, -0.073f, 0.53f, -0.22f)
curveToRelative(0.293f, -0.293f, 0.293f, -0.768f, 0.0f, -1.06f)
lineToRelative(-3.5f, -3.5f)
curveToRelative(-0.293f, -0.294f, -0.768f, -0.294f, -1.06f, 0.0f)
lineToRelative(-3.5f, 3.5f)
curveToRelative(-0.294f, 0.292f, -0.294f, 0.767f, 0.0f, 1.06f)
reflectiveCurveToRelative(0.767f, 0.293f, 1.06f, 0.0f)
lineToRelative(2.22f, -2.22f)
lineTo(3.512f, 16.7f)
curveToRelative(0.0f, 2.068f, 1.683f, 3.75f, 3.75f, 3.75f)
horizontalLineToRelative(5.85f)
curveToRelative(0.414f, 0.0f, 0.75f, -0.336f, 0.75f, -0.75f)
reflectiveCurveToRelative(-0.337f, -0.75f, -0.75f, -0.75f)
close()
}
}.build()
.also { labelsRepost = it }
@@ -0,0 +1,104 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(Reposted, null)
}
private var labelsReposted: ImageVector? = null
public val Reposted: ImageVector
get() =
labelsReposted ?: Builder(
name = "Repost",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0xFF59bc6d)),
stroke = null,
strokeLineWidth = 0.0f,
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(23.77f, 15.67f)
curveToRelative(-0.292f, -0.293f, -0.767f, -0.293f, -1.06f, 0.0f)
lineToRelative(-2.22f, 2.22f)
lineTo(20.49f, 7.65f)
curveToRelative(0.0f, -2.068f, -1.683f, -3.75f, -3.75f, -3.75f)
horizontalLineToRelative(-5.85f)
curveToRelative(-0.414f, 0.0f, -0.75f, 0.336f, -0.75f, 0.75f)
reflectiveCurveToRelative(0.336f, 0.75f, 0.75f, 0.75f)
horizontalLineToRelative(5.85f)
curveToRelative(1.24f, 0.0f, 2.25f, 1.01f, 2.25f, 2.25f)
verticalLineToRelative(10.24f)
lineToRelative(-2.22f, -2.22f)
curveToRelative(-0.293f, -0.293f, -0.768f, -0.293f, -1.06f, 0.0f)
reflectiveCurveToRelative(-0.294f, 0.768f, 0.0f, 1.06f)
lineToRelative(3.5f, 3.5f)
curveToRelative(0.145f, 0.147f, 0.337f, 0.22f, 0.53f, 0.22f)
reflectiveCurveToRelative(0.383f, -0.072f, 0.53f, -0.22f)
lineToRelative(3.5f, -3.5f)
curveToRelative(0.294f, -0.292f, 0.294f, -0.767f, 0.0f, -1.06f)
close()
moveTo(13.11f, 18.95f)
lineTo(7.26f, 18.95f)
curveToRelative(-1.24f, 0.0f, -2.25f, -1.01f, -2.25f, -2.25f)
lineTo(5.01f, 6.46f)
lineToRelative(2.22f, 2.22f)
curveToRelative(0.148f, 0.147f, 0.34f, 0.22f, 0.532f, 0.22f)
reflectiveCurveToRelative(0.384f, -0.073f, 0.53f, -0.22f)
curveToRelative(0.293f, -0.293f, 0.293f, -0.768f, 0.0f, -1.06f)
lineToRelative(-3.5f, -3.5f)
curveToRelative(-0.293f, -0.294f, -0.768f, -0.294f, -1.06f, 0.0f)
lineToRelative(-3.5f, 3.5f)
curveToRelative(-0.294f, 0.292f, -0.294f, 0.767f, 0.0f, 1.06f)
reflectiveCurveToRelative(0.767f, 0.293f, 1.06f, 0.0f)
lineToRelative(2.22f, -2.22f)
lineTo(3.512f, 16.7f)
curveToRelative(0.0f, 2.068f, 1.683f, 3.75f, 3.75f, 3.75f)
horizontalLineToRelative(5.85f)
curveToRelative(0.414f, 0.0f, 0.75f, -0.336f, 0.75f, -0.75f)
reflectiveCurveToRelative(-0.337f, -0.75f, -0.75f, -0.75f)
close()
}
}.build()
.also { labelsReposted = it }
@@ -0,0 +1,82 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(Search, null)
}
private var labelsSearch: ImageVector? = null
val Search: ImageVector
get() =
labelsSearch ?: Builder(
name = "Search",
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(21.53f, 20.47f)
lineToRelative(-3.66f, -3.66f)
curveTo(19.195f, 15.24f, 20.0f, 13.214f, 20.0f, 11.0f)
curveToRelative(0.0f, -4.97f, -4.03f, -9.0f, -9.0f, -9.0f)
reflectiveCurveToRelative(-9.0f, 4.03f, -9.0f, 9.0f)
reflectiveCurveToRelative(4.03f, 9.0f, 9.0f, 9.0f)
curveToRelative(2.215f, 0.0f, 4.24f, -0.804f, 5.808f, -2.13f)
lineToRelative(3.66f, 3.66f)
curveToRelative(0.147f, 0.146f, 0.34f, 0.22f, 0.53f, 0.22f)
reflectiveCurveToRelative(0.385f, -0.073f, 0.53f, -0.22f)
curveToRelative(0.295f, -0.293f, 0.295f, -0.767f, 0.002f, -1.06f)
close()
moveTo(3.5f, 11.0f)
curveToRelative(0.0f, -4.135f, 3.365f, -7.5f, 7.5f, -7.5f)
reflectiveCurveToRelative(7.5f, 3.365f, 7.5f, 7.5f)
reflectiveCurveToRelative(-3.365f, 7.5f, -7.5f, 7.5f)
reflectiveCurveToRelative(-7.5f, -3.365f, -7.5f, -7.5f)
close()
}
}.build()
.also { labelsSearch = it }
@@ -0,0 +1,106 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(Share, null)
}
private var labelsShare: ImageVector? = null
val Share: ImageVector
get() =
labelsShare ?: Builder(
name = "Share",
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(17.53f, 7.47f)
lineToRelative(-5.0f, -5.0f)
curveToRelative(-0.293f, -0.293f, -0.768f, -0.293f, -1.06f, 0.0f)
lineToRelative(-5.0f, 5.0f)
curveToRelative(-0.294f, 0.293f, -0.294f, 0.768f, 0.0f, 1.06f)
reflectiveCurveToRelative(0.767f, 0.294f, 1.06f, 0.0f)
lineToRelative(3.72f, -3.72f)
verticalLineTo(15.0f)
curveToRelative(0.0f, 0.414f, 0.336f, 0.75f, 0.75f, 0.75f)
reflectiveCurveToRelative(0.75f, -0.336f, 0.75f, -0.75f)
verticalLineTo(4.81f)
lineToRelative(3.72f, 3.72f)
curveToRelative(0.146f, 0.147f, 0.338f, 0.22f, 0.53f, 0.22f)
reflectiveCurveToRelative(0.384f, -0.072f, 0.53f, -0.22f)
curveToRelative(0.293f, -0.293f, 0.293f, -0.767f, 0.0f, -1.06f)
close()
}
path(
fill = SolidColor(Color(0xFF000000)),
stroke = null,
strokeLineWidth = 0.0f,
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(19.708f, 21.944f)
horizontalLineTo(4.292f)
curveTo(3.028f, 21.944f, 2.0f, 20.916f, 2.0f, 19.652f)
verticalLineTo(14.0f)
curveToRelative(0.0f, -0.414f, 0.336f, -0.75f, 0.75f, -0.75f)
reflectiveCurveToRelative(0.75f, 0.336f, 0.75f, 0.75f)
verticalLineToRelative(5.652f)
curveToRelative(0.0f, 0.437f, 0.355f, 0.792f, 0.792f, 0.792f)
horizontalLineToRelative(15.416f)
curveToRelative(0.437f, 0.0f, 0.792f, -0.355f, 0.792f, -0.792f)
verticalLineTo(14.0f)
curveToRelative(0.0f, -0.414f, 0.336f, -0.75f, 0.75f, -0.75f)
reflectiveCurveToRelative(0.75f, 0.336f, 0.75f, 0.75f)
verticalLineToRelative(5.652f)
curveToRelative(0.0f, 1.264f, -1.028f, 2.292f, -2.292f, 2.292f)
close()
}
}.build()
.also { labelsShare = it }
@@ -0,0 +1,104 @@
/**
* Copyright (c) 2024 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.icons
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.StrokeJoin
import androidx.compose.ui.graphics.vector.DefaultFillType
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.PathBuilder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Preview
@Composable
private fun VectorPreview() {
Image(ZapSplit, null)
}
private var zapSplit: ImageVector? = null
val ZapSplit: ImageVector
get() =
zapSplit ?: materialIcon(name = "ZapSplit") {
materialPath {
moveTo(7.0f, 21.0f)
horizontalLineToRelative(-1.0f)
lineToRelative(1.0f, -7.0f)
horizontalLineTo(3.5f)
curveToRelative(-0.88f, 0.0f, -0.33f, -0.75f, -0.31f, -0.78f)
curveTo(4.48f, 10.94f, 6.42f, 7.54f, 9.01f, 3.0f)
horizontalLineToRelative(1.0f)
lineToRelative(-1.0f, 7.0f)
horizontalLineToRelative(3.51f)
curveToRelative(0.4f, 0.0f, 0.62f, 0.19f, 0.4f, 0.66f)
curveTo(8.97f, 17.55f, 7.0f, 21.0f, 7.0f, 21.0f)
close()
moveTo(14.59f, 16.59f)
lineTo(19.17f, 12.0f)
lineTo(14.59f, 7.41f)
lineTo(16.0f, 6.0f)
lineToRelative(6.0f, 6.0f)
lineToRelative(-6.0f, 6.0f)
lineToRelative(-1.41f, -1.41f)
close()
}
}.also { zapSplit = it }
inline fun ImageVector.Builder.materialPath(
fillAlpha: Float = 1f,
strokeAlpha: Float = 1f,
pathFillType: PathFillType = DefaultFillType,
pathBuilder: PathBuilder.() -> Unit,
) = path(
fill = SolidColor(Color.Black),
fillAlpha = fillAlpha,
stroke = null,
strokeAlpha = strokeAlpha,
strokeLineWidth = 1f,
strokeLineCap = StrokeCap.Butt,
strokeLineJoin = StrokeJoin.Bevel,
strokeLineMiter = 1f,
pathFillType = pathFillType,
pathBuilder = pathBuilder,
)
inline fun materialIcon(
name: String,
autoMirror: Boolean = false,
block: ImageVector.Builder.() -> ImageVector.Builder,
): ImageVector =
ImageVector
.Builder(
name = name,
defaultWidth = 24.dp,
defaultHeight = 24.dp,
viewportWidth = 24f,
viewportHeight = 24f,
autoMirror = autoMirror,
).block()
.build()