mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 11:07:04 +05:30
refactor: switch to Material Icons
Our previous system resulted in leaner code but was way too annoying to add new icons to.
This commit is contained in:
parent
e33768d9ca
commit
ae10d433e6
28 changed files with 46 additions and 2213 deletions
|
@ -8,7 +8,6 @@ package dev.msfjarvis.claw.common.comments
|
|||
|
||||
import android.text.format.DateUtils
|
||||
import androidx.compose.animation.AnimatedContent
|
||||
import androidx.compose.animation.ExperimentalAnimationApi
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
|
@ -21,6 +20,8 @@ import androidx.compose.foundation.layout.height
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Public
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
|
@ -29,6 +30,7 @@ import androidx.compose.runtime.getValue
|
|||
import androidx.compose.runtime.produceState
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
|
@ -41,7 +43,6 @@ 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.ClawIcons
|
||||
import dev.msfjarvis.claw.common.ui.NetworkImage
|
||||
import dev.msfjarvis.claw.common.ui.ThemedRichText
|
||||
import dev.msfjarvis.claw.model.LinkMetadata
|
||||
|
@ -115,7 +116,7 @@ private fun PostLink(
|
|||
Row(modifier = Modifier.padding(16.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
NetworkImage(
|
||||
url = linkMetadata.faviconUrl,
|
||||
placeholder = ClawIcons.Web,
|
||||
placeholder = rememberVectorPainter(Icons.Filled.Public),
|
||||
contentDescription = "",
|
||||
modifier = Modifier.size(24.dp),
|
||||
)
|
||||
|
@ -132,7 +133,6 @@ private fun PostLink(
|
|||
|
||||
private val CommentEntryPadding = 16f.dp
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
internal fun CommentEntry(
|
||||
commentNode: CommentNode,
|
||||
|
@ -170,7 +170,10 @@ internal fun CommentEntry(
|
|||
modifier =
|
||||
Modifier.clickable { uriHandler.openUri("https://lobste.rs/u/${comment.user.username}") },
|
||||
)
|
||||
AnimatedContent(targetState = commentNode.isExpanded) { expandedState ->
|
||||
AnimatedContent(
|
||||
label = "comment_body",
|
||||
targetState = commentNode.isExpanded,
|
||||
) { expandedState ->
|
||||
if (expandedState) {
|
||||
ThemedRichText(
|
||||
text = htmlConverter.convertHTMLToMarkdown(comment.comment),
|
||||
|
|
|
@ -26,6 +26,11 @@ import androidx.compose.foundation.layout.requiredSize
|
|||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentHeight
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.AccountCircle
|
||||
import androidx.compose.material.icons.filled.Favorite
|
||||
import androidx.compose.material.icons.outlined.Comment
|
||||
import androidx.compose.material.icons.outlined.FavoriteBorder
|
||||
import androidx.compose.material3.Badge
|
||||
import androidx.compose.material3.BadgedBox
|
||||
import androidx.compose.material3.Divider
|
||||
|
@ -41,11 +46,11 @@ import androidx.compose.runtime.setValue
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import dev.msfjarvis.claw.common.res.ClawIcons
|
||||
import dev.msfjarvis.claw.common.theme.LobstersTheme
|
||||
import dev.msfjarvis.claw.common.ui.NetworkImage
|
||||
import dev.msfjarvis.claw.common.ui.preview.ThemePreviews
|
||||
|
@ -149,7 +154,7 @@ internal fun Submitter(
|
|||
) {
|
||||
NetworkImage(
|
||||
url = avatarUrl,
|
||||
placeholder = ClawIcons.Account,
|
||||
placeholder = rememberVectorPainter(Icons.Filled.AccountCircle),
|
||||
contentDescription = contentDescription,
|
||||
modifier = Modifier.requiredSize(24.dp).clip(CircleShape),
|
||||
)
|
||||
|
@ -166,10 +171,13 @@ private fun SaveButton(
|
|||
Crossfade(targetState = isSaved, label = "save-button") { saved ->
|
||||
Box(modifier = modifier.padding(12.dp)) {
|
||||
Icon(
|
||||
painter = if (saved) ClawIcons.Heart else ClawIcons.HeartBorder,
|
||||
painter =
|
||||
rememberVectorPainter(
|
||||
if (saved) Icons.Filled.Favorite else Icons.Outlined.FavoriteBorder
|
||||
),
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
contentDescription = if (saved) "Remove from saved posts" else "Add to saved posts",
|
||||
modifier = Modifier.align(Alignment.Center)
|
||||
modifier = Modifier.align(Alignment.Center),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -199,7 +207,7 @@ private fun CommentsButton(
|
|||
},
|
||||
) {
|
||||
Icon(
|
||||
painter = ClawIcons.Comment,
|
||||
painter = rememberVectorPainter(Icons.Outlined.Comment),
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
contentDescription = "Open comments",
|
||||
modifier = Modifier.align(Alignment.Center),
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.common.res
|
||||
|
||||
import dev.msfjarvis.claw.common.res.clawicons.account_circle_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.arrow_back_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.comment_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.favorite_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.favorite_border_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.new_releases_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.new_releases_filled_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.public_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.whatshot_black_24dp
|
||||
import dev.msfjarvis.claw.common.res.clawicons.whatshot_filled_black_24dp
|
||||
|
||||
object ClawIcons {
|
||||
|
||||
val Account = account_circle_black_24dp()
|
||||
|
||||
val ArrowBack = arrow_back_black_24dp()
|
||||
|
||||
val Comment = comment_black_24dp()
|
||||
|
||||
val Flame = whatshot_black_24dp()
|
||||
|
||||
val FlameFilled = whatshot_filled_black_24dp()
|
||||
|
||||
val Heart = favorite_black_24dp()
|
||||
|
||||
val HeartBorder = favorite_border_black_24dp()
|
||||
|
||||
val New = new_releases_black_24dp()
|
||||
|
||||
val NewFilled = new_releases_filled_black_24dp()
|
||||
|
||||
val Web = public_black_24dp()
|
||||
}
|
|
@ -1,219 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class account_circle_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1_0
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(12.0f, 2.0f)
|
||||
cubicTo(6.48f, 2.0f, 2.0f, 6.48f, 2.0f, 12.0f)
|
||||
cubicTo(2.0f, 17.52f, 6.48f, 22.0f, 12.0f, 22.0f)
|
||||
cubicTo(17.52f, 22.0f, 22.0f, 17.52f, 22.0f, 12.0f)
|
||||
cubicTo(22.0f, 6.4799995f, 17.52f, 2.0f, 12.0f, 2.0f)
|
||||
close()
|
||||
moveTo(12.0f, 6.0f)
|
||||
cubicTo(13.93f, 6.0f, 15.5f, 7.57f, 15.5f, 9.5f)
|
||||
cubicTo(15.5f, 11.43f, 13.93f, 13.0f, 12.0f, 13.0f)
|
||||
cubicTo(10.07f, 13.0f, 8.5f, 11.43f, 8.5f, 9.5f)
|
||||
cubicTo(8.5f, 7.5699997f, 10.07f, 6.0f, 12.0f, 6.0f)
|
||||
close()
|
||||
moveTo(12.0f, 20.0f)
|
||||
cubicTo(9.97f, 20.0f, 7.57f, 19.18f, 5.86f, 17.119999f)
|
||||
cubicTo(7.55f, 15.8f, 9.68f, 15.0f, 12.0f, 15.0f)
|
||||
cubicTo(14.32f, 15.0f, 16.45f, 15.8f, 18.14f, 17.119999f)
|
||||
cubicTo(16.43f, 19.18f, 14.03f, 20.0f, 12.0f, 20.0f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 20.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 20.0
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,198 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class arrow_back_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(20.0f, 11.0f)
|
||||
lineTo(7.83f, 11.0f)
|
||||
lineTo(13.42f, 5.41f)
|
||||
lineTo(12.0f, 4.0f)
|
||||
lineTo(4.0f, 12.0f)
|
||||
lineTo(12.0f, 20.0f)
|
||||
lineTo(13.41f, 18.59f)
|
||||
lineTo(7.83f, 13.0f)
|
||||
lineTo(20.0f, 13.0f)
|
||||
lineTo(20.0f, 11.0f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 4.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 4.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 16.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 16.0
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,219 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class comment_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(21.99f, 4.0f)
|
||||
cubicTo(21.99f, 2.9f, 21.1f, 2.0f, 20.0f, 2.0f)
|
||||
lineTo(4.0f, 2.0f)
|
||||
cubicTo(2.9f, 2.0f, 2.0f, 2.9f, 2.0f, 4.0f)
|
||||
lineTo(2.0f, 16.0f)
|
||||
cubicTo(2.0f, 17.1f, 2.9f, 18.0f, 4.0f, 18.0f)
|
||||
lineTo(18.0f, 18.0f)
|
||||
lineTo(22.0f, 22.0f)
|
||||
lineTo(21.99f, 4.0f)
|
||||
close()
|
||||
moveTo(20.0f, 4.0f)
|
||||
lineTo(20.0f, 17.17f)
|
||||
lineTo(18.83f, 16.0f)
|
||||
lineTo(4.0f, 16.0f)
|
||||
lineTo(4.0f, 4.0f)
|
||||
lineTo(20.0f, 4.0f)
|
||||
close()
|
||||
moveTo(6.0f, 12.0f)
|
||||
lineTo(18.0f, 12.0f)
|
||||
lineTo(18.0f, 14.0f)
|
||||
lineTo(6.0f, 14.0f)
|
||||
close()
|
||||
moveTo(6.0f, 9.0f)
|
||||
lineTo(18.0f, 9.0f)
|
||||
lineTo(18.0f, 11.0f)
|
||||
lineTo(6.0f, 11.0f)
|
||||
close()
|
||||
moveTo(6.0f, 6.0f)
|
||||
lineTo(18.0f, 6.0f)
|
||||
lineTo(18.0f, 8.0f)
|
||||
lineTo(6.0f, 8.0f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 20.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 20.0
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class favorite_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(12.0f, 21.35f)
|
||||
lineTo(10.55f, 20.03f)
|
||||
cubicTo(5.4f, 15.36f, 2.0f, 12.28f, 2.0f, 8.5f)
|
||||
cubicTo(2.0f, 5.42f, 4.42f, 3.0f, 7.5f, 3.0f)
|
||||
cubicTo(9.24f, 3.0f, 10.91f, 3.81f, 12.0f, 5.09f)
|
||||
cubicTo(13.09f, 3.81f, 14.76f, 3.0f, 16.5f, 3.0f)
|
||||
cubicTo(19.58f, 3.0f, 22.0f, 5.42f, 22.0f, 8.5f)
|
||||
cubicTo(22.0f, 12.28f, 18.6f, 15.360001f, 13.45f, 20.04f)
|
||||
lineTo(12.0f, 21.35f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 3.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 20.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 18.350000381469727
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,208 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class favorite_border_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(16.5f, 3.0f)
|
||||
cubicTo(14.76f, 3.0f, 13.09f, 3.81f, 12.0f, 5.09f)
|
||||
cubicTo(10.91f, 3.81f, 9.24f, 3.0f, 7.5f, 3.0f)
|
||||
cubicTo(4.42f, 3.0f, 2.0f, 5.42f, 2.0f, 8.5f)
|
||||
cubicTo(2.0f, 12.28f, 5.4f, 15.360001f, 10.55f, 20.04f)
|
||||
lineTo(12.0f, 21.35f)
|
||||
lineTo(13.45f, 20.03f)
|
||||
cubicTo(18.6f, 15.36f, 22.0f, 12.28f, 22.0f, 8.5f)
|
||||
cubicTo(22.0f, 5.42f, 19.58f, 3.0f, 16.5f, 3.0f)
|
||||
close()
|
||||
moveTo(12.1f, 18.55f)
|
||||
lineTo(12.0f, 18.65f)
|
||||
lineTo(11.9f, 18.55f)
|
||||
cubicTo(7.14f, 14.24f, 4.0f, 11.39f, 4.0f, 8.5f)
|
||||
cubicTo(4.0f, 6.5f, 5.5f, 5.0f, 7.5f, 5.0f)
|
||||
cubicTo(9.04f, 5.0f, 10.54f, 5.99f, 11.07f, 7.3599997f)
|
||||
lineTo(12.94f, 7.3599997f)
|
||||
cubicTo(13.46f, 5.99f, 14.96f, 5.0f, 16.5f, 5.0f)
|
||||
cubicTo(18.5f, 5.0f, 20.0f, 6.5f, 20.0f, 8.5f)
|
||||
cubicTo(20.0f, 11.39f, 16.86f, 14.24f, 12.1f, 18.55f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 3.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 20.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 18.350000381469727
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,241 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class new_releases_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(23.0f, 12.0f)
|
||||
lineTo(20.56f, 9.22f)
|
||||
lineTo(20.9f, 5.54f)
|
||||
lineTo(17.289999f, 4.72f)
|
||||
lineTo(15.399999f, 1.5399997f)
|
||||
lineTo(12.0f, 3.0f)
|
||||
lineTo(8.6f, 1.54f)
|
||||
lineTo(6.71f, 4.72f)
|
||||
lineTo(3.1000001f, 5.5299997f)
|
||||
lineTo(3.44f, 9.21f)
|
||||
lineTo(1.0f, 12.0f)
|
||||
lineTo(3.44f, 14.78f)
|
||||
lineTo(3.1000001f, 18.47f)
|
||||
lineTo(6.71f, 19.289999f)
|
||||
lineTo(8.6f, 22.47f)
|
||||
lineTo(12.0f, 21.0f)
|
||||
lineTo(15.4f, 22.46f)
|
||||
lineTo(17.289999f, 19.279999f)
|
||||
lineTo(20.9f, 18.46f)
|
||||
lineTo(20.56f, 14.779999f)
|
||||
lineTo(23.0f, 12.0f)
|
||||
close()
|
||||
moveTo(18.49f, 14.11f)
|
||||
lineTo(18.75f, 16.9f)
|
||||
lineTo(16.01f, 17.52f)
|
||||
lineTo(14.58f, 19.93f)
|
||||
lineTo(12.0f, 18.82f)
|
||||
lineTo(9.42f, 19.93f)
|
||||
lineTo(7.9900002f, 17.52f)
|
||||
lineTo(5.25f, 16.9f)
|
||||
lineTo(5.51f, 14.099999f)
|
||||
lineTo(3.66f, 12.0f)
|
||||
lineTo(5.51f, 9.88f)
|
||||
lineTo(5.25f, 7.1000004f)
|
||||
lineTo(7.99f, 6.4900002f)
|
||||
lineTo(9.42f, 4.08f)
|
||||
lineTo(12.0f, 5.18f)
|
||||
lineTo(14.58f, 4.0699997f)
|
||||
lineTo(16.01f, 6.4799995f)
|
||||
lineTo(18.75f, 7.0999994f)
|
||||
lineTo(18.49f, 9.889999f)
|
||||
lineTo(20.34f, 12.0f)
|
||||
lineTo(18.49f, 14.11f)
|
||||
close()
|
||||
moveTo(11.0f, 15.0f)
|
||||
lineTo(13.0f, 15.0f)
|
||||
lineTo(13.0f, 17.0f)
|
||||
lineTo(11.0f, 17.0f)
|
||||
close()
|
||||
moveTo(11.0f, 7.0f)
|
||||
lineTo(13.0f, 7.0f)
|
||||
lineTo(13.0f, 13.0f)
|
||||
lineTo(11.0f, 13.0f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 1.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 1.5399997234344482
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 22.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 20.93000030517578
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,221 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class new_releases_filled_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(23.0f, 12.0f)
|
||||
lineTo(20.56f, 9.22f)
|
||||
lineTo(20.9f, 5.54f)
|
||||
lineTo(17.289999f, 4.72f)
|
||||
lineTo(15.399999f, 1.5399997f)
|
||||
lineTo(12.0f, 3.0f)
|
||||
lineTo(8.6f, 1.54f)
|
||||
lineTo(6.71f, 4.72f)
|
||||
lineTo(3.1000001f, 5.5299997f)
|
||||
lineTo(3.44f, 9.21f)
|
||||
lineTo(1.0f, 12.0f)
|
||||
lineTo(3.44f, 14.78f)
|
||||
lineTo(3.1000001f, 18.47f)
|
||||
lineTo(6.71f, 19.289999f)
|
||||
lineTo(8.6f, 22.47f)
|
||||
lineTo(12.0f, 21.0f)
|
||||
lineTo(15.4f, 22.46f)
|
||||
lineTo(17.289999f, 19.279999f)
|
||||
lineTo(20.9f, 18.46f)
|
||||
lineTo(20.56f, 14.779999f)
|
||||
lineTo(23.0f, 12.0f)
|
||||
close()
|
||||
moveTo(13.0f, 17.0f)
|
||||
lineTo(11.0f, 17.0f)
|
||||
lineTo(11.0f, 15.0f)
|
||||
lineTo(13.0f, 15.0f)
|
||||
lineTo(13.0f, 17.0f)
|
||||
close()
|
||||
moveTo(13.0f, 13.0f)
|
||||
lineTo(11.0f, 13.0f)
|
||||
lineTo(11.0f, 7.0f)
|
||||
lineTo(13.0f, 7.0f)
|
||||
lineTo(13.0f, 13.0f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 1.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 1.5399997234344482
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 22.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 20.93000030517578
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,217 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class public_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(12.0f, 2.0f)
|
||||
cubicTo(6.48f, 2.0f, 2.0f, 6.48f, 2.0f, 12.0f)
|
||||
cubicTo(2.0f, 17.52f, 6.48f, 22.0f, 12.0f, 22.0f)
|
||||
cubicTo(17.52f, 22.0f, 22.0f, 17.52f, 22.0f, 12.0f)
|
||||
cubicTo(22.0f, 6.4799995f, 17.52f, 2.0f, 12.0f, 2.0f)
|
||||
close()
|
||||
moveTo(4.0f, 12.0f)
|
||||
cubicTo(4.0f, 11.39f, 4.08f, 10.79f, 4.21f, 10.22f)
|
||||
lineTo(8.99f, 15.0f)
|
||||
lineTo(8.99f, 16.0f)
|
||||
cubicTo(8.99f, 17.1f, 9.889999f, 18.0f, 10.99f, 18.0f)
|
||||
lineTo(10.99f, 19.93f)
|
||||
cubicTo(7.06f, 19.43f, 4.0f, 16.07f, 4.0f, 12.0f)
|
||||
close()
|
||||
moveTo(17.89f, 17.4f)
|
||||
cubicTo(17.63f, 16.59f, 16.89f, 16.0f, 15.99f, 16.0f)
|
||||
lineTo(14.99f, 16.0f)
|
||||
lineTo(14.99f, 13.0f)
|
||||
cubicTo(14.99f, 12.45f, 14.54f, 12.0f, 13.99f, 12.0f)
|
||||
lineTo(7.99f, 12.0f)
|
||||
lineTo(7.99f, 10.0f)
|
||||
lineTo(9.99f, 10.0f)
|
||||
cubicTo(10.54f, 10.0f, 10.99f, 9.55f, 10.99f, 9.0f)
|
||||
lineTo(10.99f, 7.0f)
|
||||
lineTo(12.99f, 7.0f)
|
||||
cubicTo(14.09f, 7.0f, 14.99f, 6.1f, 14.99f, 5.0f)
|
||||
lineTo(14.99f, 4.59f)
|
||||
cubicTo(17.92f, 5.77f, 20.0f, 8.65f, 20.0f, 12.0f)
|
||||
cubicTo(20.0f, 14.08f, 19.19f, 15.98f, 17.89f, 17.4f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 2.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 20.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 20.0
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,212 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class whatshot_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(11.57f, 13.16f)
|
||||
cubicTo(10.21f, 13.44f, 9.4f, 14.32f, 9.4f, 15.57f)
|
||||
cubicTo(9.4f, 16.91f, 10.509999f, 17.99f, 11.889999f, 17.99f)
|
||||
cubicTo(13.94f, 17.99f, 15.599999f, 16.33f, 15.599999f, 14.28f)
|
||||
cubicTo(15.599999f, 13.21f, 15.45f, 12.16f, 15.139999f, 11.16f)
|
||||
cubicTo(14.349999f, 12.23f, 12.94f, 12.88f, 11.57f, 13.16f)
|
||||
close()
|
||||
moveTo(13.5f, 0.67f)
|
||||
cubicTo(13.5f, 0.67f, 14.24f, 3.3200002f, 14.24f, 5.4700003f)
|
||||
cubicTo(14.24f, 7.53f, 12.889999f, 9.200001f, 10.83f, 9.200001f)
|
||||
cubicTo(8.76f, 9.200001f, 7.2f, 7.5300007f, 7.2f, 5.4700007f)
|
||||
lineTo(7.23f, 5.1100006f)
|
||||
cubicTo(5.21f, 7.51f, 4.0f, 10.62f, 4.0f, 14.0f)
|
||||
cubicTo(4.0f, 18.42f, 7.58f, 22.0f, 12.0f, 22.0f)
|
||||
cubicTo(16.42f, 22.0f, 20.0f, 18.42f, 20.0f, 14.0f)
|
||||
cubicTo(20.0f, 8.61f, 17.41f, 3.8f, 13.5f, 0.67f)
|
||||
close()
|
||||
moveTo(12.0f, 20.0f)
|
||||
cubicTo(8.690001f, 20.0f, 6.0f, 17.31f, 6.0f, 14.0f)
|
||||
cubicTo(6.0f, 12.47f, 6.3f, 10.96f, 6.86f, 9.57f)
|
||||
cubicTo(7.87f, 10.58f, 9.27f, 11.2f, 10.83f, 11.2f)
|
||||
cubicTo(13.49f, 11.2f, 15.58f, 9.37f, 16.11f, 6.77f)
|
||||
cubicTo(17.34f, 8.97f, 18.0f, 11.44f, 18.0f, 14.0f)
|
||||
cubicTo(18.0f, 17.31f, 15.309999f, 20.0f, 12.0f, 20.0f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 4.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 0.6700000166893005
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 16.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 21.329999923706055
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,204 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress(
|
||||
"ClassNaming",
|
||||
"FunctionNaming",
|
||||
"FunctionOnlyReturningConstant",
|
||||
"LongMethod",
|
||||
"MagicNumber",
|
||||
"WildcardImport",
|
||||
)
|
||||
|
||||
package dev.msfjarvis.claw.common.res.clawicons
|
||||
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.*
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.Fill
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||
import androidx.compose.ui.graphics.drawscope.translate
|
||||
import androidx.compose.ui.graphics.drawscope.withTransform
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* This class has been automatically generated using <a
|
||||
* href="https://github.com/kirill-grouchnikov/aurora">Aurora SVG transcoder</a>.
|
||||
*/
|
||||
class whatshot_filled_black_24dp : Painter() {
|
||||
@Suppress("UNUSED_VARIABLE") private var shape: Outline? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var generalPath: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var brush: Brush? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
|
||||
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
|
||||
private var alpha = 1.0f
|
||||
private var blendMode = DrawScope.DefaultBlendMode
|
||||
private var alphaStack = mutableListOf(1.0f)
|
||||
private var blendModeStack = mutableListOf(DrawScope.DefaultBlendMode)
|
||||
|
||||
private fun _paint0(drawScope: DrawScope) {
|
||||
@Suppress("UNUSED_VARIABLE") var shapeText: Outline?
|
||||
@Suppress("UNUSED_VARIABLE") var generalPathText: Path? = null
|
||||
@Suppress("UNUSED_VARIABLE") var alphaText = 0.0f
|
||||
@Suppress("UNUSED_VARIABLE") var blendModeText = DrawScope.DefaultBlendMode
|
||||
with(drawScope) {
|
||||
//
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_0
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alphaStack.add(0, alpha)
|
||||
alpha *= 1.0f
|
||||
blendModeStack.add(0, BlendMode.SrcOver)
|
||||
blendMode = BlendMode.SrcOver
|
||||
// _0_1
|
||||
if (generalPath == null) {
|
||||
generalPath = Path()
|
||||
} else {
|
||||
generalPath!!.reset()
|
||||
}
|
||||
generalPath?.run {
|
||||
moveTo(13.5f, 0.67f)
|
||||
cubicTo(13.5f, 0.67f, 14.24f, 3.3200002f, 14.24f, 5.4700003f)
|
||||
cubicTo(14.24f, 7.53f, 12.889999f, 9.200001f, 10.83f, 9.200001f)
|
||||
cubicTo(8.76f, 9.200001f, 7.2f, 7.5300007f, 7.2f, 5.4700007f)
|
||||
lineTo(7.23f, 5.1100006f)
|
||||
cubicTo(5.21f, 7.51f, 4.0f, 10.62f, 4.0f, 14.0f)
|
||||
cubicTo(4.0f, 18.42f, 7.58f, 22.0f, 12.0f, 22.0f)
|
||||
cubicTo(16.42f, 22.0f, 20.0f, 18.42f, 20.0f, 14.0f)
|
||||
cubicTo(20.0f, 8.61f, 17.41f, 3.8f, 13.5f, 0.67f)
|
||||
close()
|
||||
moveTo(11.71f, 19.0f)
|
||||
cubicTo(9.93f, 19.0f, 8.49f, 17.6f, 8.49f, 15.86f)
|
||||
cubicTo(8.49f, 14.24f, 9.54f, 13.099999f, 11.299999f, 12.74f)
|
||||
cubicTo(13.07f, 12.38f, 14.9f, 11.53f, 15.919999f, 10.16f)
|
||||
cubicTo(16.31f, 11.45f, 16.509998f, 12.809999f, 16.509998f, 14.2f)
|
||||
cubicTo(16.509998f, 16.85f, 14.359999f, 19.0f, 11.709998f, 19.0f)
|
||||
close()
|
||||
}
|
||||
shape = Outline.Generic(generalPath!!)
|
||||
brush = SolidColor(Color(0, 0, 0, 255))
|
||||
drawOutline(
|
||||
outline = shape!!,
|
||||
style = Fill,
|
||||
brush = brush!!,
|
||||
alpha = alpha,
|
||||
blendMode = blendMode
|
||||
)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
alpha = alphaStack.removeAt(0)
|
||||
blendMode = blendModeStack.removeAt(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPaint(drawScope: DrawScope) {
|
||||
_paint0(drawScope)
|
||||
|
||||
shape = null
|
||||
generalPath = null
|
||||
brush = null
|
||||
stroke = null
|
||||
clip = null
|
||||
alpha = 1.0f
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Returns the X of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The X of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigX(): Double {
|
||||
return 4.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Y of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The Y of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigY(): Double {
|
||||
return 0.6700000166893005
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The width of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigWidth(): Double {
|
||||
return 16.0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the bounding box of the original SVG image.
|
||||
*
|
||||
* @return The height of the bounding box of the original SVG image.
|
||||
*/
|
||||
fun getOrigHeight(): Double {
|
||||
return 21.329999923706055
|
||||
}
|
||||
}
|
||||
|
||||
override val intrinsicSize: Size
|
||||
get() = Size.Unspecified
|
||||
|
||||
override fun DrawScope.onDraw() {
|
||||
clipRect {
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the scaling factor
|
||||
val fullOrigWidth = getOrigX() + getOrigWidth()
|
||||
val fullOrigHeight = getOrigY() + getOrigHeight()
|
||||
val coef1 = size.width / fullOrigWidth
|
||||
val coef2 = size.height / fullOrigHeight
|
||||
val coef = min(coef1, coef2).toFloat()
|
||||
|
||||
// Use the original icon bounding box and the current icon dimension to compute
|
||||
// the offset pivot for the scaling
|
||||
var translateX = -getOrigX()
|
||||
var translateY = -getOrigY()
|
||||
if (coef1 != coef2) {
|
||||
if (coef1 < coef2) {
|
||||
val extraDy = ((fullOrigWidth - fullOrigHeight) / 2.0f).toFloat()
|
||||
translateY += extraDy
|
||||
} else {
|
||||
val extraDx = ((fullOrigHeight - fullOrigWidth) / 2.0f).toFloat()
|
||||
translateX += extraDx
|
||||
}
|
||||
}
|
||||
val translateXDp = translateX.toFloat().toDp().value
|
||||
val translateYDp = translateY.toFloat().toDp().value
|
||||
|
||||
// Create a combined scale + translate + clip transform before calling the transcoded painting
|
||||
// instructions
|
||||
withTransform({
|
||||
scale(scaleX = coef, scaleY = coef, pivot = Offset.Zero)
|
||||
translate(translateXDp, translateYDp)
|
||||
clipRect(
|
||||
left = 0.0f,
|
||||
top = 0.0f,
|
||||
right = fullOrigWidth.toFloat(),
|
||||
bottom = fullOrigHeight.toFloat(),
|
||||
clipOp = ClipOp.Intersect
|
||||
)
|
||||
}) {
|
||||
innerPaint(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Copyright © 2022-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
|
@ -13,6 +13,8 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.requiredSize
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.AccountCircle
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
|
@ -22,12 +24,12 @@ import androidx.compose.runtime.produceState
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
||||
import androidx.compose.ui.unit.dp
|
||||
import dev.msfjarvis.claw.common.NetworkState
|
||||
import dev.msfjarvis.claw.common.NetworkState.Error
|
||||
import dev.msfjarvis.claw.common.NetworkState.Loading
|
||||
import dev.msfjarvis.claw.common.NetworkState.Success
|
||||
import dev.msfjarvis.claw.common.res.ClawIcons
|
||||
import dev.msfjarvis.claw.common.ui.NetworkError
|
||||
import dev.msfjarvis.claw.common.ui.NetworkImage
|
||||
import dev.msfjarvis.claw.common.ui.ProgressBar
|
||||
|
@ -90,7 +92,7 @@ private fun UserProfileInternal(
|
|||
) {
|
||||
NetworkImage(
|
||||
url = "https://lobste.rs/${user.avatarUrl}",
|
||||
placeholder = ClawIcons.Account,
|
||||
placeholder = rememberVectorPainter(Icons.Filled.AccountCircle),
|
||||
contentDescription = "Avatar of ${user.username}",
|
||||
modifier = Modifier.requiredSize(120.dp).clip(CircleShape),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue