43 lines
1.3 KiB
Kotlin
43 lines
1.3 KiB
Kotlin
package components.questiondialog
|
|
|
|
import androidx.compose.foundation.layout.fillMaxHeight
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
import androidx.compose.material.AlertDialog
|
|
import androidx.compose.material.ExperimentalMaterialApi
|
|
import androidx.compose.material.UndecoratedWindowAlertDialogProvider
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.Modifier
|
|
import components.QuestionDialogButtons
|
|
import data.Player
|
|
import data.QuestionData
|
|
import data.Topic
|
|
|
|
@Suppress("FunctionName")
|
|
@OptIn(ExperimentalMaterialApi::class)
|
|
@Composable
|
|
fun QuestionDialogue(
|
|
topic: Topic,
|
|
questionData: QuestionData,
|
|
players: List<Player>,
|
|
doublePoints: Boolean,
|
|
onResolve: () -> Unit,
|
|
onPointsChange: (Player, Long) -> Unit
|
|
) {
|
|
AlertDialog(
|
|
dialogProvider = UndecoratedWindowAlertDialogProvider,
|
|
modifier = Modifier.fillMaxWidth()
|
|
.fillMaxHeight(),
|
|
onDismissRequest = { },
|
|
buttons = {
|
|
QuestionDialogButtons(
|
|
topic = topic,
|
|
questionData = questionData,
|
|
players = players,
|
|
onPointsChange = onPointsChange,
|
|
onResolve = onResolve,
|
|
doublePoints = doublePoints
|
|
)
|
|
}
|
|
)
|
|
}
|