From 8a75f01d61fc0d0df6091bfdb056cf2497a50a47 Mon Sep 17 00:00:00 2001 From: Younes Charfaoui Date: Mon, 16 Dec 2024 20:53:11 +0100 Subject: [PATCH] Updating Package to Kotlin 2.1 + Fixing Copy Issue in Tarka Icons (#259) * Updating Kotlin version. * Updating Compose version. * Added needed visibility annotation to prevent error. * Updating the fluent system icons * Updating gradle version * Updating the version of tarka icons * Fixing the class by removing uneeded modifier of data. * Updating the deps versions. * Using new TarkaIcon with custom icon. * Making the constructor public and using data class again. * Updating the versions. --- .idea/kotlinc.xml | 2 +- .idea/runConfigurations.xml | 4 ++++ build.gradle.kts | 10 +++++----- example/build.gradle.kts | 15 +++++++++++---- .../com/tarkalabs/ui/UIComponentListActivity.kt | 8 +++++++- gradle/wrapper/gradle-wrapper.properties | 2 +- tarka-ui-icons/build.gradle.kts | 6 +++--- .../java/com/tarkalabs/tarkaui/icons/TarkaIcon.kt | 9 +++------ tarka-ui/build.gradle.kts | 13 +++++++++---- 9 files changed, 44 insertions(+), 25 deletions(-) diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index c224ad56..bb449370 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml index 931b96c3..16660f1d 100644 --- a/.idea/runConfigurations.xml +++ b/.idea/runConfigurations.xml @@ -5,8 +5,12 @@ diff --git a/build.gradle.kts b/build.gradle.kts index 16297046..9d3838e6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,12 +5,12 @@ buildscript { } plugins { - id("com.android.application") version "8.7.1" apply false - id("com.android.library") version "8.7.1" apply false - id("org.jetbrains.kotlin.android") version "2.0.21" apply false - id("com.vanniktech.maven.publish") version "0.27.0" + id("com.android.application") version "8.7.3" apply false + id("com.android.library") version "8.7.3" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("com.vanniktech.maven.publish") version "0.28.0" id("org.jetbrains.dokka") version "1.9.20" apply false - id("org.jetbrains.kotlin.plugin.compose") version "2.0.21" apply false + id("org.jetbrains.kotlin.plugin.compose") version "2.1.0" apply false } subprojects { diff --git a/example/build.gradle.kts b/example/build.gradle.kts index 09fd536c..d3dfcd0d 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -43,10 +43,16 @@ android { } dependencies { - implementation(project(":tarka-ui")) - implementation(platform("androidx.compose:compose-bom:2024.10.00")) - implementation("com.tarkalabs:tarkaui-icons:1.0.5") - implementation("com.microsoft.design:fluent-system-icons:1.1.261@aar") + // Using the local tarka ui + //implementation(project(":tarka-ui")) + //implementation(project(":tarka-ui-icons")) + + // Using the real package of tarka ui + implementation("com.tarkalabs:tarkaui:1.2.21") + implementation("com.tarkalabs:tarkaui-icons:1.0.10") + + implementation(platform("androidx.compose:compose-bom:2024.11.00")) + implementation("com.microsoft.design:fluent-system-icons:1.1.266@aar") implementation("androidx.core:core-ktx:1.10.0") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") implementation("androidx.activity:activity-compose:1.7.1") @@ -55,6 +61,7 @@ dependencies { implementation ("androidx.compose.material3:material3:1.2.0") testImplementation("junit:junit:4.13.2") + androidTestImplementation(platform("androidx.compose:compose-bom:2024.11.00")) androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") androidTestImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0") diff --git a/example/src/main/java/com/tarkalabs/ui/UIComponentListActivity.kt b/example/src/main/java/com/tarkalabs/ui/UIComponentListActivity.kt index 2cfbe237..407950ec 100644 --- a/example/src/main/java/com/tarkalabs/ui/UIComponentListActivity.kt +++ b/example/src/main/java/com/tarkalabs/ui/UIComponentListActivity.kt @@ -15,12 +15,14 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import com.tarkalabs.tarkaui.components.TUIAppTopBar import com.tarkalabs.tarkaui.components.TUISearchBar import com.tarkalabs.tarkaui.icons.BarcodeScanner24 import com.tarkalabs.tarkaui.icons.ChevronRight20 import com.tarkalabs.tarkaui.icons.Dismiss16 +import com.tarkalabs.tarkaui.icons.TarkaIcon import com.tarkalabs.tarkaui.icons.TarkaIcons.Filled import com.tarkalabs.tarkaui.icons.TarkaIcons.Regular import com.tarkalabs.tarkaui.theme.TUITheme @@ -47,7 +49,11 @@ class UIComponentListActivity : ComponentActivity() { navigationIcon = Regular.ChevronRight20, menuItemIconOne = Regular.ChevronRight20, menuItemIconTwo = Regular.ChevronRight20, - menuItemIconThree = Regular.ChevronRight20, + menuItemIconThree = TarkaIcon( + iconRes = R.drawable.ic_refresh, + contentDescription = "Refresh", + tintColor = Color.Red + ), ) }) { paddingValues -> Column( diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b4324de0..308b9cd0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Apr 06 13:09:30 IST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/tarka-ui-icons/build.gradle.kts b/tarka-ui-icons/build.gradle.kts index fe3da67c..b4fa6fcd 100644 --- a/tarka-ui-icons/build.gradle.kts +++ b/tarka-ui-icons/build.gradle.kts @@ -65,7 +65,7 @@ publishing { register("gpr") { groupId = "com.tarkalabs" artifactId = "tarkaui-icons" - version = "1.0.6" + version = "1.0.10" artifact("${layout.buildDirectory.get()}/outputs/aar/tarka-ui-icons-release.aar") } } @@ -74,10 +74,10 @@ publishing { dependencies { implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.appcompat:appcompat:1.7.0") - implementation(platform("androidx.compose:compose-bom:2024.10.00")) + implementation(platform("androidx.compose:compose-bom:2024.11.00")) implementation("androidx.compose.runtime:runtime") implementation("androidx.compose.ui:ui") - api("com.microsoft.design:fluent-system-icons:1.1.261@aar") + api("com.microsoft.design:fluent-system-icons:1.1.266@aar") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") diff --git a/tarka-ui-icons/src/main/java/com/tarkalabs/tarkaui/icons/TarkaIcon.kt b/tarka-ui-icons/src/main/java/com/tarkalabs/tarkaui/icons/TarkaIcon.kt index 3a40301e..e6201540 100644 --- a/tarka-ui-icons/src/main/java/com/tarkalabs/tarkaui/icons/TarkaIcon.kt +++ b/tarka-ui-icons/src/main/java/com/tarkalabs/tarkaui/icons/TarkaIcon.kt @@ -5,14 +5,11 @@ import androidx.compose.runtime.Immutable import androidx.compose.ui.graphics.Color @Immutable -data class TarkaIcon internal constructor( +data class TarkaIcon public constructor( @DrawableRes val iconRes: Int, val contentDescription: String, - val tintColor: Color? = null, -){ - fun copy(contentDescription: String): TarkaIcon { - return TarkaIcon(this.iconRes, contentDescription) - } + val tintColor: Color? = null +) { override fun equals(other: Any?): Boolean { if (this === other) return true diff --git a/tarka-ui/build.gradle.kts b/tarka-ui/build.gradle.kts index fe8e84df..3620f5ab 100644 --- a/tarka-ui/build.gradle.kts +++ b/tarka-ui/build.gradle.kts @@ -82,7 +82,7 @@ publishing { create("gpr") { groupId = "com.tarkalabs" artifactId = "tarkaui" - version = "1.2.0" + version = "1.2.21" artifact("${layout.buildDirectory.get()}/outputs/aar/tarka-ui-release.aar") } } @@ -90,19 +90,24 @@ publishing { dependencies { implementation("androidx.core:core-ktx:1.13.1") - implementation(platform("androidx.compose:compose-bom:2024.10.00")) + implementation(platform("androidx.compose:compose-bom:2024.11.00")) implementation("androidx.compose.ui:ui") implementation("androidx.compose.ui:ui-tooling-preview") implementation("androidx.compose.material3:material3:1.2.1") implementation("androidx.compose.foundation:foundation") - api("com.tarkalabs:tarkaui-icons:1.0.6") + // Using the local tarka icons + //api(project(":tarka-ui-icons")) + + // Using the real package tarka icons + api("com.tarkalabs:tarkaui-icons:1.0.10") implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.8") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") androidTestImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0") - api("com.microsoft.design:fluent-system-icons:1.1.261@aar") + api("com.microsoft.design:fluent-system-icons:1.1.266@aar") + androidTestImplementation(platform("androidx.compose:compose-bom:2024.11.00")) androidTestImplementation("androidx.compose.ui:ui-test-junit4") androidTestImplementation("org.mockito:mockito-android:4.5.1") debugImplementation("androidx.compose.ui:ui-test-manifest")