refactor: switch to Material Icons
Our previous system resulted in leaner code but was way too annoying to add new icons to.
|
@ -38,6 +38,7 @@ dependencies {
|
|||
implementation(libs.androidx.browser)
|
||||
implementation(libs.androidx.compose.animation)
|
||||
implementation(libs.androidx.compose.foundation)
|
||||
implementation(libs.androidx.compose.material.icons.extended)
|
||||
implementation(libs.androidx.compose.material3)
|
||||
implementation(libs.androidx.compose.runtime)
|
||||
implementation(libs.androidx.compose.ui.text)
|
||||
|
|
|
@ -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),
|
||||
)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M12,6c1.93,0,3.5,1.57,3.5,3.5S13.93,13,12,13 s-3.5-1.57-3.5-3.5S10.07,6,12,6z M12,20c-2.03,0-4.43-0.82-6.14-2.88C7.55,15.8,9.68,15,12,15s4.45,0.8,6.14,2.12 C16.43,19.18,14.03,20,12,20z"/></g></svg>
|
Before Width: | Height: | Size: 461 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>
|
Before Width: | Height: | Size: 217 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"/></svg>
|
Before Width: | Height: | Size: 301 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>
|
Before Width: | Height: | Size: 333 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/></svg>
|
Before Width: | Height: | Size: 502 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-4.51 2.11l.26 2.79-2.74.62-1.43 2.41L12 18.82l-2.58 1.11-1.43-2.41-2.74-.62.26-2.8L3.66 12l1.85-2.12-.26-2.78 2.74-.61 1.43-2.41L12 5.18l2.58-1.11 1.43 2.41 2.74.62-.26 2.79L20.34 12l-1.85 2.11zM11 15h2v2h-2zm0-8h2v6h-2z"/></svg>
|
Before Width: | Height: | Size: 558 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>
|
Before Width: | Height: | Size: 365 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-.61.08-1.21.21-1.78L8.99 15v1c0 1.1.9 2 2 2v1.93C7.06 19.43 4 16.07 4 12zm13.89 5.4c-.26-.81-1-1.4-1.9-1.4h-1v-3c0-.55-.45-1-1-1h-6v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41C17.92 5.77 20 8.65 20 12c0 2.08-.81 3.98-2.11 5.4z"/></svg>
|
Before Width: | Height: | Size: 460 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M11.57 13.16c-1.36.28-2.17 1.16-2.17 2.41 0 1.34 1.11 2.42 2.49 2.42 2.05 0 3.71-1.66 3.71-3.71 0-1.07-.15-2.12-.46-3.12-.79 1.07-2.2 1.72-3.57 2zM13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM12 20c-3.31 0-6-2.69-6-6 0-1.53.3-3.04.86-4.43 1.01 1.01 2.41 1.63 3.97 1.63 2.66 0 4.75-1.83 5.28-4.43C17.34 8.97 18 11.44 18 14c0 3.31-2.69 6-6 6z"/></svg>
|
Before Width: | Height: | Size: 619 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"/></svg>
|
Before Width: | Height: | Size: 462 B |