Added popupPositionProvider to MaterialDialog
This commit is contained in:
parent
b518c5007e
commit
2b479d1d3f
1 changed files with 13 additions and 2 deletions
|
@ -14,15 +14,26 @@ import androidx.compose.ui.draw.alpha
|
|||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.*
|
||||
import androidx.compose.ui.window.Popup
|
||||
import androidx.compose.ui.window.PopupPositionProvider
|
||||
|
||||
@Composable
|
||||
fun MaterialDialog(
|
||||
alignment: Alignment = Alignment.Center,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
Popup(focusable = true) {
|
||||
Popup(
|
||||
focusable = true,
|
||||
popupPositionProvider = object: PopupPositionProvider {
|
||||
override fun calculatePosition(
|
||||
anchorBounds: IntRect,
|
||||
windowSize: IntSize,
|
||||
layoutDirection: LayoutDirection,
|
||||
popupContentSize: IntSize
|
||||
): IntOffset = IntOffset.Zero
|
||||
}
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
|
|
Loading…
Reference in a new issue