Skip to content

Commit 35fe094

Browse files
Merge pull request #119 from kalinjul/main
Add DialogProperties parameter for resizing dialog content
2 parents 778b937 + 8ef505c commit 35fe094

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/src/main/java/com/vanpra/composematerialdialogs/MaterialDialog.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import androidx.compose.ui.platform.testTag
3333
import androidx.compose.ui.unit.Dp
3434
import androidx.compose.ui.unit.dp
3535
import androidx.compose.ui.window.Dialog
36+
import androidx.compose.ui.window.DialogProperties
3637
import java.util.concurrent.atomic.AtomicInteger
3738
import kotlin.math.min
3839

@@ -204,6 +205,7 @@ fun rememberMaterialDialogState(initialValue: Boolean = false): MaterialDialogSt
204205
/**
205206
* Builds a dialog with the given content
206207
* @param dialogState state of the dialog
208+
* @param properties properties of the compose dialog
207209
* @param backgroundColor background color of the dialog
208210
* @param shape shape of the dialog and components used in the dialog
209211
* @param border border stoke of the dialog
@@ -216,6 +218,7 @@ fun rememberMaterialDialogState(initialValue: Boolean = false): MaterialDialogSt
216218
@Composable
217219
fun MaterialDialog(
218220
dialogState: MaterialDialogState = rememberMaterialDialogState(),
221+
properties: DialogProperties = DialogProperties(),
219222
backgroundColor: Color = MaterialTheme.colors.surface,
220223
shape: Shape = MaterialTheme.shapes.medium,
221224
border: BorderStroke? = null,
@@ -248,7 +251,10 @@ fun MaterialDialog(
248251
elevation = elevation
249252
) ?: MaterialTheme.colors.surface
250253

251-
Dialog(onDismissRequest = { onCloseRequest(dialogState) }) {
254+
Dialog(
255+
properties = properties,
256+
onDismissRequest = { onCloseRequest(dialogState) }
257+
) {
252258
Surface(
253259
modifier = Modifier
254260
.fillMaxWidth()

0 commit comments

Comments
 (0)