Skip to content

Commit e3fdd2c

Browse files
committed
Remove material-icons-core dependency, eliminate m3 dependency
1 parent b614530 commit e3fdd2c

4 files changed

Lines changed: 51 additions & 3 deletions

File tree

components/ir-compose/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ kotlin {
88
commonMain.dependencies {
99
api(projects.components.ir)
1010

11-
implementation(compose.material3)
1211
implementation(compose.ui)
1312
}
1413
}

components/parser/ktfile/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies {
3333
implementation(projects.components.psi.imagevector)
3434

3535
implementation(compose.ui)
36-
implementation(libs.material.icons.core)
3736

3837
testImplementation(libs.bundles.test)
3938
testRuntimeOnly(libs.junit.launcher)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package androidx.compose.material.icons
2+
3+
import androidx.compose.ui.graphics.Color
4+
import androidx.compose.ui.graphics.PathFillType
5+
import androidx.compose.ui.graphics.SolidColor
6+
import androidx.compose.ui.graphics.StrokeCap
7+
import androidx.compose.ui.graphics.StrokeJoin
8+
import androidx.compose.ui.graphics.vector.DefaultFillType
9+
import androidx.compose.ui.graphics.vector.ImageVector
10+
import androidx.compose.ui.graphics.vector.PathBuilder
11+
import androidx.compose.ui.graphics.vector.path
12+
import androidx.compose.ui.unit.dp
13+
14+
/**
15+
* Internal helper functions since Compose 1.8, added to test only
16+
*/
17+
18+
inline fun materialIcon(
19+
name: String,
20+
autoMirror: Boolean = false,
21+
block: ImageVector.Builder.() -> ImageVector.Builder,
22+
): ImageVector = ImageVector.Builder(
23+
name = name,
24+
defaultWidth = MaterialIconDimension.dp,
25+
defaultHeight = MaterialIconDimension.dp,
26+
viewportWidth = MaterialIconDimension,
27+
viewportHeight = MaterialIconDimension,
28+
autoMirror = autoMirror,
29+
).block().build()
30+
31+
inline fun ImageVector.Builder.materialPath(
32+
fillAlpha: Float = 1f,
33+
strokeAlpha: Float = 1f,
34+
pathFillType: PathFillType = DefaultFillType,
35+
pathBuilder: PathBuilder.() -> Unit,
36+
) = path(
37+
fill = SolidColor(Color.Black),
38+
fillAlpha = fillAlpha,
39+
stroke = null,
40+
strokeAlpha = strokeAlpha,
41+
strokeLineWidth = 1f,
42+
strokeLineCap = StrokeCap.Butt,
43+
strokeLineJoin = StrokeJoin.Bevel,
44+
strokeLineMiter = 1f,
45+
pathFillType = pathFillType,
46+
pathBuilder = pathBuilder,
47+
)
48+
49+
@PublishedApi
50+
@Suppress("ktlint:standard:property-naming")
51+
internal const val MaterialIconDimension = 24f

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ highlights = "dev.snipme:highlights:1.0.0"
99
kotlinpoet = "com.squareup:kotlinpoet:2.1.0"
1010
leviathan = "io.github.composegears:leviathan:2.0.0"
1111
leviathan-compose = "io.github.composegears:leviathan-compose:2.0.0"
12-
material-icons-core = { module = "org.jetbrains.compose.material:material-icons-core", version.ref = "compose" }
1312
tiamat = "io.github.composegears:tiamat:1.5.0"
1413
xpp3 = "org.ogce:xpp3:1.1.6"
1514

0 commit comments

Comments
 (0)