Skip to content

Commit

Permalink
Merge pull request #3 from Taewan-P/refactor/xml-to-imagevector
Browse files Browse the repository at this point in the history
Update Dynamic SVG based xml to ImageVector
  • Loading branch information
Taewan-P authored Jun 24, 2024
2 parents 095c9b6 + 42f54c3 commit e89ac5f
Show file tree
Hide file tree
Showing 19 changed files with 793 additions and 146 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ dependencies {
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.material)

// SplashScreen
implementation(libs.splashscreen)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.chungjungsoo.gptmobile.data.model

enum class DynamicTheme(mode: Int) {
ON(1),
OFF(0);
enum class DynamicTheme {
ON,
OFF;

companion object {
fun getByValue(value: Int) = entries.firstOrNull { it.ordinal == value }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dev.chungjungsoo.gptmobile.data.model

enum class ThemeMode(mode: Int) {
SYSTEM(0),
DARK(1),
LIGHT(2);
enum class ThemeMode {
SYSTEM,
DARK,
LIGHT;

companion object {
fun getByValue(value: Int) = entries.firstOrNull { it.ordinal == value }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package dev.chungjungsoo.gptmobile.presentation.icons

import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.unit.dp

val Done: ImageVector
// It should be recomposed when theme is changed. So calculate every time (Expensive, but only used in setup complete screen)
@Composable
get() {
return Builder(
name = "IcDone",
defaultWidth = 48.0.dp,
defaultHeight = 48.0.dp,
viewportWidth = 960.0f,
viewportHeight = 960.0f
).apply {
path(
fill = SolidColor(MaterialTheme.colorScheme.primary),
stroke = null,
strokeLineWidth = 0.0f,
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveToRelative(421.0f, 571.0f)
lineToRelative(-98.0f, -98.0f)
quadToRelative(-9.0f, -9.0f, -22.0f, -9.0f)
reflectiveQuadToRelative(-23.0f, 10.0f)
quadToRelative(-9.0f, 9.0f, -9.0f, 22.0f)
reflectiveQuadToRelative(9.0f, 22.0f)
lineToRelative(122.0f, 123.0f)
quadToRelative(9.0f, 9.0f, 21.0f, 9.0f)
reflectiveQuadToRelative(21.0f, -9.0f)
lineToRelative(239.0f, -239.0f)
quadToRelative(10.0f, -10.0f, 10.0f, -23.0f)
reflectiveQuadToRelative(-10.0f, -23.0f)
quadToRelative(-10.0f, -9.0f, -23.5f, -8.5f)
reflectiveQuadTo(635.0f, 357.0f)
lineTo(421.0f, 571.0f)
close()
moveTo(480.0f, 880.0f)
quadToRelative(-82.0f, 0.0f, -155.0f, -31.5f)
reflectiveQuadToRelative(-127.5f, -86.0f)
quadTo(143.0f, 708.0f, 111.5f, 635.0f)
reflectiveQuadTo(80.0f, 480.0f)
quadToRelative(0.0f, -83.0f, 31.5f, -156.0f)
reflectiveQuadToRelative(86.0f, -127.0f)
quadTo(252.0f, 143.0f, 325.0f, 111.5f)
reflectiveQuadTo(480.0f, 80.0f)
quadToRelative(83.0f, 0.0f, 156.0f, 31.5f)
reflectiveQuadTo(763.0f, 197.0f)
quadToRelative(54.0f, 54.0f, 85.5f, 127.0f)
reflectiveQuadTo(880.0f, 480.0f)
quadToRelative(0.0f, 82.0f, -31.5f, 155.0f)
reflectiveQuadTo(763.0f, 762.5f)
quadToRelative(-54.0f, 54.5f, -127.0f, 86.0f)
reflectiveQuadTo(480.0f, 880.0f)
close()
moveTo(480.0f, 820.0f)
quadToRelative(142.0f, 0.0f, 241.0f, -99.5f)
reflectiveQuadTo(820.0f, 480.0f)
quadToRelative(0.0f, -142.0f, -99.0f, -241.0f)
reflectiveQuadToRelative(-241.0f, -99.0f)
quadToRelative(-141.0f, 0.0f, -240.5f, 99.0f)
reflectiveQuadTo(140.0f, 480.0f)
quadToRelative(0.0f, 141.0f, 99.5f, 240.5f)
reflectiveQuadTo(480.0f, 820.0f)
close()
moveTo(480.0f, 480.0f)
close()
}
}
.build()
}
Loading

0 comments on commit e89ac5f

Please sign in to comment.