Refactor functions with uppercase
parent
be34fb6254
commit
59448f4e4f
|
@ -16,7 +16,6 @@ import java.awt.FileDialog
|
||||||
import java.awt.Frame
|
import java.awt.Frame
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material.Button
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.window.*
|
import androidx.compose.ui.window.*
|
||||||
|
@ -28,9 +27,8 @@ import kotlinx.serialization.encodeToString
|
||||||
|
|
||||||
val customRedColor = Color(0xFFB70D1B)
|
val customRedColor = Color(0xFFB70D1B)
|
||||||
|
|
||||||
@OptIn(ExperimentalComposeUiApi::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun HomePage(
|
fun homePage(
|
||||||
onGlossaireClick: () -> Unit,
|
onGlossaireClick: () -> Unit,
|
||||||
onCodeAVerifierClick: () -> Unit
|
onCodeAVerifierClick: () -> Unit
|
||||||
) {
|
) {
|
||||||
|
@ -80,13 +78,13 @@ fun HomePage(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@Preview
|
@Preview
|
||||||
fun App() {
|
fun app() {
|
||||||
MaterialTheme {
|
MaterialTheme {
|
||||||
val currentPage = remember { mutableStateOf("accueil") }
|
val currentPage = remember { mutableStateOf("accueil") }
|
||||||
|
|
||||||
when (currentPage.value) {
|
when (currentPage.value) {
|
||||||
"accueil" -> {
|
"accueil" -> {
|
||||||
HomePage(
|
homePage(
|
||||||
onGlossaireClick = { currentPage.value = "glossaire" },
|
onGlossaireClick = { currentPage.value = "glossaire" },
|
||||||
onCodeAVerifierClick = { currentPage.value = "choixLangage" }
|
onCodeAVerifierClick = { currentPage.value = "choixLangage" }
|
||||||
)
|
)
|
||||||
|
@ -133,10 +131,10 @@ fun App() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
"formulaire" -> {
|
"formulaire" -> {
|
||||||
FormulairePage(onAnnulerClick = { currentPage.value = "glossaire" })
|
formulairePage(onAnnulerClick = { currentPage.value = "glossaire" })
|
||||||
}
|
}
|
||||||
"choixLangage" -> {
|
"choixLangage" -> {
|
||||||
ChoixLangagePage(
|
choixLangagePage(
|
||||||
onRetourClick = { currentPage.value = "accueil" },
|
onRetourClick = { currentPage.value = "accueil" },
|
||||||
onPythonClick = {
|
onPythonClick = {
|
||||||
val fileDialog = FileDialog(Frame(), "Select a file", FileDialog.LOAD)
|
val fileDialog = FileDialog(Frame(), "Select a file", FileDialog.LOAD)
|
||||||
|
@ -284,7 +282,7 @@ fun verifierChampsRequis(mot: Map<String, String>): Boolean {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ChoixLangagePage(
|
fun choixLangagePage(
|
||||||
onRetourClick: () -> Unit,
|
onRetourClick: () -> Unit,
|
||||||
onPythonClick: () -> Unit,
|
onPythonClick: () -> Unit,
|
||||||
onJavaClick: () -> Unit,
|
onJavaClick: () -> Unit,
|
||||||
|
@ -429,7 +427,7 @@ fun glossairePage(
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun FormulairePage(onAnnulerClick: () -> Unit) {
|
fun formulairePage(onAnnulerClick: () -> Unit) {
|
||||||
|
|
||||||
MaterialTheme {
|
MaterialTheme {
|
||||||
Column(
|
Column(
|
||||||
|
@ -609,6 +607,6 @@ fun main() = application {
|
||||||
icon = painterResource("assets/logo/logo.png"),
|
icon = painterResource("assets/logo/logo.png"),
|
||||||
onCloseRequest = ::exitApplication
|
onCloseRequest = ::exitApplication
|
||||||
) {
|
) {
|
||||||
App()
|
app()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue