diff --git a/composeApp/src/commonMain/composeResources/drawable/baseline_subject_24.xml b/composeApp/src/commonMain/composeResources/drawable/baseline_subject_24.xml
new file mode 100644
index 0000000..6d392e8
--- /dev/null
+++ b/composeApp/src/commonMain/composeResources/drawable/baseline_subject_24.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/composeApp/src/commonMain/composeResources/drawable/outline_adjust_24.xml b/composeApp/src/commonMain/composeResources/drawable/outline_adjust_24.xml
new file mode 100644
index 0000000..133f554
--- /dev/null
+++ b/composeApp/src/commonMain/composeResources/drawable/outline_adjust_24.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/composeApp/src/commonMain/composeResources/drawable/outline_time_auto_24.xml b/composeApp/src/commonMain/composeResources/drawable/outline_time_auto_24.xml
new file mode 100644
index 0000000..a340186
--- /dev/null
+++ b/composeApp/src/commonMain/composeResources/drawable/outline_time_auto_24.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt
index a4a30c2..750ae79 100644
--- a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt
+++ b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt
@@ -1,11 +1,13 @@
package ru.csasq.cit_is_bot.ui.dialogs
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
@@ -16,6 +18,7 @@ import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
+import androidx.compose.material3.ExtendedFloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
@@ -35,6 +38,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import cit_is_bot.composeapp.generated.resources.Res
+import cit_is_bot.composeapp.generated.resources.baseline_add_24
import cit_is_bot.composeapp.generated.resources.baseline_attach_file_24
import cit_is_bot.composeapp.generated.resources.baseline_ballot_24
import cit_is_bot.composeapp.generated.resources.baseline_casino_24
@@ -42,7 +46,10 @@ import cit_is_bot.composeapp.generated.resources.baseline_close_24
import cit_is_bot.composeapp.generated.resources.baseline_contacts_24
import cit_is_bot.composeapp.generated.resources.baseline_date_range_24
import cit_is_bot.composeapp.generated.resources.baseline_more_vert_24
+import cit_is_bot.composeapp.generated.resources.baseline_subject_24
import cit_is_bot.composeapp.generated.resources.baseline_title_24
+import cit_is_bot.composeapp.generated.resources.outline_adjust_24
+import cit_is_bot.composeapp.generated.resources.outline_time_auto_24
import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.painterResource
import ru.csasq.cit_is_bot.ui.screens.Scenario
@@ -52,7 +59,7 @@ enum class MessageType(
val displayName: String,
val icon: DrawableResource,
) {
- TEXT(1, "Текст", Res.drawable.baseline_title_24),
+ TEXT(1, "Текст", Res.drawable.baseline_subject_24),
POLL(2, "Опрос", Res.drawable.baseline_ballot_24),
MEDIA(3, "Медиа", Res.drawable.baseline_attach_file_24),
CONTACT(4, "Контакт", Res.drawable.baseline_contacts_24),
@@ -164,16 +171,36 @@ fun ScenarioDialog(
},
)
},
- ) {
+ floatingActionButton = {
+ ExtendedFloatingActionButton(
+ text = {
+ Text(
+ text = "Добавить сообщение",
+ )
+ },
+ onClick = {},
+ icon = {
+ Icon(
+ painter = painterResource(Res.drawable.baseline_add_24),
+ contentDescription = null,
+ )
+ },
+ expanded = true,
+ )
+ },
+ ) { paddingValues ->
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(
state = rememberScrollState(),
)
- .padding(it)
+ .padding(paddingValues)
.padding(
horizontal = 16.dp,
+ )
+ .padding(
+ bottom = 88.dp,
),
) {
OutlinedTextField(
@@ -266,7 +293,63 @@ fun ScenarioDialog(
)
Spacer(
modifier = Modifier
- .height(16.dp),
+ .height(8.dp),
+ )
+ OutlinedTextField(
+ value = "",
+ onValueChange = {},
+ modifier = Modifier
+ .fillMaxWidth(),
+ label = {
+ Text(
+ text = "Название",
+ )
+ },
+ leadingIcon = {
+ Icon(
+ painter = painterResource(Res.drawable.baseline_title_24),
+ contentDescription = null,
+ )
+ },
+ supportingText = {
+ Text(
+ text = "Отображается в списке переходов",
+ )
+ },
+ isError = false,
+ singleLine = true,
+ )
+ Spacer(
+ modifier = Modifier
+ .height(8.dp),
+ )
+ OutlinedTextField(
+ value = "",
+ onValueChange = {},
+ modifier = Modifier
+ .fillMaxWidth(),
+ label = {
+ Text(
+ text = "Время окончания",
+ )
+ },
+ leadingIcon = {
+ Icon(
+ painter = painterResource(Res.drawable.outline_time_auto_24),
+ contentDescription = null,
+ )
+ },
+ supportingText = {
+ Text(
+ text = "Время прекращения обработки событий",
+ )
+ },
+ isError = false,
+ singleLine = true,
+ )
+ Spacer(
+ modifier = Modifier
+ .height(8.dp),
)
ExposedDropdownMenuBox(
expanded = dropdownMenuState.value,
@@ -302,7 +385,6 @@ fun ScenarioDialog(
expanded = dropdownMenuState.value,
)
},
- supportingText = {},
isError = false,
singleLine = true,
)
@@ -333,6 +415,109 @@ fun ScenarioDialog(
}
}
}
+ Spacer(
+ modifier = Modifier
+ .height(16.dp),
+ )
+ Text(
+ text = messageTypeState.value.displayName,
+ style = MaterialTheme.typography.titleMedium,
+ )
+ Spacer(
+ modifier = Modifier
+ .height(8.dp),
+ )
+
+ when (messageTypeState.value) {
+ MessageType.TEXT -> {
+ val textState = remember {
+ mutableStateOf("")
+ }
+ OutlinedTextField(
+ value = textState.value,
+ onValueChange = { value ->
+ textState.value = value
+ },
+ modifier = Modifier
+ .fillMaxWidth(),
+ label = {
+ Text(
+ text = "Текст сообщения",
+ )
+ },
+ isError = false,
+ maxLines = 6,
+ )
+ }
+ MessageType.POLL -> {
+ val questionState = remember {
+ mutableStateOf("")
+ }
+ OutlinedTextField(
+ value = questionState.value,
+ onValueChange = { value ->
+ questionState.value = value
+ },
+ modifier = Modifier
+ .fillMaxWidth(),
+ label = {
+ Text(
+ text = "Вопрос",
+ )
+ },
+ isError = false,
+ singleLine = true,
+ maxLines = 3,
+ )
+ Spacer(
+ modifier = Modifier
+ .height(16.dp),
+ )
+ Text(
+ text = "Варианты ответа",
+ style = MaterialTheme.typography.titleMedium,
+ )
+ Spacer(
+ modifier = Modifier
+ .height(8.dp),
+ )
+ val optionState = remember {
+ mutableStateOf("")
+ }
+ Row {
+ OutlinedTextField(
+ value = optionState.value,
+ onValueChange = { value ->
+ optionState.value = value
+ },
+ modifier = Modifier
+ .weight(
+ weight = 1f,
+ fill = true,
+ ),
+ label = {},
+ isError = false,
+ singleLine = true,
+ maxLines = 3,
+ )
+ Spacer(
+ modifier = Modifier
+ .width(8.dp),
+ )
+ IconButton(
+ onClick = {},
+ ) {
+ Icon(
+ painter = painterResource(Res.drawable.outline_adjust_24),
+ contentDescription = null,
+ )
+ }
+ }
+ }
+ MessageType.MEDIA -> {}
+ MessageType.CONTACT -> {}
+ MessageType.DICE -> {}
+ }
}
}
}