Skip to content

Commit

Permalink
Remove deprecated Dialog overload
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstyl committed Oct 5, 2024
1 parent cc158a5 commit 1312f7b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
14 changes: 1 addition & 13 deletions core/src/commonMain/kotlin/Dialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private val DialogStateSaver = run {
"This function is going away soon. Use the updated function with renamed parameters",
ReplaceWith("rememberDialogState(initiallyVisible = visible)")
)
public fun rememberDialogState(visible: Boolean = false, ____deprecated_constructor: Unit): DialogState {
public fun rememberDialogState(visible: Boolean = false, ____deprecated_constructor: Unit = Unit): DialogState {
return rememberDialogState(initiallyVisible = visible)
}

Expand All @@ -71,18 +71,6 @@ public fun rememberDialogState(initiallyVisible: Boolean): DialogState {
return rememberSaveable(saver = DialogStateSaver) { DialogState(initiallyVisible) }
}

@Deprecated(
"This overload will go away in a future version of the library. Use overload with explicit default state",
ReplaceWith("Dialog(rememberDialogState(),properties,content)")
)
@Composable
public fun Dialog(
properties: DialogProperties = DialogProperties(),
content: @Composable() (DialogScope.() -> Unit)
) {
Dialog(rememberDialogState(initiallyVisible = false), properties, content)
}

@Composable
public fun Dialog(
state: DialogState,
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/Modal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package com.composables.core
import androidx.compose.runtime.Composable

@Composable
expect internal fun Modal(protectNavBars: Boolean = false, content: @Composable () -> Unit)
internal expect fun Modal(protectNavBars: Boolean = false, content: @Composable () -> Unit)
2 changes: 1 addition & 1 deletion demo-dialog/src/commonMain/kotlin/DialogDemo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ val AppTheme = buildComposeTheme { }
@Composable
fun DialogDemo() {
AppTheme {
val dialogState = rememberDialogState()
val dialogState = rememberDialogState(initiallyVisible = false)

Box(
modifier = Modifier.fillMaxSize()
Expand Down

0 comments on commit 1312f7b

Please sign in to comment.