diff --git a/.gitignore b/.gitignore index 63e7418c902..63bf1f4538a 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ library/.env # Java class files *.class +# Kotlin class files +/.kotlin + # Generated files bin/ gen/ diff --git a/CHANGELOG.md b/CHANGELOG.md index ba87266ea4f..6cc759d0ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ ### 🐞 Fixed ### ⬆️ Improved +- Enabled Strong Skipping Mode for Compose compiler and improved Compose performance. [#5303](https://github.com/GetStream/stream-chat-android/pull/5303) ### ✅ Added - Added `MessageOptionItemVisibility` class that controls menu item visibility in the selected message options menu. [#5226](https://github.com/GetStream/stream-chat-android/pull/5226) @@ -93,6 +94,7 @@ ### ⚠️ Changed - Used the new `ChatTheme.messageOptionItemVisibility` property in `defaultMessageOptionsState()` in combination with own capabilities to control menu option item visibility. [#5226](https://github.com/GetStream/stream-chat-android/pull/5226) - Now, Compose components use `StreamImage`, which delegates [Landscapist-Coil](https://github.com/skydoves/landscapist) for loading internal images. [#5299](https://github.com/GetStream/stream-chat-android/pull/5299) +- Migrated to Kotlin 2.0 and Compose compiler plugin [#5303](https://github.com/GetStream/stream-chat-android/pull/5303) ### ❌ Removed diff --git a/build.gradle b/build.gradle index 12aba91ede2..5460293915b 100644 --- a/build.gradle +++ b/build.gradle @@ -20,17 +20,48 @@ apply plugin: MinorBumpPlugin apply plugin: VersionPrintPlugin apply plugin: ChangelogAddModelSectionPlugin - buildscript { repositories { + // fetch plugins from google maven (https://maven.google.com) + google() { + content { + includeGroupByRegex("androidx\\..*") + includeGroupByRegex("com\\.android(\\..*|)") + includeGroupByRegex("com\\.google\\.android\\..*") + includeGroupByRegex("com\\.google\\.firebase(\\..*|)") + includeGroupByRegex("com\\.google\\.gms(\\..*|)") + includeGroupByRegex("com\\.google\\.mlkit") + includeGroupByRegex("com\\.google\\.oboe") + includeGroupByRegex("com\\.google\\.prefab") + includeGroupByRegex("com\\.google\\.testing\\.platform") + } + mavenContent { + releasesOnly() + } + } + + // fetch dagger plugin only + mavenCentral() { + content { + includeGroup("com.google.dagger") + includeGroup("com.google.dagger.hilt.android") + } + mavenContent { + releasesOnly() + } + } + + // fetch plugins from gradle plugin portal (https://plugins.gradle.org) + gradlePluginPortal() + + // fetch plugins from gradle maven publication maven { url "https://plugins.gradle.org/m2/" } - google() - mavenCentral() } dependencies { classpath Dependencies.androidGradlePlugin classpath Dependencies.kotlinGradlePlugin + classpath Dependencies.composeCompilerPlugin classpath Dependencies.googleServicesPlugin classpath Dependencies.androidJunit5GradlePlugin classpath Dependencies.gitversionerPlugin @@ -58,8 +89,40 @@ subprojects { allprojects { repositories { - google() - mavenCentral() + // fetch plugins from google maven (https://maven.google.com) + google() { + content { + includeGroupByRegex("androidx\\..*") + includeGroupByRegex("com\\.android(\\..*|)") + includeGroupByRegex("com\\.google\\.android\\..*") + includeGroupByRegex("com\\.google\\.firebase(\\..*|)") + includeGroupByRegex("com\\.google\\.gms(\\..*|)") + includeGroupByRegex("com\\.google\\.mlkit") + includeGroupByRegex("com\\.google\\.oboe") + includeGroupByRegex("com\\.google\\.prefab") + includeGroupByRegex("com\\.google\\.testing\\.platform") + } + mavenContent { + releasesOnly() + } + } + + // fetch dagger plugin only + mavenCentral() { + content { + includeGroup("com.google.dagger") + includeGroup("com.google.dagger.hilt.android") + } + mavenContent { + releasesOnly() + } + } + + // fetch plugins from gradle plugin portal (https://plugins.gradle.org) + gradlePluginPortal() + + // fetch plugins from gradle maven publication + maven { url "https://plugins.gradle.org/m2/" } } } diff --git a/buildSrc/src/main/kotlin/io/getstream/chat/android/Dependencies.kt b/buildSrc/src/main/kotlin/io/getstream/chat/android/Dependencies.kt index c4b4d8ea859..c8749ed3418 100644 --- a/buildSrc/src/main/kotlin/io/getstream/chat/android/Dependencies.kt +++ b/buildSrc/src/main/kotlin/io/getstream/chat/android/Dependencies.kt @@ -3,7 +3,7 @@ package io.getstream.chat.android object Versions { - internal const val ANDROID_GRADLE_PLUGIN = "8.2.0" + internal const val ANDROID_GRADLE_PLUGIN = "8.4.2" internal const val ANDROID_JUNIT5_GRADLE_PLUGIN = "1.9.3.0" internal const val ANDROID_LEGACY_SUPPORT = "1.0.0" internal const val ANDROIDX_ACTIVITY_COMPOSE = "1.7.2" @@ -11,7 +11,6 @@ object Versions { internal const val ANDROIDX_ANNOTATIONS = "1.6.0" internal const val ANDROIDX_APPCOMPAT = "1.6.1" internal const val ANDROIDX_COMPOSE = "1.6.2" - public const val ANDROIDX_COMPOSE_COMPILER = "1.5.10" internal const val ANDROIDX_CORE_TEST = "2.2.0" internal const val ANDROIDX_FRAGMENT = "1.6.1" internal const val ANDROIDX_KTX = "1.10.1" @@ -52,13 +51,13 @@ object Versions { internal const val JUNIT5 = "5.10.0" internal const val KEYBOARD_VISIBILITY_EVENT = "2.3.0" internal const val KLUENT = "1.73" - internal const val KOTLIN = "1.9.22" - internal const val KOTLIN_BINARY_VALIDATOR = "0.13.2" - internal const val KSP = "1.9.22-1.0.17" + internal const val KOTLIN = "2.0.0" + internal const val KOTLIN_BINARY_VALIDATOR = "0.14.0" + internal const val KSP = "2.0.0-1.0.22" internal const val LANDSCAPIST = "2.3.4" internal const val LEAK_CANARY = "2.4" internal const val MATERIAL_COMPONENTS = "1.8.0" - internal const val MACRO_BENCHMARK = "1.2.0" + internal const val MACRO_BENCHMARK = "1.2.3" internal const val MARKWON = "4.6.2" internal const val MOCKITO_KOTLIN = "5.0.0" internal const val MOCKITO = "5.4.0" @@ -116,7 +115,7 @@ object Dependencies { const val coilGif = "io.coil-kt:coil-gif:${Versions.COIL}" const val coilVideo = "io.coil-kt:coil-video:${Versions.COIL}" const val composeCoil = "io.coil-kt:coil-compose:${Versions.COIL}" - const val composeCompiler = "androidx.compose.compiler:compiler:${Versions.ANDROIDX_COMPOSE_COMPILER}" + const val composeCompilerPlugin = "org.jetbrains.kotlin:compose-compiler-gradle-plugin:${Versions.KOTLIN}" const val composeRuntime = "androidx.compose.runtime:runtime:${Versions.ANDROIDX_COMPOSE}" const val composeUi = "androidx.compose.ui:ui:${Versions.ANDROIDX_COMPOSE}" const val composeUiTest = "androidx.compose.ui:ui-test-junit4:${Versions.ANDROIDX_COMPOSE}" diff --git a/compose_compiler_config.conf b/compose_compiler_config.conf new file mode 100644 index 00000000000..ace08a7ae69 --- /dev/null +++ b/compose_compiler_config.conf @@ -0,0 +1,8 @@ +// Kotlin collections and datetime classes +kotlin.collections.* +org.threeten.bp.* +java.time.* + +// We always use immutable classes for our data model, to avoid running the Compose compiler +// in the module we declare it to be stable here. +io.getstream.chat.android.models.* diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135c49b..d64cd491770 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e6aba2515d5..6f7a6eb33e8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1a532..1aa94a42690 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f135..25da30dbdee 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/stream-chat-android-client/api/stream-chat-android-client.api b/stream-chat-android-client/api/stream-chat-android-client.api index 7445afdb68d..c9a21e1ed36 100644 --- a/stream-chat-android-client/api/stream-chat-android-client.api +++ b/stream-chat-android-client/api/stream-chat-android-client.api @@ -705,11 +705,6 @@ public final class io/getstream/chat/android/client/channel/ChannelClientExtensi public static final fun subscribeFor (Lio/getstream/chat/android/client/channel/ChannelClient;[Lkotlin/reflect/KClass;Lio/getstream/chat/android/client/ChatEventListener;)Lio/getstream/chat/android/client/utils/observable/Disposable; } -public final class io/getstream/chat/android/client/channel/ChannelMessagesUpdateLogic$DefaultImpls { - public static synthetic fun upsertMessage$default (Lio/getstream/chat/android/client/channel/ChannelMessagesUpdateLogic;Lio/getstream/chat/android/models/Message;ZILjava/lang/Object;)V - public static synthetic fun upsertMessages$default (Lio/getstream/chat/android/client/channel/ChannelMessagesUpdateLogic;Ljava/util/List;ZZILjava/lang/Object;)V -} - public abstract interface class io/getstream/chat/android/client/channel/state/ChannelState { public abstract fun getChannelConfig ()Lkotlinx/coroutines/flow/StateFlow; public abstract fun getChannelData ()Lkotlinx/coroutines/flow/StateFlow; @@ -822,10 +817,6 @@ public final class io/getstream/chat/android/client/errorhandler/ErrorHandler$Co public static final field DEFAULT_PRIORITY I } -public final class io/getstream/chat/android/client/errorhandler/ErrorHandler$DefaultImpls { - public static fun compareTo (Lio/getstream/chat/android/client/errorhandler/ErrorHandler;Lio/getstream/chat/android/client/errorhandler/ErrorHandler;)I -} - public final class io/getstream/chat/android/client/errors/ChatError { public fun ()V public fun (ILjava/lang/String;ILjava/util/Map;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;)V @@ -2245,9 +2236,6 @@ public final class io/getstream/chat/android/client/extensions/MessageExtensions public static final fun getCreatedAtOrThrow (Lio/getstream/chat/android/models/Message;)Ljava/util/Date; } -public final class io/getstream/chat/android/client/extensions/SharedPreferencesKt { -} - public final class io/getstream/chat/android/client/extensions/StringExtensionsKt { public static final fun cidToTypeAndId (Ljava/lang/String;)Lkotlin/Pair; public static final fun createResizedStreamCdnImageUrl (Ljava/lang/String;FFLio/getstream/chat/android/models/streamcdn/image/StreamCdnResizeImageMode;Lio/getstream/chat/android/models/streamcdn/image/StreamCdnCropImageMode;)Ljava/lang/String; @@ -2255,31 +2243,10 @@ public final class io/getstream/chat/android/client/extensions/StringExtensionsK public static final fun getStreamCdnHostedImageDimensions (Ljava/lang/String;)Lio/getstream/chat/android/models/streamcdn/image/StreamCdnOriginalImageDimensions; } -public final class io/getstream/chat/android/client/extensions/internal/ChannelKt { -} - public final class io/getstream/chat/android/client/extensions/internal/ChatEventKt { public static final fun enrichIfNeeded (Lio/getstream/chat/android/client/events/ChatEvent;)Lio/getstream/chat/android/client/events/ChatEvent; } -public final class io/getstream/chat/android/client/extensions/internal/MemberKt { -} - -public final class io/getstream/chat/android/client/extensions/internal/MessageKt { -} - -public final class io/getstream/chat/android/client/extensions/internal/MessageReactionsKt { -} - -public final class io/getstream/chat/android/client/extensions/internal/PairKt { -} - -public final class io/getstream/chat/android/client/extensions/internal/ReactionKt { -} - -public final class io/getstream/chat/android/client/extensions/internal/UserKt { -} - public final class io/getstream/chat/android/client/header/VersionPrefixHeader$Compose : io/getstream/chat/android/client/header/VersionPrefixHeader { public static final field INSTANCE Lio/getstream/chat/android/client/header/VersionPrefixHeader$Compose; public fun equals (Ljava/lang/Object;)Z @@ -2831,9 +2798,6 @@ public final class io/getstream/chat/android/client/sync/SyncState { public fun toString ()Ljava/lang/String; } -public final class io/getstream/chat/android/client/sync/SyncStateKt { -} - public abstract interface class io/getstream/chat/android/client/token/TokenProvider { public abstract fun loadToken ()Ljava/lang/String; } @@ -2872,18 +2836,12 @@ public abstract interface class io/getstream/chat/android/client/utils/ProgressC public abstract fun onSuccess (Ljava/lang/String;)V } -public final class io/getstream/chat/android/client/utils/ResultUtilsKt { -} - public final class io/getstream/chat/android/client/utils/TimeProvider { public static final field INSTANCE Lio/getstream/chat/android/client/utils/TimeProvider; public final fun provideCurrentTimeInMilliseconds ()J public final fun provideCurrentTimeInSeconds ()J } -public final class io/getstream/chat/android/client/utils/UserUtilsKt { -} - public final class io/getstream/chat/android/client/utils/attachment/AttachmentUtilsKt { public static final fun isAudio (Lio/getstream/chat/android/models/Attachment;)Z public static final fun isAudioRecording (Lio/getstream/chat/android/models/Attachment;)Z @@ -2895,15 +2853,6 @@ public final class io/getstream/chat/android/client/utils/attachment/AttachmentU public static final fun isVideo (Lio/getstream/chat/android/models/Attachment;)Z } -public final class io/getstream/chat/android/client/utils/channel/ChannelUtilsKt { -} - -public final class io/getstream/chat/android/client/utils/internal/MessageUtilsKt { -} - -public final class io/getstream/chat/android/client/utils/internal/ValidationKt { -} - public final class io/getstream/chat/android/client/utils/internal/toggle/ToggleService$Companion { } diff --git a/stream-chat-android-compose-sample/build.gradle b/stream-chat-android-compose-sample/build.gradle index d0e9618adfd..e95dd722895 100644 --- a/stream-chat-android-compose-sample/build.gradle +++ b/stream-chat-android-compose-sample/build.gradle @@ -3,6 +3,7 @@ import io.getstream.chat.android.Versions apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +apply plugin: 'org.jetbrains.kotlin.plugin.compose' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'androidx.baselineprofile' @@ -79,10 +80,6 @@ android { buildConfig true } - composeOptions { - kotlinCompilerExtensionVersion Versions.ANDROIDX_COMPOSE_COMPILER - } - lintOptions { disable 'MissingTranslation' } @@ -106,7 +103,6 @@ dependencies { implementation Dependencies.streamPushFirebase // Compose - implementation Dependencies.composeCompiler implementation Dependencies.composeUi implementation Dependencies.composeUiTooling implementation Dependencies.composeFoundation diff --git a/stream-chat-android-compose/api/stream-chat-android-compose.api b/stream-chat-android-compose/api/stream-chat-android-compose.api index 7582808ceaf..6fbfdb14d1f 100644 --- a/stream-chat-android-compose/api/stream-chat-android-compose.api +++ b/stream-chat-android-compose/api/stream-chat-android-compose.api @@ -197,11 +197,11 @@ public final class io/getstream/chat/android/compose/state/mediagallerypreview/M public static final field $stable I public static final field CREATOR Landroid/os/Parcelable$Creator; public fun (Ljava/lang/String;Ljava/lang/String;Lio/getstream/chat/android/compose/state/mediagallerypreview/MediaGalleryPreviewResultType;)V - public fun describeContents ()I + public final fun describeContents ()I public final fun getMessageId ()Ljava/lang/String; public final fun getParentMessageId ()Ljava/lang/String; public final fun getResultType ()Lio/getstream/chat/android/compose/state/mediagallerypreview/MediaGalleryPreviewResultType; - public fun writeToParcel (Landroid/os/Parcel;I)V + public final fun writeToParcel (Landroid/os/Parcel;I)V } public final class io/getstream/chat/android/compose/state/mediagallerypreview/MediaGalleryPreviewResult$Creator : android/os/Parcelable$Creator { @@ -2270,9 +2270,6 @@ public final class io/getstream/chat/android/compose/util/KeyValuePair { public fun toString ()Ljava/lang/String; } -public final class io/getstream/chat/android/compose/util/extensions/ChannelCapabilitiesKt { -} - public final class io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModel : androidx/lifecycle/ViewModel { public static final field $stable I public fun (Lio/getstream/chat/android/client/ChatClient;Lio/getstream/chat/android/models/querysort/QuerySorter;Lio/getstream/chat/android/models/FilterObject;IIILio/getstream/chat/android/state/event/handler/chat/factory/ChatEventHandlerFactory;J)V diff --git a/stream-chat-android-compose/build.gradle b/stream-chat-android-compose/build.gradle index da2860f96c9..f4f393054e0 100644 --- a/stream-chat-android-compose/build.gradle +++ b/stream-chat-android-compose/build.gradle @@ -4,6 +4,7 @@ import io.getstream.chat.android.Versions apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +apply plugin: 'org.jetbrains.kotlin.plugin.compose' apply plugin: 'kotlin-parcelize' apply plugin: "de.mannodermaus.android-junit5" apply plugin: 'androidx.baselineprofile' @@ -37,10 +38,12 @@ android { buildFeatures { compose true } +} - composeOptions { - kotlinCompilerExtensionVersion Versions.ANDROIDX_COMPOSE_COMPILER - } +composeCompiler { + enableStrongSkippingMode = true + reportsDestination = layout.buildDirectory.dir("compose_compiler") + stabilityConfigurationFile = rootProject.layout.projectDirectory.file("compose_compiler_config.conf") } baselineProfile { @@ -59,16 +62,6 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { '-opt-in=io.getstream.chat.android.core.ExperimentalStreamChatApi', '-opt-in=kotlin.RequiresOptIn', ] - freeCompilerArgs += [ - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + - project.buildDir.absolutePath + "/compose_metrics" - ] - freeCompilerArgs += [ - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + - project.buildDir.absolutePath + "/compose_metrics" - ] } } @@ -80,7 +73,6 @@ dependencies { implementation Dependencies.streamLog // Compose - implementation Dependencies.composeCompiler implementation Dependencies.composeUi implementation Dependencies.composeUiTooling implementation Dependencies.composeFoundation diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/handlers/PermissionHandler.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/handlers/PermissionHandler.kt index 6db237fa55c..9b1b0c34728 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/handlers/PermissionHandler.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/handlers/PermissionHandler.kt @@ -81,14 +81,14 @@ public interface PermissionHandler { public class DownloadPermissionHandler( private val permissionState: PermissionState, private val context: Context, - private inline val onPermissionRequired: () -> Unit = { + private val onPermissionRequired: () -> Unit = { if (!context.wasPermissionRequested(permissionState.permission) || permissionState.status.shouldShowRationale) { permissionState.launchPermissionRequest() } else { context.openSystemSettings() } }, - private inline val onPermissionGranted: (Map) -> Unit = { payload -> + private val onPermissionGranted: (Map) -> Unit = { payload -> (payload[PayloadAttachment] as? Attachment)?.let { ChatClient .instance() diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/QuotedMessageAttachmentContent.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/QuotedMessageAttachmentContent.kt index b51f6ba88a3..b74f74aee46 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/QuotedMessageAttachmentContent.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/QuotedMessageAttachmentContent.kt @@ -60,7 +60,7 @@ public fun QuotedMessageAttachmentContent( ) quoteAttachmentFactory?.content?.invoke( - modifier = modifier, - attachmentState = attachmentState, + modifier, + attachmentState, ) } diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.kt index 95f6138ee2c..39bc2248ca1 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.kt @@ -99,11 +99,11 @@ public fun MessageInput( val previewFactory = ChatTheme.attachmentFactories.firstOrNull { it.canHandle(attachments) } previewFactory?.previewContent?.invoke( - modifier = Modifier + Modifier .fillMaxWidth() .wrapContentHeight(), - attachments = attachments, - onAttachmentRemoved = onAttachmentRemoved, + attachments, + onAttachmentRemoved, ) Spacer(modifier = Modifier.size(16.dp)) diff --git a/stream-chat-android-core/api/stream-chat-android-core.api b/stream-chat-android-core/api/stream-chat-android-core.api index 4972ac43f97..673b55f4976 100644 --- a/stream-chat-android-core/api/stream-chat-android-core.api +++ b/stream-chat-android-core/api/stream-chat-android-core.api @@ -75,18 +75,9 @@ public final class io/getstream/chat/android/client/errors/ChatErrorCode$Compani public final fun isAuthenticationError (I)Z } -public final class io/getstream/chat/android/client/errors/ChatErrorKt { -} - -public final class io/getstream/chat/android/client/errors/NetworkErrorKt { -} - public abstract interface annotation class io/getstream/chat/android/core/ExperimentalStreamChatApi : java/lang/annotation/Annotation { } -public final class io/getstream/chat/android/core/internal/ExtensionsKt { -} - public abstract interface annotation class io/getstream/chat/android/core/internal/InternalStreamChatApi : java/lang/annotation/Annotation { } @@ -98,9 +89,6 @@ public final class io/getstream/chat/android/core/internal/fsm/FiniteStateMachin public final fun invoke (Lkotlin/jvm/functions/Function1;)Lio/getstream/chat/android/core/internal/fsm/FiniteStateMachine; } -public final class io/getstream/chat/android/core/internal/lazy/ParameterizedLazyKt { -} - public final class io/getstream/chat/android/core/utils/Debouncer { public fun (JLkotlinx/coroutines/CoroutineScope;)V public synthetic fun (JLkotlinx/coroutines/CoroutineScope;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -110,12 +98,6 @@ public final class io/getstream/chat/android/core/utils/Debouncer { public final fun submitSuspendable (Lkotlin/jvm/functions/Function1;)V } -public final class io/getstream/chat/android/core/utils/date/DateUtils { -} - -public final class io/getstream/chat/android/extensions/FloatExtensionsKt { -} - public final class io/getstream/chat/android/extensions/IntExtensionsKt { public static final fun limitTo (III)I } @@ -554,9 +536,6 @@ public final class io/getstream/chat/android/models/ChannelData { public fun toString ()Ljava/lang/String; } -public final class io/getstream/chat/android/models/ChannelDataKt { -} - public final class io/getstream/chat/android/models/ChannelInfo { public fun ()V public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V diff --git a/stream-chat-android-docs/build.gradle b/stream-chat-android-docs/build.gradle index 2e88b3e1008..614ec3df90e 100644 --- a/stream-chat-android-docs/build.gradle +++ b/stream-chat-android-docs/build.gradle @@ -3,6 +3,7 @@ import io.getstream.chat.android.Versions apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +apply plugin: 'org.jetbrains.kotlin.plugin.compose' apply from: "${rootDir}/scripts/android.gradle" apply from: "${rootDir}/scripts/detekt-disabled.gradle" @@ -67,10 +68,6 @@ android { viewBinding true compose true } - - composeOptions { - kotlinCompilerExtensionVersion Versions.ANDROIDX_COMPOSE_COMPILER - } } repositories { @@ -93,7 +90,6 @@ dependencies { implementation project(":stream-chat-android-markdown-transformer") // Compose - implementation Dependencies.composeCompiler implementation Dependencies.composeUi implementation Dependencies.composeUiTooling implementation Dependencies.composeFoundation diff --git a/stream-chat-android-state/src/main/java/io/getstream/chat/android/state/plugin/logic/channel/internal/TypingEventPruner.kt b/stream-chat-android-state/src/main/java/io/getstream/chat/android/state/plugin/logic/channel/internal/TypingEventPruner.kt index 095ea7627ee..be9c25d3bbe 100644 --- a/stream-chat-android-state/src/main/java/io/getstream/chat/android/state/plugin/logic/channel/internal/TypingEventPruner.kt +++ b/stream-chat-android-state/src/main/java/io/getstream/chat/android/state/plugin/logic/channel/internal/TypingEventPruner.kt @@ -40,7 +40,7 @@ internal class TypingEventPruner( private val channelId: String, private val coroutineScope: CoroutineScope, private val delayTimeMs: Long = DEFAULT_DELAY_TIME_MS, - private inline val onUpdated: ( + private val onUpdated: ( rawTypingEvents: Map, typingEvent: TypingEvent, ) -> Unit, @@ -180,7 +180,7 @@ internal data class TimedTypingStartEvent( internal val typingStartEvent: TypingStartEvent, private val userId: String, private val delayTimeMs: Long, - private inline val removeTypingEvent: (userId: String) -> Unit, + private val removeTypingEvent: (userId: String) -> Unit, ) { /** diff --git a/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api b/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api index a7a392bb410..a546f51818f 100644 --- a/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api +++ b/stream-chat-android-ui-common/api/stream-chat-android-ui-common.api @@ -377,14 +377,6 @@ public final class io/getstream/chat/android/ui/common/images/internal/StreamIma public final fun instance ()Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader; } -public final class io/getstream/chat/android/ui/common/images/internal/StreamImageLoader$DefaultImpls { - public static synthetic fun load$default (Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader;Landroid/widget/ImageView;Ljava/lang/Object;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader$ImageTransformation;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lio/getstream/chat/android/ui/common/disposable/Disposable; - public static synthetic fun load$default (Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader;Landroid/widget/ImageView;Ljava/lang/Object;Ljava/lang/Integer;Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader$ImageTransformation;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lio/getstream/chat/android/ui/common/disposable/Disposable; - public static synthetic fun loadAndResize$default (Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader;Landroid/widget/ImageView;Ljava/lang/Object;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader$ImageTransformation;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun loadAsBitmap$default (Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader;Landroid/content/Context;Ljava/lang/String;Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader$ImageTransformation;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun loadVideoThumbnail$default (Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader;Landroid/widget/ImageView;Landroid/net/Uri;Ljava/lang/Integer;Lio/getstream/chat/android/ui/common/images/internal/StreamImageLoader$ImageTransformation;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lio/getstream/chat/android/ui/common/disposable/Disposable; -} - public abstract class io/getstream/chat/android/ui/common/images/internal/StreamImageLoader$ImageTransformation { public static final field $stable I } @@ -438,9 +430,6 @@ public final class io/getstream/chat/android/ui/common/images/resizing/StreamCdn public final fun defaultStreamCdnImageResizing ()Lio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing; } -public final class io/getstream/chat/android/ui/common/images/resizing/StringExtensionsKt { -} - public final class io/getstream/chat/android/ui/common/notifications/StreamCoilUserIconBuilder : io/getstream/chat/android/client/notifications/handler/UserIconBuilder { public static final field $stable I public fun (Landroid/content/Context;)V @@ -1234,9 +1223,6 @@ public abstract class io/getstream/chat/android/ui/common/state/messages/list/Mo public abstract fun getText ()I } -public final class io/getstream/chat/android/ui/common/state/messages/list/ModeratedMessageOptionKt { -} - public final class io/getstream/chat/android/ui/common/state/messages/list/MyOwn : io/getstream/chat/android/ui/common/state/messages/list/NewMessageState { public static final field $stable I public fun (Ljava/lang/Long;)V @@ -1514,9 +1500,6 @@ public final class io/getstream/chat/android/ui/common/utils/extensions/FlowKt { public static final fun onFirst (Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/flow/Flow; } -public final class io/getstream/chat/android/ui/common/utils/extensions/MessageFooterVisibilityKt { -} - public final class io/getstream/chat/android/ui/common/utils/extensions/MessageKt { public static final fun isModerationFailed (Lio/getstream/chat/android/models/Message;Lio/getstream/chat/android/models/User;)Z } diff --git a/stream-chat-android-ui-common/build.gradle b/stream-chat-android-ui-common/build.gradle index e2ea6483929..37b0250ae88 100644 --- a/stream-chat-android-ui-common/build.gradle +++ b/stream-chat-android-ui-common/build.gradle @@ -4,6 +4,7 @@ import io.getstream.chat.android.Versions apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +apply plugin: 'org.jetbrains.kotlin.plugin.compose' apply plugin: 'de.mannodermaus.android-junit5' apply plugin: 'androidx.baselineprofile' @@ -47,10 +48,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion Versions.ANDROIDX_COMPOSE_COMPILER - } } baselineProfile { @@ -77,7 +74,6 @@ dependencies { implementation Dependencies.streamLog implementation Dependencies.streamPushPermissionsSnackbar implementation Dependencies.streamResult - implementation Dependencies.composeCompiler implementation Dependencies.composeRuntime implementation Dependencies.androidxActivityKtx diff --git a/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api b/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api index 0ff6a9e8d29..d7a7cb1b179 100644 --- a/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api +++ b/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api @@ -616,7 +616,7 @@ public final class io/getstream/chat/android/ui/feature/gallery/AttachmentGaller public final fun component9 ()Ljava/lang/String; public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lio/getstream/chat/android/ui/feature/gallery/AttachmentGalleryResultItem; public static synthetic fun copy$default (Lio/getstream/chat/android/ui/feature/gallery/AttachmentGalleryResultItem;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/getstream/chat/android/ui/feature/gallery/AttachmentGalleryResultItem; - public fun describeContents ()I + public final fun describeContents ()I public fun equals (Ljava/lang/Object;)Z public final fun getAssetUrl ()Ljava/lang/String; public final fun getAuthorLink ()Ljava/lang/String; @@ -637,7 +637,7 @@ public final class io/getstream/chat/android/ui/feature/gallery/AttachmentGaller public fun hashCode ()I public final fun isMine ()Z public fun toString ()Ljava/lang/String; - public fun writeToParcel (Landroid/os/Parcel;I)V + public final fun writeToParcel (Landroid/os/Parcel;I)V } public final class io/getstream/chat/android/ui/feature/gallery/AttachmentGalleryResultItem$Creator : android/os/Parcelable$Creator { @@ -3856,30 +3856,12 @@ public final class io/getstream/chat/android/ui/utils/Debouncer { public final fun submitSuspendable (Lkotlin/jvm/functions/Function1;)V } -public final class io/getstream/chat/android/ui/utils/ImageUtilsKt { -} - public final class io/getstream/chat/android/ui/utils/extensions/ChannelKt { public static final fun getLastMessage (Lio/getstream/chat/android/models/Channel;)Lio/getstream/chat/android/models/Message; public static final fun getMembersStatusText (Lio/getstream/chat/android/models/Channel;Landroid/content/Context;Lio/getstream/chat/android/models/User;)Ljava/lang/String; public static synthetic fun getMembersStatusText$default (Lio/getstream/chat/android/models/Channel;Landroid/content/Context;Lio/getstream/chat/android/models/User;ILjava/lang/Object;)Ljava/lang/String; } -public final class io/getstream/chat/android/ui/utils/extensions/ConstraintLayoutKt { -} - -public final class io/getstream/chat/android/ui/utils/extensions/ContextKt { -} - -public final class io/getstream/chat/android/ui/utils/extensions/EditTextKt { -} - -public final class io/getstream/chat/android/ui/utils/extensions/IntKt { -} - -public final class io/getstream/chat/android/ui/utils/extensions/MessageItemKt { -} - public final class io/getstream/chat/android/ui/utils/extensions/MessageKt { public static final fun getCreatedAtOrNull (Lio/getstream/chat/android/models/Message;)Ljava/util/Date; public static final fun getCreatedAtOrThrow (Lio/getstream/chat/android/models/Message;)Ljava/util/Date; @@ -3907,12 +3889,6 @@ public final class io/getstream/chat/android/ui/utils/extensions/UserKt { public static final fun getLastSeenText (Lio/getstream/chat/android/models/User;Landroid/content/Context;)Ljava/lang/String; } -public final class io/getstream/chat/android/ui/utils/extensions/ViewGroupKt { -} - -public final class io/getstream/chat/android/ui/utils/extensions/ViewKt { -} - public final class io/getstream/chat/android/ui/viewmodel/channels/ChannelListHeaderViewModel : androidx/lifecycle/ViewModel { public fun ()V public fun (Lio/getstream/chat/android/client/setup/state/ClientState;)V diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerMentionSuggestionsContent.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerMentionSuggestionsContent.kt index 8d840ba4b70..4a9d568e1b5 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerMentionSuggestionsContent.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerMentionSuggestionsContent.kt @@ -146,7 +146,7 @@ public interface MentionSuggestionsAdapter { */ private class MentionsAdapter( private val style: MessageComposerViewStyle, - private inline val mentionSelectionListener: (User) -> Unit, + private val mentionSelectionListener: (User) -> Unit, ) : SimpleListAdapter(), MentionSuggestionsAdapter { /** diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/EndlessMessageListScrollListener.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/EndlessMessageListScrollListener.kt index e7d08631f96..45af7a8c05a 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/EndlessMessageListScrollListener.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/EndlessMessageListScrollListener.kt @@ -32,8 +32,8 @@ import io.getstream.log.StreamLog */ public class EndlessMessageListScrollListener( private val loadMoreThreshold: Int, - private inline val loadMoreAtTopListener: () -> Unit, - private inline val loadMoreAtBottomListener: () -> Unit, + private val loadMoreAtTopListener: () -> Unit, + private val loadMoreAtBottomListener: () -> Unit, ) : RecyclerView.OnScrollListener() { init { diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/widgets/EndlessScrollListener.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/widgets/EndlessScrollListener.kt index ef9584025a6..62c99b2fb77 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/widgets/EndlessScrollListener.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/widgets/EndlessScrollListener.kt @@ -29,7 +29,7 @@ import androidx.recyclerview.widget.RecyclerView */ public class EndlessScrollListener( private val loadMoreThreshold: Int, - private inline val loadMoreListener: () -> Unit, + private val loadMoreListener: () -> Unit, ) : RecyclerView.OnScrollListener() { init { diff --git a/stream-chat-android-ui-guides/build.gradle b/stream-chat-android-ui-guides/build.gradle index 4045bc570ea..3bfa88f9b46 100644 --- a/stream-chat-android-ui-guides/build.gradle +++ b/stream-chat-android-ui-guides/build.gradle @@ -4,6 +4,7 @@ import io.getstream.chat.android.Versions plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id 'org.jetbrains.kotlin.plugin.compose' } apply from: "${rootDir}/scripts/android.gradle" @@ -33,10 +34,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion Versions.ANDROIDX_COMPOSE_COMPILER - } - lintOptions { disable 'MissingTranslation' } @@ -61,7 +58,6 @@ dependencies { implementation Dependencies.materialComponents // Compose - implementation Dependencies.composeCompiler implementation Dependencies.composeUi implementation Dependencies.composeUiTooling implementation Dependencies.composeFoundation diff --git a/stream-chat-android-ui-uitests/build.gradle b/stream-chat-android-ui-uitests/build.gradle index 4106fe3cb37..7f636cb0d24 100644 --- a/stream-chat-android-ui-uitests/build.gradle +++ b/stream-chat-android-ui-uitests/build.gradle @@ -4,6 +4,7 @@ import io.getstream.chat.android.Versions plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id 'org.jetbrains.kotlin.plugin.compose' id 'shot' } @@ -36,10 +37,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion Versions.ANDROIDX_COMPOSE_COMPILER - } - lintOptions { disable 'MissingTranslation' } @@ -70,7 +67,6 @@ dependencies { implementation Dependencies.materialComponents // Compose - implementation Dependencies.composeCompiler implementation Dependencies.composeUi implementation Dependencies.composeUiTooling implementation Dependencies.composeFoundation