Skip to content

Commit

Permalink
Clean Icons code
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Sep 3, 2024
1 parent 1f5e941 commit 952a912
Show file tree
Hide file tree
Showing 20 changed files with 164 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ import com.infomaniak.swisstransfer.ui.icons.AppIcons

val AppIcons.Add: ImageVector
get() {
if (_add != null) {
return _add!!
}
if (_add != null) return _add!!

_add = Builder(
name = "Add",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
group {
path(
Expand All @@ -38,7 +37,7 @@ val AppIcons.Add: ImageVector
strokeLineCap = Round,
strokeLineJoin = StrokeJoin.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(1.5f, 12.0f)
horizontalLineToRelative(21.0f)
Expand All @@ -47,6 +46,7 @@ val AppIcons.Add: ImageVector
}
}
}.build()

return _add!!
}

Expand All @@ -59,7 +59,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Add,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppIcons.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ import com.infomaniak.swisstransfer.ui.icons.AppIcons

val AppIcons.ArrowDownCircle: ImageVector
get() {
if (_arrowDownCircle != null) {
return _arrowDownCircle!!
}

if (_arrowDownCircle != null) return _arrowDownCircle!!

_arrowDownCircle = Builder(
name = "ArrowDownCircle",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
path(
fill = null,
Expand All @@ -56,7 +56,7 @@ val AppIcons.ArrowDownCircle: ImageVector
strokeLineCap = StrokeCap.Round,
strokeLineJoin = Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(12.0f, 16.5f)
verticalLineToRelative(-9.0f)
Expand All @@ -71,7 +71,7 @@ val AppIcons.ArrowDownCircle: ImageVector
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(12.0f, 22.5f)
curveToRelative(5.799f, 0.0f, 10.5f, -4.701f, 10.5f, -10.5f)
Expand All @@ -81,6 +81,7 @@ val AppIcons.ArrowDownCircle: ImageVector
close()
}
}.build()

return _arrowDownCircle!!
}

Expand All @@ -93,7 +94,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.ArrowDownCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppIcons.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import com.infomaniak.swisstransfer.ui.icons.AppIcons

val AppIcons.ArrowLeft: ImageVector
get() {
if (_arrowLeft != null) {
return _arrowLeft!!
}

if (_arrowLeft != null) return _arrowLeft!!

_arrowLeft = Builder(
name = "ArrowLeft",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
path(
fill = null,
Expand All @@ -36,7 +36,7 @@ val AppIcons.ArrowLeft: ImageVector
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(23.25f, 12.0f)
horizontalLineTo(0.75f)
Expand All @@ -45,6 +45,7 @@ val AppIcons.ArrowLeft: ImageVector
lineToRelative(10.5f, 10.5f)
}
}.build()

return _arrowLeft!!
}

Expand All @@ -57,7 +58,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.ArrowLeft,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppIcons.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ import com.infomaniak.swisstransfer.ui.icons.AppIcons

val AppIcons.ArrowUpCircle: ImageVector
get() {
if (_arrowUpCircle != null) {
return _arrowUpCircle!!
}

if (_arrowUpCircle != null) return _arrowUpCircle!!

_arrowUpCircle = Builder(
name = "ArrowUpCircle",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
path(
fill = null,
Expand All @@ -56,7 +56,7 @@ val AppIcons.ArrowUpCircle: ImageVector
strokeLineCap = Round,
strokeLineJoin = StrokeJoin.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(12.0f, 7.5f)
verticalLineToRelative(9.0f)
Expand All @@ -71,7 +71,7 @@ val AppIcons.ArrowUpCircle: ImageVector
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(12.0f, 1.5f)
curveToRelative(5.799f, 0.0f, 10.5f, 4.701f, 10.5f, 10.5f)
Expand All @@ -81,6 +81,7 @@ val AppIcons.ArrowUpCircle: ImageVector
close()
}
}.build()

return _arrowUpCircle!!
}

Expand All @@ -93,7 +94,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.ArrowUpCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppIcons.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRoun

val AppIcons.Bell: ImageVector
get() {
if (_notificationBell != null) {
return _notificationBell!!
}

if (_notificationBell != null) return _notificationBell!!

_notificationBell = Builder(
name = "Bell",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
path(
fill = null,
Expand All @@ -36,7 +36,7 @@ val AppIcons.Bell: ImageVector
strokeLineCap = strokeCapRound,
strokeLineJoin = strokeJoinRound,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(9.0f, 20.0f)
curveToRelative(0.19f, 0.866f, 0.585f, 1.626f, 1.126f, 2.167f)
Expand All @@ -53,6 +53,7 @@ val AppIcons.Bell: ImageVector
arcTo(7.5f, 7.5f, 0.0f, false, true, 12.0f, 4.0f)
}
}.build()

return _notificationBell!!
}

Expand All @@ -65,7 +66,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Bell,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppIcons.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import com.infomaniak.swisstransfer.ui.icons.AppIcons

val AppIcons.BlackAndWhiteCircle: ImageVector
get() {
if (_blackAndWhiteCircle != null) {
return _blackAndWhiteCircle!!
}

if (_blackAndWhiteCircle != null) return _blackAndWhiteCircle!!

_blackAndWhiteCircle = Builder(
name = "BlackAndWhiteCircle",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0xFF000000)),
Expand All @@ -38,7 +38,7 @@ val AppIcons.BlackAndWhiteCircle: ImageVector
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(12.0f, 0.0f)
arcToRelative(12.0f, 12.0f, 0.0f, false, true, 12.0f, 12.0f)
Expand All @@ -62,7 +62,7 @@ val AppIcons.BlackAndWhiteCircle: ImageVector
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(-4.5f, 27.5f)
lineTo(27.0f, -2.5f)
Expand All @@ -76,7 +76,7 @@ val AppIcons.BlackAndWhiteCircle: ImageVector
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(12.0f, 0.15f)
arcTo(11.85f, 11.85f, 0.0f, false, true, 23.85f, 12.0f)
Expand All @@ -87,6 +87,7 @@ val AppIcons.BlackAndWhiteCircle: ImageVector
}
}
}.build()

return _blackAndWhiteCircle!!
}

Expand All @@ -99,7 +100,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.BlackAndWhiteCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppIcons.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,24 @@ import com.infomaniak.swisstransfer.ui.icons.AppIcons

val AppIcons.BlackCircle: ImageVector
get() {
if (_blackCircle != null) {
return _blackCircle!!
}

if (_blackCircle != null) return _blackCircle!!

_blackCircle = Builder(
name = "BlackCircle",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0xFF000000)), stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 0.3f, strokeLineCap = Butt, strokeLineJoin = Miter,
strokeLineMiter = 4.0f, pathFillType = NonZero
fill = SolidColor(Color(0xFF000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 0.3f,
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(12.0f, 0.15f)
arcTo(11.85f, 11.85f, 0.0f, false, true, 23.85f, 12.0f)
Expand All @@ -43,6 +47,7 @@ val AppIcons.BlackCircle: ImageVector
}
}
.build()

return _blackCircle!!
}

Expand All @@ -55,7 +60,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.BlackCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppIcons.previewSize),
)
}
}
Loading

0 comments on commit 952a912

Please sign in to comment.