diff --git a/composeApp/src/commonMain/kotlin/App.kt b/composeApp/src/commonMain/kotlin/App.kt index bd8d43c8..f8254fa7 100644 --- a/composeApp/src/commonMain/kotlin/App.kt +++ b/composeApp/src/commonMain/kotlin/App.kt @@ -64,7 +64,7 @@ fun App() { val toaster = rememberToasterState() - var isRoundedIcons by remember { mutableStateOf(false) } + var isRoundedIcons by remember { mutableStateOf(true) } var mode by remember { mutableStateOf(IconMode.Outline) } var query by remember { mutableStateOf("") } val icons = remember(mode, query, isRoundedIcons) { @@ -86,6 +86,9 @@ fun App() { } } + icons + } + val filteredIcons = remember(query, icons) { icons.fastFilter { it.name.contains(query, ignoreCase = true) } @@ -160,27 +163,21 @@ fun App() { query = query, mode = mode, onChangeMode = { mode = it }, - isNotFound = icons.isEmpty(), + isNotFound = filteredIcons.isEmpty(), isRoundedIcons = isRoundedIcons, onChangeRoundedIcons = { isRoundedIcons = it } ) } items( - items = icons, + items = filteredIcons, key = { it.name } ) { Box( contentAlignment = Alignment.Center, - modifier = Modifier + modifier = iconBoxModifier + .clickable { copyIcon(it) } .animateItemPlacement() - .requiredSize(36.dp) - .clip(RoundedCornerShape(6.dp)) - .background(iconCardColor) - .clickable { - copyIcon(it) - } - .pointerHoverIcon(PointerIcon.Hand) ) { Icon( painter = rememberVectorPainter(it), @@ -197,3 +194,9 @@ fun App() { val iconColor = Color(0xffffffff) val iconCardColor = Color(0xff2d2d2d) + +private val iconBoxModifier = Modifier + .requiredSize(36.dp) + .clip(RoundedCornerShape(6.dp)) + .background(iconCardColor) + .pointerHoverIcon(PointerIcon.Hand) diff --git a/rounded/build.gradle.kts b/rounded/build.gradle.kts index ed4ab086..5282f522 100644 --- a/rounded/build.gradle.kts +++ b/rounded/build.gradle.kts @@ -20,19 +20,6 @@ android { consumerProguardFiles("consumer-rules.pro") } - buildFeatures { - compose = true - } - - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - } - } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 @@ -40,6 +27,7 @@ android { } kotlin { + jvmToolchain(17) jvm("desktop") @OptIn(ExperimentalWasmDsl::class) @@ -48,7 +36,7 @@ kotlin { browser { commonWebpackConfig { - outputFileName = "rounded.js" + outputFileName = "icons.js" } } @@ -56,6 +44,7 @@ kotlin { } androidTarget { + publishLibraryVariants("release") @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_17) @@ -64,8 +53,8 @@ kotlin { sourceSets { commonMain.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) + api(compose.runtime) + api(compose.foundation) } } } \ No newline at end of file diff --git a/straight/build.gradle.kts b/straight/build.gradle.kts index 8a01dd85..5e82e575 100644 --- a/straight/build.gradle.kts +++ b/straight/build.gradle.kts @@ -20,19 +20,6 @@ android { consumerProguardFiles("consumer-rules.pro") } - buildFeatures { - compose = true - } - - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - } - } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 @@ -40,6 +27,7 @@ android { } kotlin { + jvmToolchain(17) jvm("desktop") @OptIn(ExperimentalWasmDsl::class) @@ -56,6 +44,7 @@ kotlin { } androidTarget { + publishLibraryVariants("release") @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_17) @@ -64,8 +53,8 @@ kotlin { sourceSets { commonMain.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) + api(compose.runtime) + api(compose.foundation) } } } \ No newline at end of file