Сделаны все UI компоненты
This commit is contained in:
@@ -562,6 +562,71 @@ fun MessageAlertInWork() {
|
||||
|
||||
|
||||
@Composable
|
||||
fun AlertBox() {
|
||||
//DialogProperties().
|
||||
fun BaseAlertBox(
|
||||
title: String?,
|
||||
onDismissRequest: () -> Unit,
|
||||
content: @Composable () -> Unit,
|
||||
buttons: @Composable () -> Unit
|
||||
) {
|
||||
AlertDialog(
|
||||
shape = RoundedCornerShape(20.dp),
|
||||
onDismissRequest = onDismissRequest,
|
||||
title = {
|
||||
if(title != null)
|
||||
Text(
|
||||
text = title,
|
||||
style = H1
|
||||
)
|
||||
},
|
||||
text = {
|
||||
content.invoke()
|
||||
},
|
||||
buttons = {
|
||||
buttons.invoke()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AlertMessageBox(
|
||||
title: String,
|
||||
alertText: String,
|
||||
onClick: () -> Unit,
|
||||
onCancel: () -> Unit = {},
|
||||
) {
|
||||
|
||||
BaseAlertBox(
|
||||
title = title,
|
||||
onDismissRequest = onCancel,
|
||||
content = {
|
||||
Text(
|
||||
text = alertText,
|
||||
style = H2,
|
||||
color = dark
|
||||
)
|
||||
},
|
||||
buttons = {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = mainBlue,
|
||||
contentColor = white
|
||||
),
|
||||
modifier = Modifier
|
||||
.defaultMinSize(170.dp).padding(bottom = 30.dp)
|
||||
) {
|
||||
Text(
|
||||
text = R.string.title_ok.AsString(),
|
||||
style = H1
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package ru.megboyzz.dnevnik
|
||||
package ru.megboyzz.dnevnik.screens.ui
|
||||
|
||||
import android.util.Log
|
||||
import androidx.compose.animation.ExperimentalAnimationApi
|
||||
@@ -12,24 +12,15 @@ import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Save
|
||||
import androidx.compose.material.icons.filled.SouthEast
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
|
||||
import com.kizitonwose.calendar.core.daysOfWeek
|
||||
import ru.megboyzz.dnevnik.screens.SettingsCategory
|
||||
import ru.megboyzz.dnevnik.screens.SettingsMenuSwitch
|
||||
import ru.megboyzz.dnevnik.screens.SettingsMenuItem
|
||||
import ru.megboyzz.dnevnik.screens.SettingsScreen
|
||||
import ru.megboyzz.dnevnik.screens.ui.*
|
||||
import ru.megboyzz.dnevnik.screens.ui.calendar.NiceCalendar
|
||||
@@ -42,7 +33,6 @@ import ru.megboyzz.dnevnik.screens.ui.schedule.BaseScheduleCard
|
||||
import ru.megboyzz.dnevnik.screens.ui.schedule.BaseScheduleShield
|
||||
import ru.megboyzz.dnevnik.screens.ui.schedule.CallData
|
||||
import ru.megboyzz.dnevnik.ui.theme.mainBlue
|
||||
import ru.megboyzz.dnevnik.ui.theme.mainBlur
|
||||
import ru.megboyzz.dnevnik.ui.theme.white
|
||||
import java.time.LocalDate
|
||||
import java.time.YearMonth
|
||||
@@ -394,14 +384,10 @@ fun SettingsTest() {
|
||||
@Composable
|
||||
fun Test1() {
|
||||
|
||||
AlertDialog(
|
||||
onDismissRequest = { /*TODO*/ },
|
||||
text = {
|
||||
Text(text = "hehe")
|
||||
},
|
||||
buttons = {
|
||||
Text(text = "hehe")
|
||||
}
|
||||
AlertMessageBox(
|
||||
title = "Информация",
|
||||
alertText = "В данный момент на сервере ведутся технические работы, вход невозможен, повторите попытку позднее",
|
||||
onClick = { /*TODO*/ }
|
||||
)
|
||||
|
||||
}
|
||||
@@ -71,4 +71,5 @@
|
||||
<string name="settings_category_author">Author</string>
|
||||
<string name="title_choose_icons">" Select the icons for subjects"</string>
|
||||
<string name="title_enable_notif">Enable notify</string>
|
||||
<string name="title_ok">ОК</string>
|
||||
</resources>
|
||||
@@ -70,4 +70,5 @@
|
||||
<string name="settings_category_author">Автор</string>
|
||||
<string name="title_choose_icons">Выбрать иконки для предметов</string>
|
||||
<string name="title_enable_notif">Включить уведомления о новых оценках</string>
|
||||
<string name="title_ok">Ясно</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user