diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 02c08c1d..db115f43 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -12,7 +12,42 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } + compileOptions { + isCoreLibraryDesugaringEnabled = true + } + buildFeatures.buildConfig = true + + buildTypes { + release { + kotlinOptions { + freeCompilerArgs += listOf( + "-Xno-param-assertions", + "-Xno-call-assertions", + "-Xno-receiver-assertions" + ) + } + + packaging { + resources { + excludes += listOf( + "DebugProbesKt.bin", + "kotlin-tooling-metadata.json", + "/*.properties", + "kotlin/**", + "junit/**", + "LICENSE-junit.txt", + "/*.proto", + "google/**", + "META-INF/*.version" + ) + } + jniLibs { + excludes += "**/libdatastore_shared_counter.so" + } + } + } + } } dependencies { @@ -20,31 +55,26 @@ dependencies { testImplementation(libs.junit) androidTestImplementation(libs.espresso.core) + coreLibraryDesugaring(libs.desugar.jdk.libs) + // Kotlin implementation(libs.kotlinx.coroutines.play.services) implementation(libs.kotlinx.coroutines.android) - implementation(libs.kotlinx.coroutines.core) // Support implementation(libs.androidx.activity.compose) - implementation(libs.androidx.activity) - implementation(libs.androidx.appcompat) - - implementation(libs.material) + implementation(libs.androidx.lifecycle.runtime) // Firebase implementation(platform(libs.firebase.bom)) implementation(libs.firebase.crashlytics.ktx) - implementation(libs.firebase.inappmessaging) implementation(libs.firebase.messaging) implementation(libs.play.services.auth) - // Image management - implementation(libs.coil.compose) - - implementation(libs.koin.android) - implementation(libs.koin.androidx.compose) + implementation(libs.koin.androidx.compose) { + exclude(group = "androidx.appcompat", module = "appcompat") + } // Used for tags implementation(project(":shared")) diff --git a/androidApp/proguard-defaults.txt b/androidApp/proguard-defaults.txt new file mode 100644 index 00000000..4f039f7c --- /dev/null +++ b/androidApp/proguard-defaults.txt @@ -0,0 +1,40 @@ +# Less conservative default ProGuard rules +-allowaccessmodification + +-dontusemixedcaseclassnames +-dontskipnonpubliclibraryclasses +-verbose + +# Preserve some attributes that may be required for reflection. +-keepattributes RuntimeVisible*Annotations, AnnotationDefault + +# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native +-keepclasseswithmembernames class * { + native ; +} + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keepclassmembers class * implements android.os.Parcelable { + public static final ** CREATOR; +} + +# Preserve annotated Javascript interface methods. +-keepclassmembers class * { + @android.webkit.JavascriptInterface ; +} + +# The support libraries contains references to newer platform versions. +# Don't warn about those in case this app is linking against an older +# platform version. We know about them, and they are safe. +-dontnote androidx.** +-dontwarn androidx.** + +# This class is deprecated, but remains for backward compatibility. +-dontwarn android.util.FloatMath + +# These classes are duplicated between android.jar and core-lambda-stubs.jar. +-dontnote java.lang.invoke.** \ No newline at end of file diff --git a/androidApp/proguard-rules.pro b/androidApp/proguard-rules.pro index 9b4c4c84..93be43ce 100644 --- a/androidApp/proguard-rules.pro +++ b/androidApp/proguard-rules.pro @@ -1,16 +1 @@ -# Glide --keep public class * implements com.bumptech.glide.module.GlideModule --keep public class * extends com.bumptech.glide.module.AppGlideModule --keep public enum com.bumptech.glide.load.ImageHeaderParser$** { - **[] $VALUES; - public *; -} - -dontwarn org.slf4j.** - --keep class fr.androidmakers.store.model.** { *; } --keep class io.openfeedback.android.model.** { *; } - --keepattributes Signature - --dontwarn com.google.ar.** \ No newline at end of file diff --git a/androidApp/src/main/AndroidManifest.xml b/androidApp/src/main/AndroidManifest.xml index e9a2fbdb..21365956 100644 --- a/androidApp/src/main/AndroidManifest.xml +++ b/androidApp/src/main/AndroidManifest.xml @@ -12,7 +12,7 @@ android:name=".AndroidMakersApplication" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true" - android:theme="@style/PreviewTheme.AndroidMakers" + android:theme="@style/Theme.AndroidMakers" tools:ignore="UnusedAttribute"> diff --git a/androidApp/src/main/java/fr/paug/androidmakers/MainActivity.kt b/androidApp/src/main/java/fr/paug/androidmakers/MainActivity.kt index 1731fd89..e914a488 100644 --- a/androidApp/src/main/java/fr/paug/androidmakers/MainActivity.kt +++ b/androidApp/src/main/java/fr/paug/androidmakers/MainActivity.kt @@ -4,10 +4,10 @@ import android.content.Intent import android.graphics.Color import android.os.Bundle import android.util.Log +import androidx.activity.ComponentActivity import androidx.activity.SystemBarStyle import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge -import androidx.appcompat.app.AppCompatActivity import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.DisposableEffect @@ -37,7 +37,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import org.koin.compose.KoinContext -class MainActivity : AppCompatActivity() { +class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/androidApp/src/main/res/values-night/themes.xml b/androidApp/src/main/res/values-night/themes.xml index edd7de06..03c8df67 100644 --- a/androidApp/src/main/res/values-night/themes.xml +++ b/androidApp/src/main/res/values-night/themes.xml @@ -1,11 +1,9 @@ - - diff --git a/androidApp/src/main/res/values-v21/themes_preview.xml b/androidApp/src/main/res/values-v21/themes_preview.xml deleted file mode 100644 index 8fd6a597..00000000 --- a/androidApp/src/main/res/values-v21/themes_preview.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/androidApp/src/main/res/values/colors.xml b/androidApp/src/main/res/values/colors.xml index c2b1fc32..6d22b57b 100644 --- a/androidApp/src/main/res/values/colors.xml +++ b/androidApp/src/main/res/values/colors.xml @@ -1,12 +1,7 @@ - #4eb6e3 - #16A6D9 - #E85145 - #ECEDEC + #FFFBFCFE + #FF191C1E - #bbbbbb - #F0F0F0 - #000000 #FFFFFF \ No newline at end of file diff --git a/androidApp/src/main/res/values/styles_preview.xml b/androidApp/src/main/res/values/styles_preview.xml deleted file mode 100644 index 64004e61..00000000 --- a/androidApp/src/main/res/values/styles_preview.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/androidApp/src/main/res/values/themes.xml b/androidApp/src/main/res/values/themes.xml index c32e5109..a13b1317 100644 --- a/androidApp/src/main/res/values/themes.xml +++ b/androidApp/src/main/res/values/themes.xml @@ -1,14 +1,9 @@ - - diff --git a/androidApp/src/main/res/values/themes_preview.xml b/androidApp/src/main/res/values/themes_preview.xml deleted file mode 100644 index f3e139ab..00000000 --- a/androidApp/src/main/res/values/themes_preview.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidApplicationPlugin.kt b/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidApplicationPlugin.kt index 263775ed..5653acb5 100644 --- a/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidApplicationPlugin.kt +++ b/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidApplicationPlugin.kt @@ -22,7 +22,6 @@ class AndroidApplicationPlugin : Plugin { apply("org.jetbrains.kotlin.android") apply("com.google.gms.google-services") apply("com.google.firebase.crashlytics") - apply("org.jetbrains.kotlin.plugin.serialization") } val extension = extensions.getByType() diff --git a/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidComposePlugin.kt b/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidComposePlugin.kt index a3765fa2..fa4262a2 100644 --- a/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidComposePlugin.kt +++ b/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/AndroidComposePlugin.kt @@ -19,10 +19,8 @@ class AndroidComposePlugin : Plugin { dependencies { add("implementation", libs.findLibrary("compose.material3").get()) - add("implementation", libs.findLibrary("compose.material").get()) add("implementation", libs.findLibrary("compose.material.icons.extended").get()) add("implementation", libs.findLibrary("compose.ui.tooling").get()) - add("implementation", libs.findLibrary("navigation.compose").get()) } } } diff --git a/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/SigningConfigPlugin.kt b/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/SigningConfigPlugin.kt index 96286a25..5619eeaf 100644 --- a/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/SigningConfigPlugin.kt +++ b/build-logic/convention/src/main/kotlin/fr/androidmakers/plugin/SigningConfigPlugin.kt @@ -38,7 +38,7 @@ class SigningConfigPlugin : Plugin { isMinifyEnabled = true isShrinkResources = true proguardFiles( - getDefaultProguardFile("proguard-android.txt"), + "proguard-defaults.txt", "proguard-rules.pro" ) if (f.exists()) { diff --git a/build.gradle.kts b/build.gradle.kts index 4e27de23..e03f581e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,6 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.kotlin.android) apply false - alias(libs.plugins.kotlin.serialization) apply false alias(libs.plugins.google.services) apply false alias(libs.plugins.kmp) apply false alias(libs.plugins.crashlytics) apply false @@ -12,5 +11,5 @@ plugins { } tasks.register("clean", Delete::class) { - delete(rootProject.buildDir) + delete(rootProject.layout.buildDirectory) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b283e9c9..4619e104 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,13 +2,14 @@ version-code = "1467" sdk-compile = "34" sdk-min = "24" -androidxActivity = "1.8.2" -androidxAppCompat = "1.6.1" +androidxActivity = "1.9.0" androidxLifecycle = "2.7.0" -apollo = "4.0.0-beta.5" -compose = "1.6.5" -android-gradle-plugin = "8.2.2" +apollo = "4.0.0-beta.2" +compose = "1.6.4" compose-compiler = "1.5.11" +compose-plugin = "1.6.2" +precompose = "1.6.0" +android-gradle-plugin = "8.2.2" kotlin = "1.9.23" coroutines = "1.8.0" material3 = "1.2.1" @@ -16,73 +17,52 @@ google-services-plugin = "4.4.1" crashlytics-plugin = "2.9.9" moko = "0.24.0-alpha-5" moko-graphics = "0.9.0" -compose-mp = "1.6.1" -datastore = "1.1.0-rc01" +datastore = "1.1.0" skie = "0.6.2" firebase = "1.12.0" koin = "3.5.6" -precompose = "1.6.0" -compose-plugin = "1.6.1" image-loader = "1.7.8" pullrefresh = "1.3.0" androidx-wear-compose = "1.3.1" playServicesWearable = "18.1.0" -compose-ui-tooling = "1.3.1" -horologist = "0.6.8" +horologist = "0.5.25" +okio = "3.9.0" [libraries] androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" } -androidx-activity = { group = "androidx.activity", name = "activity-ktx", version.ref = "androidxActivity" } -androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" } -androidx-lifecycle-runtimeCompose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidxLifecycle" } -apollo-adapters = { module = "com.apollographql.apollo3:apollo-adapters" } -apollo-normalized-cache = { module = "com.apollographql.apollo3:apollo-normalized-cache" } -apollo-normalized-cache-sqlite = { module = "com.apollographql.apollo3:apollo-normalized-cache-sqlite" } -apollo-runtime = { module = "com.apollographql.apollo3:apollo-runtime" } -atomicfu = "org.jetbrains.kotlinx:atomicfu:0.20.1" -shared-preferences = "androidx.preference:preference:1.2.1" -coil-compose = "io.coil-kt:coil-compose:2.6.0" +androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidxLifecycle" } +androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" } +apollo-adapters = { module = "com.apollographql.apollo3:apollo-adapters", version.ref = "apollo" } +apollo-normalized-cache = { module = "com.apollographql.apollo3:apollo-normalized-cache", version.ref = "apollo" } +apollo-normalized-cache-sqlite = { module = "com.apollographql.apollo3:apollo-normalized-cache-sqlite", version.ref = "apollo" } +apollo-runtime = { module = "com.apollographql.apollo3:apollo-runtime", version.ref = "apollo" } +atomicfu = "org.jetbrains.kotlinx:atomicfu:0.23.2" qdsfdhvh-imageloader = { module = "io.github.qdsfdhvh:image-loader", version.ref = "image-loader" } -compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" } +compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "compose" } compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" } -compose-material = { group = "androidx.compose.material", name = "material", version.ref = "compose" } compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } +compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } espresso-core = "androidx.test.espresso:espresso-core:3.5.1" -firebase-analytics-ktx = { module = "com.google.firebase:firebase-analytics-ktx" } -firebase-auth-ktx = { module = "com.google.firebase:firebase-auth-ktx" } firebase-bom = "com.google.firebase:firebase-bom:32.8.1" firebase-crashlytics-ktx = { module = "com.google.firebase:firebase-crashlytics-ktx" } -firebase-inappmessaging = { module = "com.google.firebase:firebase-inappmessaging-display-ktx" } firebase-messaging = { module = "com.google.firebase:firebase-messaging" } -google-services = "com.google.gms:google-services:4.4.1" -graphql-kotlin-spring-server = "com.expediagroup:graphql-kotlin-spring-server:7.0.2" junit = "junit:junit:4.13.2" -kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } -kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "coroutines" } kotlinx-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.5.0" -kotlinx-serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3" -lifecycle-runtime-ktx = "androidx.lifecycle:lifecycle-runtime-ktx:2.7.0" -lifecycle-viewmodel-compose = "androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0" -material = "com.google.android.material:material:1.11.0" -navigation-compose = "androidx.navigation:navigation-compose:2.7.7" openfeedback-m3 = "io.openfeedback:openfeedback-m3:0.2.2" -play-services-auth = "com.google.android.gms:play-services-auth:21.0.0" +play-services-auth = "com.google.android.gms:play-services-auth:21.1.0" moko-resources = { module = "dev.icerock.moko:resources", version.ref = "moko" } moko-compose = { module = "dev.icerock.moko:resources-compose", version.ref = "moko" } moko-graphics = { module = "dev.icerock.moko:graphics", version.ref = "moko-graphics" } -compose-mp-icons = { module = "org.jetbrains.compose.material:material-icons-extended-desktop", version.ref = "compose-mp" } androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" } androidx-datastore-preferences-core = { group = "androidx.datastore", name = "datastore-preferences-core", version.ref = "datastore" } -firebase-installations = { module = "dev.gitlive:firebase-installations", version.ref = "firebase" } firebase-auth = { module = "dev.gitlive:firebase-auth", version.ref = "firebase" } precompose = { module = "moe.tlaster:precompose", version.ref = "precompose" } precompose-viewmodel = { module = "moe.tlaster:precompose-viewmodel", version.ref = "precompose" } precompose-koin = { module = "moe.tlaster:precompose-koin", version.ref = "precompose" } -koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" } koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin" } koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } @@ -90,28 +70,27 @@ android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", ver firebase-crashlytics-gradlePlugin = { group = "com.google.firebase", name = "firebase-crashlytics-gradle", version.ref = "crashlytics-plugin" } kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } materii-pullrefresh = { group = "dev.materii.pullrefresh", name = "pullrefresh", version.ref = "pullrefresh" } -okio = "com.squareup.okio:okio:3.9.0" +okio = { group = "com.squareup.okio", name = "okio", version.ref = "okio" } + +desugar-jdk-libs = "com.android.tools:desugar_jdk_libs:2.0.4" + # Wear dependencies play-services-wearable = { group = "com.google.android.gms", name = "play-services-wearable", version.ref = "playServicesWearable" } androidx-splashscreen = "androidx.core:core-splashscreen:1.0.1" wear-compose-material = { module = "androidx.wear.compose:compose-material", version.ref = "androidx-wear-compose" } wear-compose-foundation = { module = "androidx.wear.compose:compose-foundation", version.ref = "androidx-wear-compose" } -androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" } +wear-compose-ui-tooling = { module = "androidx.wear.compose:compose-ui-tooling", version.ref = "androidx-wear-compose" } +wear-compose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "androidx-wear-compose" } horologist-composables = { module = "com.google.android.horologist:horologist-composables", version.ref = "horologist" } horologist-compose-layout = { module = "com.google.android.horologist:horologist-compose-layout", version.ref = "horologist" } horologist-compose-material = { module = "com.google.android.horologist:horologist-compose-material", version.ref = "horologist" } horologist-auth-ui = { module = "com.google.android.horologist:horologist-auth-ui", version.ref = "horologist" } -compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } -androidx-compose-ui-tooling = { module = "androidx.wear.compose:compose-ui-tooling", version.ref = "compose-ui-tooling" } -wear-compose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "androidx-wear-compose" } -desugar-jdk-libs = "com.android.tools:desugar_jdk_libs:2.0.4" [plugins] android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } apollo = { id = "com.apollographql.apollo3", version.ref = "apollo" } -kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kmp = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } google-services = { id = "com.google.gms.google-services", version.ref = "google-services-plugin" } crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics-plugin" } diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index ac219dc8..7480eae6 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -35,6 +35,11 @@ kotlin { } } +configurations.configureEach { + // Remove unnecessary dependency of Precompose and Moko + exclude(group = "androidx.appcompat", module = "appcompat") +} + android { namespace = "fr.paug.androidmakers.shared" } diff --git a/shared/di/build.gradle.kts b/shared/di/build.gradle.kts index 7302a408..df730a0d 100644 --- a/shared/di/build.gradle.kts +++ b/shared/di/build.gradle.kts @@ -17,7 +17,6 @@ kotlin { sourceSets { androidMain.dependencies { - implementation(libs.koin.android) implementation(libs.koin.androidx.compose) } @@ -31,6 +30,12 @@ kotlin { } } +configurations.configureEach { + // Remove unnecessary dependency of Precompose + exclude(group = "androidx.appcompat", module = "appcompat") +} + android { namespace = "fr.paug.androidmakers.di" + buildFeatures.buildConfig = true } diff --git a/shared/di/src/androidMain/kotlin/fr/androidmakers/di/Inject.android.kt b/shared/di/src/androidMain/kotlin/fr/androidmakers/di/Inject.android.kt index 6ad9b5e5..91fd5df8 100644 --- a/shared/di/src/androidMain/kotlin/fr/androidmakers/di/Inject.android.kt +++ b/shared/di/src/androidMain/kotlin/fr/androidmakers/di/Inject.android.kt @@ -1,17 +1,19 @@ package fr.androidmakers.di import android.content.Context +import fr.paug.androidmakers.di.BuildConfig import org.koin.android.ext.koin.androidContext import org.koin.android.ext.koin.androidLogger import org.koin.core.context.startKoin import org.koin.core.logger.Level import org.koin.core.module.Module - actual class DependenciesBuilder(private val context: Context) { actual fun inject(platformModules: List) { startKoin { - androidLogger(Level.DEBUG) + if (BuildConfig.DEBUG) { + androidLogger(Level.DEBUG) + } androidContext(context) modules( platformModules + diff --git a/shared/ui/build.gradle.kts b/shared/ui/build.gradle.kts index e6a46c78..b510eec2 100644 --- a/shared/ui/build.gradle.kts +++ b/shared/ui/build.gradle.kts @@ -42,6 +42,11 @@ kotlin { } } +configurations.configureEach { + // Remove unnecessary dependency of Precompose and Moko + exclude(group = "androidx.appcompat", module = "appcompat") +} + android { namespace = "fr.paug.androidmakers.ui" } diff --git a/wearApp/build.gradle.kts b/wearApp/build.gradle.kts index bf74bb38..803a002b 100644 --- a/wearApp/build.gradle.kts +++ b/wearApp/build.gradle.kts @@ -16,9 +16,6 @@ android { targetSdk = 33 versionCode = libs.versions.version.code.get().toInt() versionName = "1.0" - vectorDrawables { - useSupportLibrary = true - } } compileOptions { @@ -39,9 +36,33 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" + buildTypes { + release { + kotlinOptions { + freeCompilerArgs += listOf( + "-Xno-param-assertions", + "-Xno-call-assertions", + "-Xno-receiver-assertions" + ) + } + + packaging { + resources { + excludes += listOf( + "DebugProbesKt.bin", + "kotlin-tooling-metadata.json", + "/*.properties", + "kotlin/**", + "/*.proto", + "google/**", + "src/google/**", + "META-INF/*.version" + ) + } + jniLibs { + excludes += "**/libdatastore_shared_counter.so" + } + } } } } @@ -50,24 +71,31 @@ dependencies { implementation(libs.play.services.wearable) implementation(libs.play.services.auth) implementation(libs.androidx.activity.compose) + implementation(libs.androidx.lifecycle.viewmodel.compose) implementation(libs.androidx.splashscreen) implementation(libs.wear.compose.material) implementation(libs.wear.compose.foundation) - implementation(libs.androidx.material.icons.extended) + implementation(libs.compose.ui.tooling.preview) + implementation(libs.compose.material.icons.extended) implementation(libs.horologist.composables) implementation(libs.horologist.compose.layout) implementation(libs.horologist.compose.material) implementation(libs.horologist.auth.ui) - implementation(libs.compose.ui.tooling.preview) - implementation(libs.androidx.compose.ui.tooling) + implementation(libs.wear.compose.ui.tooling) implementation(libs.wear.compose.navigation) implementation(platform(libs.firebase.bom)) implementation(libs.firebase.auth) coreLibraryDesugaring(libs.desugar.jdk.libs) debugImplementation(libs.compose.ui.tooling) - implementation(libs.koin.android) - implementation(libs.koin.androidx.compose) + implementation(libs.koin.androidx.compose) { + exclude(group = "androidx.appcompat", module = "appcompat") + } implementation(project(":shared:di")) implementation(project(":shared:domain")) } + +configurations.configureEach { + // Remove bogus dependency of Horologist, which itself depends on AppCompat and Material Components + exclude(group = "androidx.navigation", module = "navigation-ui-ktx") +} diff --git a/wearApp/proguard-defaults.txt b/wearApp/proguard-defaults.txt new file mode 100644 index 00000000..4f039f7c --- /dev/null +++ b/wearApp/proguard-defaults.txt @@ -0,0 +1,40 @@ +# Less conservative default ProGuard rules +-allowaccessmodification + +-dontusemixedcaseclassnames +-dontskipnonpubliclibraryclasses +-verbose + +# Preserve some attributes that may be required for reflection. +-keepattributes RuntimeVisible*Annotations, AnnotationDefault + +# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native +-keepclasseswithmembernames class * { + native ; +} + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keepclassmembers class * implements android.os.Parcelable { + public static final ** CREATOR; +} + +# Preserve annotated Javascript interface methods. +-keepclassmembers class * { + @android.webkit.JavascriptInterface ; +} + +# The support libraries contains references to newer platform versions. +# Don't warn about those in case this app is linking against an older +# platform version. We know about them, and they are safe. +-dontnote androidx.** +-dontwarn androidx.** + +# This class is deprecated, but remains for backward compatibility. +-dontwarn android.util.FloatMath + +# These classes are duplicated between android.jar and core-lambda-stubs.jar. +-dontnote java.lang.invoke.** \ No newline at end of file diff --git a/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/main/MainActivity.kt b/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/main/MainActivity.kt index a37a7fc6..44709fd3 100644 --- a/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/main/MainActivity.kt +++ b/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/main/MainActivity.kt @@ -3,6 +3,7 @@ package fr.paug.androidmakers.wear.ui.main import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.pager.PagerState import androidx.compose.foundation.pager.rememberPagerState @@ -124,6 +125,7 @@ fun WearApp( } } +@OptIn(ExperimentalFoundationApi::class) @Composable fun MainScreen( viewModel: MainViewModel,