Skip to content

Commit

Permalink
release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
localhostov committed Jun 2, 2024
1 parent 6bd6039 commit e731724
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 42 deletions.
25 changes: 14 additions & 11 deletions composeApp/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -86,6 +86,9 @@ fun App() {
}
}

icons
}
val filteredIcons = remember(query, icons) {
icons.fastFilter {
it.name.contains(query, ignoreCase = true)
}
Expand Down Expand Up @@ -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),
Expand All @@ -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)
21 changes: 5 additions & 16 deletions rounded/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,14 @@ 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
}
}

kotlin {
jvmToolchain(17)
jvm("desktop")

@OptIn(ExperimentalWasmDsl::class)
Expand All @@ -48,14 +36,15 @@ kotlin {

browser {
commonWebpackConfig {
outputFileName = "rounded.js"
outputFileName = "icons.js"
}
}

binaries.executable()
}

androidTarget {
publishLibraryVariants("release")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
Expand All @@ -64,8 +53,8 @@ kotlin {

sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
api(compose.runtime)
api(compose.foundation)
}
}
}
19 changes: 4 additions & 15 deletions straight/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,14 @@ 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
}
}

kotlin {
jvmToolchain(17)
jvm("desktop")

@OptIn(ExperimentalWasmDsl::class)
Expand All @@ -56,6 +44,7 @@ kotlin {
}

androidTarget {
publishLibraryVariants("release")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
Expand All @@ -64,8 +53,8 @@ kotlin {

sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
api(compose.runtime)
api(compose.foundation)
}
}
}

0 comments on commit e731724

Please sign in to comment.