Skip to content

Commit dc6c8e2

Browse files
committed
Update compose version to 1.4.0-beta01. Kotlin is updated for compatibility.
1 parent 918b11d commit dc6c8e2

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ android {
4545

4646
dependencies {
4747
implementation project(":bottomsheetdialog-compose")
48-
implementation platform(Dependencies.composeBom)
4948
implementation Dependencies.composeUI
5049
implementation Dependencies.composeFoundation
5150
implementation Dependencies.composeMaterial

bottomsheetdialog-compose/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ android {
5050
}
5151

5252
dependencies {
53-
implementation platform(Dependencies.composeBom)
5453
implementation Dependencies.composeUI
5554
implementation Dependencies.androidxActivityKtx
5655
implementation Dependencies.androidxCoreKtx

bottomsheetdialog-compose/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/BottomSheetDialog.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.holix.android.bottomsheetdialog.compose
22

3-
import android.annotation.SuppressLint
43
import android.content.Context
54
import android.graphics.Outline
65
import android.os.Build
@@ -11,7 +10,6 @@ import androidx.annotation.IntRange
1110
import androidx.annotation.Px
1211
import androidx.compose.runtime.*
1312
import androidx.compose.runtime.saveable.rememberSaveable
14-
import androidx.compose.ui.ExperimentalComposeUiApi
1513
import androidx.compose.ui.Modifier
1614
import androidx.compose.ui.graphics.Color
1715
import androidx.compose.ui.graphics.compositeOver
@@ -27,8 +25,10 @@ import androidx.compose.ui.unit.LayoutDirection
2725
import androidx.compose.ui.unit.dp
2826
import androidx.compose.ui.window.SecureFlagPolicy
2927
import androidx.core.view.WindowCompat
30-
import androidx.lifecycle.ViewTreeLifecycleOwner
31-
import androidx.lifecycle.ViewTreeViewModelStoreOwner
28+
import androidx.lifecycle.findViewTreeLifecycleOwner
29+
import androidx.lifecycle.findViewTreeViewModelStoreOwner
30+
import androidx.lifecycle.setViewTreeLifecycleOwner
31+
import androidx.lifecycle.setViewTreeViewModelStoreOwner
3232
import androidx.savedstate.findViewTreeSavedStateRegistryOwner
3333
import androidx.savedstate.setViewTreeSavedStateRegistryOwner
3434
import com.google.android.material.bottomsheet.BottomSheetBehavior.*
@@ -252,7 +252,6 @@ private val BlackScrimmed: (Color) -> Color = { original ->
252252
* @param properties [BottomSheetDialogProperties] for further customization of this dialog's behavior.
253253
* @param content The content to be displayed inside the dialog.
254254
*/
255-
@OptIn(ExperimentalComposeUiApi::class)
256255
@Composable
257256
fun BottomSheetDialog(
258257
onDismissRequest: () -> Unit,
@@ -431,8 +430,8 @@ private class BottomSheetDialogWrapper(
431430
// Turn of all clipping so shadows can be drawn outside the window
432431
(window.decorView as? ViewGroup)?.disableClipping()
433432
setContentView(bottomSheetDialogLayout)
434-
ViewTreeLifecycleOwner.set(bottomSheetDialogLayout, ViewTreeLifecycleOwner.get(composeView))
435-
ViewTreeViewModelStoreOwner.set(bottomSheetDialogLayout, ViewTreeViewModelStoreOwner.get(composeView))
433+
bottomSheetDialogLayout.setViewTreeLifecycleOwner(composeView.findViewTreeLifecycleOwner())
434+
bottomSheetDialogLayout.setViewTreeViewModelStoreOwner(composeView.findViewTreeViewModelStoreOwner())
436435
bottomSheetDialogLayout.setViewTreeSavedStateRegistryOwner(
437436
composeView.findViewTreeSavedStateRegistryOwner()
438437
)

buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Versions.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package com.holix.android.bottomsheetdialog.compose
33
object Versions {
44
internal const val ANDROID_GRADLE_PLUGIN = "7.3.1"
55
internal const val GRADLE_NEXUS_PUBLISH_PLUGIN = "1.1.0"
6-
internal const val KOTLIN = "1.7.20"
6+
internal const val KOTLIN = "1.8.0"
77

88
internal const val MATERIAL = "1.8.0"
99
internal const val ANDROIDX_CORE_KTX = "1.9.0"
1010

1111
internal const val COMPOSE_BOM = "2023.01.00"
12-
const val COMPOSE_COMPILER = "1.3.2"
12+
internal const val COMPOSE = "1.4.0-beta01"
13+
const val COMPOSE_COMPILER = "1.4.1"
1314
internal const val ANDROIDX_ACTIVITY = "1.5.1"
1415

1516
internal const val COLOR_PICKER = "1.0.0"
@@ -27,11 +28,11 @@ object Dependencies {
2728
const val androidxCoreKtx = "androidx.core:core-ktx:${Versions.ANDROIDX_CORE_KTX}"
2829

2930
const val composeBom = "androidx.compose:compose-bom:${Versions.COMPOSE_BOM}"
30-
const val composeUI = "androidx.compose.ui:ui"
31-
const val composeRuntime = "androidx.compose.runtime:runtime"
32-
const val composeMaterial = "androidx.compose.material:material"
33-
const val composeFoundation = "androidx.compose.foundation:foundation"
34-
const val composeTooling = "androidx.compose.ui:ui-tooling"
31+
const val composeUI = "androidx.compose.ui:ui:${Versions.COMPOSE}"
32+
const val composeRuntime = "androidx.compose.runtime:runtime:${Versions.COMPOSE}"
33+
const val composeMaterial = "androidx.compose.material:material:${Versions.COMPOSE}"
34+
const val composeFoundation = "androidx.compose.foundation:foundation:${Versions.COMPOSE}"
35+
const val composeTooling = "androidx.compose.ui:ui-tooling:${Versions.COMPOSE}"
3536
const val composeActivity = "androidx.activity:activity-compose:${Versions.ANDROIDX_ACTIVITY}"
3637

3738
const val colorPicker = "com.github.skydoves:colorpicker-compose:${Versions.COLOR_PICKER}"

0 commit comments

Comments
 (0)