diff --git a/src/main/kotlin/main/Compare.kt b/src/main/kotlin/main/Compare.kt index ac3eaf8..fa70ed9 100644 --- a/src/main/kotlin/main/Compare.kt +++ b/src/main/kotlin/main/Compare.kt @@ -34,6 +34,12 @@ fun compareResults( style = MaterialTheme.typography.h3 ) + Spacer(modifier = Modifier.height(16.dp)) + + commonWordsTable(glossaryWords, codeWords) + + Spacer(modifier = Modifier.height(16.dp)) + Button( onClick = onBackClick, colors = androidx.compose.material.ButtonDefaults.buttonColors( @@ -43,12 +49,6 @@ fun compareResults( ) { Text("Retour") } - - Spacer(modifier = Modifier.height(16.dp)) - - commonWordsTable(glossaryWords, codeWords) - - Spacer(modifier = Modifier.height(16.dp)) } } @@ -60,6 +60,13 @@ fun commonWordsTable( ) { val glossaryWordsSet = glossaryWords.map { it.name }.toSet() + Box( + modifier = Modifier + // Les 3/4 de l'écran + .height(500.dp) + .padding(10.dp) + ) { + LazyColumn( modifier = Modifier.fillMaxSize().padding(16.dp), content = { @@ -77,6 +84,7 @@ fun commonWordsTable( } ) } +} @Composable fun commonWordsHeaderRow() { diff --git a/src/main/kotlin/main/Detail.kt b/src/main/kotlin/main/Detail.kt index a9c4350..1b4d137 100644 --- a/src/main/kotlin/main/Detail.kt +++ b/src/main/kotlin/main/Detail.kt @@ -28,6 +28,12 @@ fun glossaryDetailedPage(glossary: List, onBackClick: () -> Unit) { ) { Text(text = "Détail du glossaire", style = MaterialTheme.typography.h3) + Spacer(modifier = Modifier.height(16.dp)) + + glossaryTable(glossary = glossary) + + Spacer(modifier = Modifier.height(16.dp)) + Button( onClick = { onBackClick() }, colors = androidx.compose.material.ButtonDefaults.buttonColors( @@ -38,12 +44,6 @@ fun glossaryDetailedPage(glossary: List, onBackClick: () -> Unit) { Icon(imageVector = Icons.Default.ArrowBack, contentDescription = null) Text("Retour") } - - Spacer(modifier = Modifier.height(16.dp)) - - glossaryTable(glossary = glossary) - - Spacer(modifier = Modifier.height(16.dp)) } } @@ -51,6 +51,11 @@ fun glossaryDetailedPage(glossary: List, onBackClick: () -> Unit) { @Composable fun glossaryTable(glossary: List) { val listState = rememberLazyListState() + Box( + modifier = Modifier + .height(500.dp) + .padding(10.dp) + ) { LazyColumn(state = listState, modifier = Modifier.padding(16.dp)) { item { headerRow() @@ -60,6 +65,7 @@ fun glossaryTable(glossary: List) { } } } +} @Composable diff --git a/src/main/kotlin/main/Home.kt b/src/main/kotlin/main/Home.kt index a7f88e4..ff635a4 100644 --- a/src/main/kotlin/main/Home.kt +++ b/src/main/kotlin/main/Home.kt @@ -151,30 +151,36 @@ fun GlossaryList(glossaries: List, onGlossarySelected: (Glossary) -> U Spacer(modifier = Modifier.height(16.dp)) - LazyColumn( - modifier = Modifier.padding(10.dp), - verticalArrangement = Arrangement.spacedBy(10.dp) + Box( + modifier = Modifier + .height(500.dp) + .padding(10.dp) ) { - items(glossaries) { glossary -> - Row( - modifier = Modifier.width(200.dp).fillMaxWidth(), - horizontalArrangement = Arrangement.SpaceBetween - ) { - Button( - onClick = { - onGlossarySelected(glossary) - }, - colors = ButtonDefaults.buttonColors( - backgroundColor = customRedColor, - contentColor = Color.White - ) + LazyColumn( + modifier = Modifier.padding(10.dp), + verticalArrangement = Arrangement.spacedBy(10.dp) + ) { + items(glossaries) { glossary -> + Row( + modifier = Modifier.width(200.dp).fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween ) { - Text(glossary.name) + Button( + onClick = { + onGlossarySelected(glossary) + }, + colors = ButtonDefaults.buttonColors( + backgroundColor = customRedColor, + contentColor = Color.White + ) + ) { + Text(glossary.name) + } } } } - } - Spacer(modifier = Modifier.height(6.dp)) + Spacer(modifier = Modifier.height(6.dp)) + } } } diff --git a/src/main/kotlin/main/Main.kt b/src/main/kotlin/main/Main.kt index a6196f7..2b10137 100644 --- a/src/main/kotlin/main/Main.kt +++ b/src/main/kotlin/main/Main.kt @@ -66,7 +66,12 @@ fun app() { Spacer(modifier = Modifier.height(16.dp)) - LazyColumn( + Box( + modifier = Modifier + .height(300.dp) + .padding(10.dp) + ) { + LazyColumn( modifier = Modifier.padding(10.dp), verticalArrangement = Arrangement.spacedBy(10.dp) ) { @@ -103,6 +108,7 @@ fun app() { } } } + } Spacer(modifier = Modifier.height(16.dp)) // mettre un texte "ou"