Add scroll for views
parent
5f358bf772
commit
71bd09e88f
|
@ -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() {
|
||||
|
|
|
@ -28,6 +28,12 @@ fun glossaryDetailedPage(glossary: List<Word>, 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<Word>, 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<Word>, onBackClick: () -> Unit) {
|
|||
@Composable
|
||||
fun glossaryTable(glossary: List<Word>) {
|
||||
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<Word>) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Composable
|
||||
|
|
|
@ -151,30 +151,36 @@ fun GlossaryList(glossaries: List<Glossary>, 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))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue