Skip to content

Commit fa44c8d

Browse files
authored
Migrate to Compose 1.7.0 stable and other compose relevant dependencies (#1177)
1 parent b0c0ad8 commit fa44c8d

File tree

11 files changed

+54
-59
lines changed

11 files changed

+54
-59
lines changed

build-logic/convention/src/main/kotlin/io/getstream/video/AndroidCompose.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import org.gradle.kotlin.dsl.configure
88
import org.gradle.kotlin.dsl.dependencies
99
import org.gradle.kotlin.dsl.getByType
1010
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
11+
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
1112

1213
/**
1314
* Configure Compose-specific options
@@ -31,7 +32,7 @@ internal fun Project.configureAndroidCompose(
3132
}
3233

3334
extensions.configure<ComposeCompilerGradlePluginExtension> {
34-
enableStrongSkippingMode = true
35+
featureFlags.addAll(ComposeFeatureFlag.StrongSkipping, ComposeFeatureFlag.IntrinsicRemember)
3536
reportsDestination = layout.buildDirectory.dir("compose_compiler")
3637
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("compose_compiler_config.conf")
3738
}

demo-app/src/main/kotlin/io/getstream/video/android/ui/call/LandscapeControls.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import androidx.compose.material.icons.filled.CallEnd
2929
import androidx.compose.runtime.Composable
3030
import androidx.compose.runtime.getValue
3131
import androidx.compose.ui.Alignment
32-
import androidx.compose.ui.ExperimentalComposeUiApi
3332
import androidx.compose.ui.Modifier
3433
import androidx.compose.ui.platform.LocalContext
3534
import androidx.compose.ui.tooling.preview.Preview
@@ -48,7 +47,6 @@ import io.getstream.video.android.mock.StreamPreviewDataUtils
4847
import io.getstream.video.android.mock.previewCall
4948
import io.getstream.video.android.tooling.extensions.toPx
5049

51-
@OptIn(ExperimentalComposeUiApi::class)
5250
@Composable
5351
fun LandscapeControls(call: Call, onDismiss: () -> Unit) {
5452
val isCameraEnabled by call.camera.isEnabled.collectAsStateWithLifecycle()

demo-app/src/main/kotlin/io/getstream/video/android/ui/call/LayoutChooser.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
@file:OptIn(ExperimentalLayoutApi::class)
18-
1917
package io.getstream.video.android.ui.call
2018

2119
import androidx.compose.foundation.background
2220
import androidx.compose.foundation.layout.Column
23-
import androidx.compose.foundation.layout.ExperimentalLayoutApi
2421
import androidx.compose.foundation.layout.width
2522
import androidx.compose.material.icons.Icons
2623
import androidx.compose.material.icons.filled.AutoAwesome

demo-app/src/main/kotlin/io/getstream/video/android/ui/call/ParticipantsDialog.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package io.getstream.video.android.ui.call
1818

1919
import android.content.ClipboardManager
2020
import android.content.Context
21-
import androidx.compose.foundation.ExperimentalFoundationApi
2221
import androidx.compose.foundation.background
2322
import androidx.compose.foundation.layout.Arrangement
2423
import androidx.compose.foundation.layout.Box
@@ -100,7 +99,6 @@ fun ParticipantsList(call: Call) {
10099
ParticipantsListContent(call, clipboardManager, participants)
101100
}
102101

103-
@OptIn(ExperimentalFoundationApi::class)
104102
@Composable
105103
fun ParticipantsListContent(
106104
call: Call,

demo-app/src/main/kotlin/io/getstream/video/android/ui/login/LoginScreen.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
2727
import androidx.compose.foundation.layout.Arrangement
2828
import androidx.compose.foundation.layout.Box
2929
import androidx.compose.foundation.layout.Column
30-
import androidx.compose.foundation.layout.ExperimentalLayoutApi
3130
import androidx.compose.foundation.layout.Row
3231
import androidx.compose.foundation.layout.Spacer
3332
import androidx.compose.foundation.layout.fillMaxSize
@@ -48,7 +47,7 @@ import androidx.compose.material.icons.filled.Email
4847
import androidx.compose.material.icons.filled.Settings
4948
import androidx.compose.material.icons.outlined.Adb
5049
import androidx.compose.material.icons.outlined.GroupAdd
51-
import androidx.compose.material.ripple.rememberRipple
50+
import androidx.compose.material.ripple
5251
import androidx.compose.runtime.Composable
5352
import androidx.compose.runtime.LaunchedEffect
5453
import androidx.compose.runtime.collectAsState
@@ -408,7 +407,7 @@ private fun BuiltInUsersLoginDialog(
408407
.fillMaxWidth()
409408
.clickable(
410409
interactionSource = remember { MutableInteractionSource() },
411-
indication = rememberRipple(bounded = true),
410+
indication = ripple(bounded = true),
412411
onClick = {
413412
login(true, LoginEvent.SignIn(user))
414413
onDismissRequest()
@@ -439,7 +438,6 @@ private fun BuiltInUsersLoginDialog(
439438
)
440439
}
441440

442-
@OptIn(ExperimentalLayoutApi::class)
443441
@Composable
444442
fun SelectableDialog(
445443
items: List<StreamEnvironment>,

demo-app/src/main/kotlin/io/getstream/video/android/ui/menu/SettingsMenu.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import androidx.compose.runtime.getValue
3939
import androidx.compose.runtime.remember
4040
import androidx.compose.runtime.rememberCoroutineScope
4141
import androidx.compose.ui.Alignment
42-
import androidx.compose.ui.ExperimentalComposeUiApi
4342
import androidx.compose.ui.Modifier
4443
import androidx.compose.ui.platform.LocalContext
4544
import androidx.compose.ui.tooling.preview.Preview
@@ -63,7 +62,7 @@ import io.getstream.video.android.util.filters.SampleAudioFilter
6362
import kotlinx.coroutines.launch
6463
import java.nio.ByteBuffer
6564

66-
@OptIn(ExperimentalComposeUiApi::class, ExperimentalPermissionsApi::class)
65+
@OptIn(ExperimentalPermissionsApi::class)
6766
@Composable
6867
internal fun SettingsMenu(
6968
call: Call,

gradle/libs.versions.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ androidGradlePlugin = "8.4.2"
33
cameraCamera2 = "1.3.0"
44
spotless = "6.21.0"
55
nexusPlugin = "1.3.0"
6-
kotlin = "2.0.0"
7-
ksp = "2.0.0-1.0.22"
8-
kotlinSerialization = "1.6.3"
6+
kotlin = "2.0.20"
7+
ksp = "2.0.20-1.0.25"
8+
kotlinSerialization = "1.7.1"
99
kotlinSerializationConverter = "1.0.0"
10-
kotlinxCoroutines = "1.8.0"
10+
kotlinxCoroutines = "1.8.1"
1111

1212
kotlinDokka = "1.9.20"
1313
jvmTarget = "11"
@@ -16,21 +16,21 @@ androidxMaterial = "1.11.0"
1616
androidxAppCompat = "1.6.1"
1717
androidxCore = "1.12.0"
1818
androidxAnnotation = "1.7.1"
19-
androidxLifecycle = "2.7.0"
19+
androidxLifecycle = "2.8.5"
2020
androidxStartup = "1.1.1"
21-
androidxActivity = "1.9.0"
21+
androidxActivity = "1.9.2"
2222
androidxDataStore = "1.0.0"
2323
googleService = "4.3.14"
2424

25-
androidxComposeBom = "2024.06.00"
25+
androidxComposeBom = "2024.09.00"
2626
androidxComposeTracing = "1.0.0-beta01"
2727
androidxHiltNavigation = "1.2.0"
28-
androidxComposeNavigation = "2.7.7"
28+
androidxComposeNavigation = "2.8.0"
2929
composeStableMarker = "1.0.5"
3030

3131
coil = "2.6.0"
32-
landscapist = "2.3.5"
33-
accompanist = "0.32.0"
32+
landscapist = "2.3.6"
33+
accompanist = "0.34.0"
3434
telephoto = "0.3.0"
3535
audioswitch = "1.1.8"
3636
libyuv = "0.30.0"
@@ -44,7 +44,7 @@ tink = "1.9.0"
4444
turbine = "0.13.0"
4545

4646
streamWebRTC = "1.1.2"
47-
streamResult = "1.1.0"
47+
streamResult = "1.2.0"
4848
streamChat = "6.0.13"
4949
streamLog = "1.1.4"
5050
streamPush = "1.1.7"
@@ -72,10 +72,10 @@ playAppUpdate = "2.1.0"
7272

7373
hilt = "2.51.1"
7474
leakCanary = "2.13"
75-
binaryCompatabilityValidator = "0.14.0"
75+
binaryCompatabilityValidator = "0.16.3"
7676
playPublisher = "3.8.4"
7777

78-
googleMlKitSelfieSegmentation = "16.0.0-beta4"
78+
googleMlKitSelfieSegmentation = "16.0.0-beta6"
7979

8080
[libraries]
8181
androidx-camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "cameraCamera2" }

stream-video-android-ui-compose/api/stream-video-android-ui-compose.api

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ public final class io/getstream/video/android/compose/theme/StreamDimens$Compani
260260
public final fun defaultDimens (Landroidx/compose/runtime/Composer;I)Lio/getstream/video/android/compose/theme/StreamDimens;
261261
}
262262

263+
public final class io/getstream/video/android/compose/theme/StreamRippleConfiguration {
264+
public static final field $stable I
265+
public static final field INSTANCE Lio/getstream/video/android/compose/theme/StreamRippleConfiguration;
266+
public final fun default (Landroidx/compose/runtime/Composer;I)Landroidx/compose/material/RippleConfiguration;
267+
}
268+
263269
public final class io/getstream/video/android/compose/theme/StreamShapes {
264270
public static final field $stable I
265271
public static final field Companion Lio/getstream/video/android/compose/theme/StreamShapes$Companion;
@@ -295,7 +301,7 @@ public abstract interface class io/getstream/video/android/compose/theme/StreamT
295301
public fun getColors (Landroidx/compose/runtime/Composer;I)Lio/getstream/video/android/compose/theme/StreamColors;
296302
public fun getDimens (Landroidx/compose/runtime/Composer;I)Lio/getstream/video/android/compose/theme/StreamDimens;
297303
public fun getReactionMapper (Landroidx/compose/runtime/Composer;I)Lio/getstream/video/android/core/mapper/ReactionMapper;
298-
public fun getRippleTheme (Landroidx/compose/runtime/Composer;I)Landroidx/compose/material/ripple/RippleTheme;
304+
public fun getRippleConfiguration (Landroidx/compose/runtime/Composer;I)Landroidx/compose/material/RippleConfiguration;
299305
public fun getShapes (Landroidx/compose/runtime/Composer;I)Lio/getstream/video/android/compose/theme/StreamShapes;
300306
public fun getStyles (Landroidx/compose/runtime/Composer;I)Lio/getstream/video/android/compose/ui/components/base/styling/CompositeStyleProvider;
301307
public fun getTypography (Landroidx/compose/runtime/Composer;I)Lio/getstream/video/android/compose/theme/StreamTypography;
@@ -350,7 +356,7 @@ public final class io/getstream/video/android/compose/theme/VideoTheme : io/gets
350356
}
351357

352358
public final class io/getstream/video/android/compose/theme/VideoThemeKt {
353-
public static final fun VideoTheme (ZLio/getstream/video/android/compose/theme/StreamColors;Lio/getstream/video/android/compose/theme/StreamDimens;Lio/getstream/video/android/compose/theme/StreamTypography;Lio/getstream/video/android/compose/theme/StreamShapes;Landroidx/compose/material/ripple/RippleTheme;Lio/getstream/video/android/core/mapper/ReactionMapper;ZLio/getstream/video/android/compose/ui/components/base/styling/CompositeStyleProvider;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
359+
public static final fun VideoTheme (ZLio/getstream/video/android/compose/theme/StreamColors;Lio/getstream/video/android/compose/theme/StreamDimens;Lio/getstream/video/android/compose/theme/StreamTypography;Lio/getstream/video/android/compose/theme/StreamShapes;Lio/getstream/video/android/compose/theme/StreamRippleConfiguration;Lio/getstream/video/android/core/mapper/ReactionMapper;ZLio/getstream/video/android/compose/ui/components/base/styling/CompositeStyleProvider;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
354360
}
355361

356362
public final class io/getstream/video/android/compose/ui/ComposableSingletons$StreamCallActivityComposeDelegateKt {

stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/theme/StreamRippleTheme.kt renamed to stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/theme/StreamRippleConfiguration.kt

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,31 @@
1414
* limitations under the License.
1515
*/
1616

17+
@file:OptIn(ExperimentalMaterialApi::class)
18+
1719
package io.getstream.video.android.compose.theme
1820

19-
import androidx.compose.foundation.isSystemInDarkTheme
21+
import androidx.compose.material.ExperimentalMaterialApi
2022
import androidx.compose.material.LocalContentColor
23+
import androidx.compose.material.LocalRippleConfiguration
2124
import androidx.compose.material.MaterialTheme
22-
import androidx.compose.material.ripple.RippleAlpha
23-
import androidx.compose.material.ripple.RippleTheme
25+
import androidx.compose.material.RippleConfiguration
2426
import androidx.compose.runtime.Composable
25-
import androidx.compose.runtime.Immutable
26-
import androidx.compose.ui.graphics.Color
27+
import androidx.compose.runtime.ReadOnlyComposable
2728

2829
/**
29-
* A modified version of the default [RippleTheme] from [MaterialTheme] which
30+
* A modified version of the default [RippleConfiguration] from [MaterialTheme] which
3031
* works in case the [MaterialTheme] is not initialized.
3132
*/
32-
@Immutable
33-
internal object StreamRippleTheme : RippleTheme {
34-
@Composable
35-
override fun defaultColor(): Color {
36-
return RippleTheme.defaultRippleColor(
37-
contentColor = LocalContentColor.current,
38-
lightTheme = !isSystemInDarkTheme(),
39-
)
40-
}
33+
public object StreamRippleConfiguration {
4134

4235
@Composable
43-
override fun rippleAlpha(): RippleAlpha {
44-
return RippleTheme.defaultRippleAlpha(
45-
contentColor = LocalContentColor.current,
46-
lightTheme = !isSystemInDarkTheme(),
47-
)
36+
@ReadOnlyComposable
37+
public fun default(): RippleConfiguration {
38+
val rippleConfiguration = LocalRippleConfiguration.current
39+
if (rippleConfiguration != null) return rippleConfiguration
40+
41+
val contentColor = LocalContentColor.current
42+
return RippleConfiguration(color = contentColor)
4843
}
4944
}

stream-video-android-ui-compose/src/main/kotlin/io/getstream/video/android/compose/theme/VideoTheme.kt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ package io.getstream.video.android.compose.theme
2020

2121
import androidx.compose.foundation.isSystemInDarkTheme
2222
import androidx.compose.foundation.layout.Box
23-
import androidx.compose.material.ripple.LocalRippleTheme
24-
import androidx.compose.material.ripple.RippleTheme
23+
import androidx.compose.material.ExperimentalMaterialApi
24+
import androidx.compose.material.LocalRippleConfiguration
25+
import androidx.compose.material.RippleConfiguration
2526
import androidx.compose.runtime.Composable
2627
import androidx.compose.runtime.CompositionLocalProvider
2728
import androidx.compose.runtime.ReadOnlyComposable
@@ -72,18 +73,19 @@ private val LocalStyles = compositionLocalOf<CompositeStyleProvider> {
7273
* @param dimens The set of dimens we provide, wrapped in [StreamDimens].
7374
* @param typography The set of typography styles we provide, wrapped in [StreamTypography].
7475
* @param shapes The set of shapes we provide, wrapped in [StreamShapes].
75-
* @param rippleTheme Defines the appearance for ripples.
76+
* @param rippleConfiguration Defines the appearance for ripples.
7677
* @param reactionMapper Defines a mapper of the emoji code from the reaction events.
7778
* @param content The content shown within the theme wrapper.
7879
*/
7980
@Composable
81+
@OptIn(ExperimentalMaterialApi::class)
8082
public fun VideoTheme(
8183
isInDarkMode: Boolean = isSystemInDarkTheme(),
8284
colors: StreamColors = StreamColors.defaultColors(),
8385
dimens: StreamDimens = StreamDimens.defaultDimens(),
8486
typography: StreamTypography = StreamTypography.defaultTypography(colors, dimens),
8587
shapes: StreamShapes = StreamShapes.defaultShapes(dimens),
86-
rippleTheme: RippleTheme = StreamRippleTheme,
88+
rippleConfiguration: StreamRippleConfiguration = StreamRippleConfiguration,
8789
reactionMapper: ReactionMapper = ReactionMapper.defaultReactionMapper(),
8890
allowUIAutomationTest: Boolean = true,
8991
styles: CompositeStyleProvider = CompositeStyleProvider(),
@@ -94,7 +96,7 @@ public fun VideoTheme(
9496
LocalDimens provides dimens,
9597
LocalTypography provides typography,
9698
LocalShapes provides shapes,
97-
LocalRippleTheme provides rippleTheme,
99+
LocalRippleConfiguration provides rippleConfiguration.default(),
98100
LocalReactionMapper provides reactionMapper,
99101
LocalStyles provides styles,
100102
) {
@@ -108,6 +110,7 @@ public fun VideoTheme(
108110
}
109111
}
110112

113+
@OptIn(ExperimentalMaterialApi::class)
111114
public interface StreamTheme {
112115
/**
113116
* Retrieves the current [StreamColors] at the call site's position in the hierarchy.
@@ -138,11 +141,11 @@ public interface StreamTheme {
138141
get() = LocalShapes.current
139142

140143
/**
141-
* Retrieves the current [RippleTheme] at the call site's position in the hierarchy.
144+
* Retrieves the current [RippleConfiguration] at the call site's position in the hierarchy.
142145
*/
143-
public val rippleTheme: RippleTheme
146+
public val rippleConfiguration: RippleConfiguration?
144147
@Composable @ReadOnlyComposable
145-
get() = LocalRippleTheme.current
148+
get() = StreamRippleConfiguration.default()
146149

147150
/**
148151
* Retrieves the current [ReactionMapper] at the call site's position in the hierarchy.

0 commit comments

Comments
 (0)