Проработано диалоговое окно сценария
Этот коммит содержится в:
родитель
58d92406ff
Коммит
bab24d6e07
@ -0,0 +1,5 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="#ffffff" android:pathData="M14,17L4,17v2h10v-2zM20,9L4,9v2h16L20,9zM4,15h16v-2L4,13v2zM4,5v2h16L20,5L4,5z"/>
|
||||||
|
|
||||||
|
</vector>
|
@ -0,0 +1,5 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="#ffffff" android:pathData="M480,600Q530,600 565,565Q600,530 600,480Q600,430 565,395Q530,360 480,360Q430,360 395,395Q360,430 360,480Q360,530 395,565Q430,600 480,600ZM480,880Q397,880 324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880ZM480,800Q614,800 707,707Q800,614 800,480Q800,346 707,253Q614,160 480,160Q346,160 253,253Q160,346 160,480Q160,614 253,707Q346,800 480,800ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>
|
||||||
|
|
||||||
|
</vector>
|
@ -0,0 +1,5 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="#ffffff" android:pathData="M320,680L394,680L417,610L541,610L564,680L640,680L520,342L440,342L320,680ZM436,552L480,420L523,552L436,552ZM360,120L360,40L600,40L600,120L360,120ZM480,880Q406,880 340.5,851.5Q275,823 226,774Q177,725 148.5,659.5Q120,594 120,520Q120,446 148.5,380.5Q177,315 226,266Q275,217 340.5,188.5Q406,160 480,160Q542,160 599,180Q656,200 706,238L762,182L818,238L762,294Q800,344 820,401Q840,458 840,520Q840,594 811.5,659.5Q783,725 734,774Q685,823 619.5,851.5Q554,880 480,880ZM480,800Q596,800 678,718Q760,636 760,520Q760,404 678,322Q596,240 480,240Q364,240 282,322Q200,404 200,520Q200,636 282,718Q364,800 480,800ZM480,520Q480,520 480,520Q480,520 480,520Q480,520 480,520Q480,520 480,520Q480,520 480,520Q480,520 480,520Q480,520 480,520Q480,520 480,520Z"/>
|
||||||
|
|
||||||
|
</vector>
|
@ -1,11 +1,13 @@
|
|||||||
package ru.csasq.cit_is_bot.ui.dialogs
|
package ru.csasq.cit_is_bot.ui.dialogs
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
@ -16,6 +18,7 @@ import androidx.compose.material3.DropdownMenuItem
|
|||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.ExposedDropdownMenuBox
|
import androidx.compose.material3.ExposedDropdownMenuBox
|
||||||
import androidx.compose.material3.ExposedDropdownMenuDefaults
|
import androidx.compose.material3.ExposedDropdownMenuDefaults
|
||||||
|
import androidx.compose.material3.ExtendedFloatingActionButton
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
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.Dialog
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import cit_is_bot.composeapp.generated.resources.Res
|
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_attach_file_24
|
||||||
import cit_is_bot.composeapp.generated.resources.baseline_ballot_24
|
import cit_is_bot.composeapp.generated.resources.baseline_ballot_24
|
||||||
import cit_is_bot.composeapp.generated.resources.baseline_casino_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_contacts_24
|
||||||
import cit_is_bot.composeapp.generated.resources.baseline_date_range_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_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.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.DrawableResource
|
||||||
import org.jetbrains.compose.resources.painterResource
|
import org.jetbrains.compose.resources.painterResource
|
||||||
import ru.csasq.cit_is_bot.ui.screens.Scenario
|
import ru.csasq.cit_is_bot.ui.screens.Scenario
|
||||||
@ -52,7 +59,7 @@ enum class MessageType(
|
|||||||
val displayName: String,
|
val displayName: String,
|
||||||
val icon: DrawableResource,
|
val icon: DrawableResource,
|
||||||
) {
|
) {
|
||||||
TEXT(1, "Текст", Res.drawable.baseline_title_24),
|
TEXT(1, "Текст", Res.drawable.baseline_subject_24),
|
||||||
POLL(2, "Опрос", Res.drawable.baseline_ballot_24),
|
POLL(2, "Опрос", Res.drawable.baseline_ballot_24),
|
||||||
MEDIA(3, "Медиа", Res.drawable.baseline_attach_file_24),
|
MEDIA(3, "Медиа", Res.drawable.baseline_attach_file_24),
|
||||||
CONTACT(4, "Контакт", Res.drawable.baseline_contacts_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(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.verticalScroll(
|
.verticalScroll(
|
||||||
state = rememberScrollState(),
|
state = rememberScrollState(),
|
||||||
)
|
)
|
||||||
.padding(it)
|
.padding(paddingValues)
|
||||||
.padding(
|
.padding(
|
||||||
horizontal = 16.dp,
|
horizontal = 16.dp,
|
||||||
|
)
|
||||||
|
.padding(
|
||||||
|
bottom = 88.dp,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
@ -266,7 +293,63 @@ fun ScenarioDialog(
|
|||||||
)
|
)
|
||||||
Spacer(
|
Spacer(
|
||||||
modifier = Modifier
|
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(
|
ExposedDropdownMenuBox(
|
||||||
expanded = dropdownMenuState.value,
|
expanded = dropdownMenuState.value,
|
||||||
@ -302,7 +385,6 @@ fun ScenarioDialog(
|
|||||||
expanded = dropdownMenuState.value,
|
expanded = dropdownMenuState.value,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
supportingText = {},
|
|
||||||
isError = false,
|
isError = false,
|
||||||
singleLine = true,
|
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 -> {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user