Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove material icons extended #418

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ androidx-core = "androidx.core:core-ktx:1.10.1"

composeAndroid-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "composeAndroid-compiler" }
composeAndroid-material = { module = "androidx.compose.material:material" }
composeAndroid-materialIconsExtended = { module = "androidx.compose.material:material-icons-extended" }

buildscript-android = { module = "com.android.tools.build:gradle", version.ref = "agp" }
buildscript-androidCacheFix = { module = "gradle.plugin.org.gradle.android:android-cache-fix-gradle-plugin", version = "2.7.2" }
Expand Down
35 changes: 35 additions & 0 deletions samples/icons/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode

plugins {
id("com.eygraber.conventions-kotlin-multiplatform")
id("com.eygraber.conventions-android-library")
id("com.eygraber.conventions-compose-jetbrains")
id("com.eygraber.conventions-detekt")
}

group = "samples-icons"

android {
namespace = "com.eygraber.portal.samples.icons"
}

kotlin {
kmpTargets(
project = project,
android = true,
jvm = true,
js = true
)

sourceSets {
commonMain {
dependencies {
implementation(compose.material)
}
}
}
}

gradleConventions.kotlin {
explicitApiMode = ExplicitApiMode.Disabled
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.eygraber.portal.samples.icons

import androidx.compose.ui.graphics.vector.ImageVector

val Icons.Alarm: ImageVector by lazy {
materialIcon(name = "Filled.Alarm") {
materialPath {
moveTo(22.0f, 5.72f)
lineToRelative(-4.6f, -3.86f)
lineToRelative(-1.29f, 1.53f)
lineToRelative(4.6f, 3.86f)
lineTo(22.0f, 5.72f)
close()
moveTo(7.88f, 3.39f)
lineTo(6.6f, 1.86f)
lineTo(2.0f, 5.71f)
lineToRelative(1.29f, 1.53f)
lineToRelative(4.59f, -3.85f)
close()
moveTo(12.5f, 8.0f)
lineTo(11.0f, 8.0f)
verticalLineToRelative(6.0f)
lineToRelative(4.75f, 2.85f)
lineToRelative(0.75f, -1.23f)
lineToRelative(-4.0f, -2.37f)
lineTo(12.5f, 8.0f)
close()
moveTo(12.0f, 4.0f)
curveToRelative(-4.97f, 0.0f, -9.0f, 4.03f, -9.0f, 9.0f)
reflectiveCurveToRelative(4.02f, 9.0f, 9.0f, 9.0f)
curveToRelative(4.97f, 0.0f, 9.0f, -4.03f, 9.0f, -9.0f)
reflectiveCurveToRelative(-4.03f, -9.0f, -9.0f, -9.0f)
close()
moveTo(12.0f, 20.0f)
curveToRelative(-3.87f, 0.0f, -7.0f, -3.13f, -7.0f, -7.0f)
reflectiveCurveToRelative(3.13f, -7.0f, 7.0f, -7.0f)
reflectiveCurveToRelative(7.0f, 3.13f, 7.0f, 7.0f)
reflectiveCurveToRelative(-3.13f, 7.0f, -7.0f, 7.0f)
close()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.eygraber.portal.samples.icons

import androidx.compose.ui.graphics.vector.ImageVector

val Icons.ArrowBack: ImageVector by lazy {
materialIcon(name = "Filled.ArrowBack") {
materialPath {
moveTo(20.0f, 11.0f)
horizontalLineTo(7.83f)
lineToRelative(5.59f, -5.59f)
lineTo(12.0f, 4.0f)
lineToRelative(-8.0f, 8.0f)
lineToRelative(8.0f, 8.0f)
lineToRelative(1.41f, -1.41f)
lineTo(7.83f, 13.0f)
horizontalLineTo(20.0f)
verticalLineToRelative(-2.0f)
close()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.eygraber.portal.samples.icons

import androidx.compose.ui.graphics.vector.ImageVector

val Icons.FeaturedVideo: ImageVector by lazy {
materialIcon(name = "Filled.FeaturedVideo") {
materialPath {
moveTo(21.0f, 3.0f)
lineTo(3.0f, 3.0f)
curveToRelative(-1.1f, 0.0f, -2.0f, 0.9f, -2.0f, 2.0f)
verticalLineToRelative(14.0f)
curveToRelative(0.0f, 1.1f, 0.9f, 2.0f, 2.0f, 2.0f)
horizontalLineToRelative(18.0f)
curveToRelative(1.1f, 0.0f, 2.0f, -0.9f, 2.0f, -2.0f)
lineTo(23.0f, 5.0f)
curveToRelative(0.0f, -1.1f, -0.9f, -2.0f, -2.0f, -2.0f)
close()
moveTo(12.0f, 12.0f)
lineTo(3.0f, 12.0f)
lineTo(3.0f, 5.0f)
horizontalLineToRelative(9.0f)
verticalLineToRelative(7.0f)
close()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.eygraber.portal.samples.icons

import androidx.compose.ui.graphics.vector.ImageVector

val Icons.Home: ImageVector by lazy {
materialIcon(name = "Filled.Home") {
materialPath {
moveTo(10.0f, 20.0f)
verticalLineToRelative(-6.0f)
horizontalLineToRelative(4.0f)
verticalLineToRelative(6.0f)
horizontalLineToRelative(5.0f)
verticalLineToRelative(-8.0f)
horizontalLineToRelative(3.0f)
lineTo(12.0f, 3.0f)
lineTo(2.0f, 12.0f)
horizontalLineToRelative(3.0f)
verticalLineToRelative(8.0f)
close()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.eygraber.portal.samples.icons

import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.StrokeJoin
import androidx.compose.ui.graphics.vector.DefaultFillType
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.PathBuilder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.unit.dp

object Icons

inline fun materialIcon(
name: String,
block: ImageVector.Builder.() -> ImageVector.Builder
): ImageVector = ImageVector.Builder(
name = name,
defaultWidth = 24.dp,
defaultHeight = 24.dp,
viewportWidth = 24F,
viewportHeight = 24F
).block().build()

inline fun ImageVector.Builder.materialPath(
fillAlpha: Float = 1f,
strokeAlpha: Float = 1f,
pathFillType: PathFillType = DefaultFillType,
pathBuilder: PathBuilder.() -> Unit
) = path(
fill = SolidColor(Color.Black),
fillAlpha = fillAlpha,
stroke = null,
strokeAlpha = strokeAlpha,
strokeLineWidth = 1f,
strokeLineCap = StrokeCap.Butt,
strokeLineJoin = StrokeJoin.Bevel,
strokeLineMiter = 1f,
pathFillType = pathFillType,
pathBuilder = pathBuilder
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.eygraber.portal.samples.icons

import androidx.compose.ui.graphics.vector.ImageVector

val Icons.Restaurant: ImageVector by lazy {
materialIcon(name = "Filled.Restaurant") {
materialPath {
moveTo(11.0f, 9.0f)
lineTo(9.0f, 9.0f)
lineTo(9.0f, 2.0f)
lineTo(7.0f, 2.0f)
verticalLineToRelative(7.0f)
lineTo(5.0f, 9.0f)
lineTo(5.0f, 2.0f)
lineTo(3.0f, 2.0f)
verticalLineToRelative(7.0f)
curveToRelative(0.0f, 2.12f, 1.66f, 3.84f, 3.75f, 3.97f)
lineTo(6.75f, 22.0f)
horizontalLineToRelative(2.5f)
verticalLineToRelative(-9.03f)
curveTo(11.34f, 12.84f, 13.0f, 11.12f, 13.0f, 9.0f)
lineTo(13.0f, 2.0f)
horizontalLineToRelative(-2.0f)
verticalLineToRelative(7.0f)
close()
moveTo(16.0f, 6.0f)
verticalLineToRelative(8.0f)
horizontalLineToRelative(2.5f)
verticalLineToRelative(8.0f)
lineTo(21.0f, 22.0f)
lineTo(21.0f, 2.0f)
curveToRelative(-2.76f, 0.0f, -5.0f, 2.24f, -5.0f, 4.0f)
close()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.eygraber.portal.samples.icons

import androidx.compose.ui.graphics.vector.ImageVector

val Icons.WhatsHot: ImageVector by lazy {
materialIcon(name = "Filled.Whatshot") {
materialPath {
moveTo(13.5f, 0.67f)
reflectiveCurveToRelative(0.74f, 2.65f, 0.74f, 4.8f)
curveToRelative(0.0f, 2.06f, -1.35f, 3.73f, -3.41f, 3.73f)
curveToRelative(-2.07f, 0.0f, -3.63f, -1.67f, -3.63f, -3.73f)
lineToRelative(0.03f, -0.36f)
curveTo(5.21f, 7.51f, 4.0f, 10.62f, 4.0f, 14.0f)
curveToRelative(0.0f, 4.42f, 3.58f, 8.0f, 8.0f, 8.0f)
reflectiveCurveToRelative(8.0f, -3.58f, 8.0f, -8.0f)
curveTo(20.0f, 8.61f, 17.41f, 3.8f, 13.5f, 0.67f)
close()
moveTo(11.71f, 19.0f)
curveToRelative(-1.78f, 0.0f, -3.22f, -1.4f, -3.22f, -3.14f)
curveToRelative(0.0f, -1.62f, 1.05f, -2.76f, 2.81f, -3.12f)
curveToRelative(1.77f, -0.36f, 3.6f, -1.21f, 4.62f, -2.58f)
curveToRelative(0.39f, 1.29f, 0.59f, 2.65f, 0.59f, 4.04f)
curveToRelative(0.0f, 2.65f, -2.15f, 4.8f, -4.8f, 4.8f)
close()
}
}
}
1 change: 0 additions & 1 deletion samples/kotlin-inject/android-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ dependencies {
implementation(projects.samples.kotlinInject.shared)

implementation(libs.composeAndroid.material)
implementation(libs.composeAndroid.materialIconsExtended)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.appcompat)
Expand Down
2 changes: 1 addition & 1 deletion samples/kotlin-inject/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ kotlin {
commonMain {
dependencies {
implementation(projects.portalCompose)
implementation(projects.samples.icons)

implementation(compose.material)
implementation(compose.materialIconsExtended)

implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.datetime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import androidx.compose.material.IconButton
import androidx.compose.material.Surface
import androidx.compose.material.Switch
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.eygraber.portal.samples.icons.ArrowBack
import com.eygraber.portal.samples.icons.Icons
import com.eygraber.portal.samples.kotlin.inject.View
import me.tatarka.inject.annotations.Inject

Expand All @@ -40,7 +40,7 @@ class AlarmListView(
onClick = { vm.backClicked() }
) {
Icon(
imageVector = Icons.Filled.ArrowBack,
imageVector = Icons.ArrowBack,
contentDescription = "Back"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Button
import androidx.compose.material.Icon
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Alarm
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.eygraber.portal.samples.icons.Alarm
import com.eygraber.portal.samples.icons.Icons
import com.eygraber.portal.samples.kotlin.inject.View
import me.tatarka.inject.annotations.Inject

Expand All @@ -27,7 +27,7 @@ class HomeView(
onClick = vm::openAlarmsClicked
) {
Icon(
imageVector = Icons.Filled.Alarm,
imageVector = Icons.Alarm,
contentDescription = "Open alarm list"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.darkColors
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.FeaturedVideo
import androidx.compose.material.icons.filled.Home
import androidx.compose.material.icons.filled.Restaurant
import androidx.compose.material.icons.filled.Whatshot
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import com.eygraber.portal.compose.ComposePortalManager
import com.eygraber.portal.samples.icons.FeaturedVideo
import com.eygraber.portal.samples.icons.Home
import com.eygraber.portal.samples.icons.Icons
import com.eygraber.portal.samples.icons.Restaurant
import com.eygraber.portal.samples.icons.WhatsHot
import com.eygraber.portal.samples.kotlin.inject.View
import me.tatarka.inject.annotations.Inject

Expand Down Expand Up @@ -84,22 +84,22 @@ class MainView(
.weight(.10F)
) {
BottomNavIcon(
icon = Icons.Filled.Home,
icon = Icons.Home,
onClick = vm::handle1Clicked
)

BottomNavIcon(
icon = Icons.Filled.Whatshot,
icon = Icons.WhatsHot,
onClick = vm::handle2Clicked
)

BottomNavIcon(
icon = Icons.Filled.Restaurant,
icon = Icons.Restaurant,
onClick = vm::handle3Clicked
)

BottomNavIcon(
icon = Icons.Filled.FeaturedVideo,
icon = Icons.FeaturedVideo,
onClick = vm::handle4Clicked
)
}
Expand Down
2 changes: 1 addition & 1 deletion samples/portal/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ group = "samples-portal"
dependencies {
implementation(projects.portalCompose)
implementation(projects.portalKodeinDi)
implementation(projects.samples.icons)

implementation(compose.material)
implementation(compose.materialIconsExtended)
implementation(compose.desktop.currentOs)

implementation(libs.kodein.core)
Expand Down
Loading