Add scroll for views
parent
5f358bf772
commit
71bd09e88f
|
@ -34,6 +34,12 @@ fun compareResults(
|
||||||
style = MaterialTheme.typography.h3
|
style = MaterialTheme.typography.h3
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
|
commonWordsTable(glossaryWords, codeWords)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
onClick = onBackClick,
|
onClick = onBackClick,
|
||||||
colors = androidx.compose.material.ButtonDefaults.buttonColors(
|
colors = androidx.compose.material.ButtonDefaults.buttonColors(
|
||||||
|
@ -43,12 +49,6 @@ fun compareResults(
|
||||||
) {
|
) {
|
||||||
Text("Retour")
|
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()
|
val glossaryWordsSet = glossaryWords.map { it.name }.toSet()
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
// Les 3/4 de l'écran
|
||||||
|
.height(500.dp)
|
||||||
|
.padding(10.dp)
|
||||||
|
) {
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxSize().padding(16.dp),
|
modifier = Modifier.fillMaxSize().padding(16.dp),
|
||||||
content = {
|
content = {
|
||||||
|
@ -77,6 +84,7 @@ fun commonWordsTable(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun commonWordsHeaderRow() {
|
fun commonWordsHeaderRow() {
|
||||||
|
|
|
@ -28,6 +28,12 @@ fun glossaryDetailedPage(glossary: List<Word>, onBackClick: () -> Unit) {
|
||||||
) {
|
) {
|
||||||
Text(text = "Détail du glossaire", style = MaterialTheme.typography.h3)
|
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(
|
Button(
|
||||||
onClick = { onBackClick() },
|
onClick = { onBackClick() },
|
||||||
colors = androidx.compose.material.ButtonDefaults.buttonColors(
|
colors = androidx.compose.material.ButtonDefaults.buttonColors(
|
||||||
|
@ -38,12 +44,6 @@ fun glossaryDetailedPage(glossary: List<Word>, onBackClick: () -> Unit) {
|
||||||
Icon(imageVector = Icons.Default.ArrowBack, contentDescription = null)
|
Icon(imageVector = Icons.Default.ArrowBack, contentDescription = null)
|
||||||
Text("Retour")
|
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
|
@Composable
|
||||||
fun glossaryTable(glossary: List<Word>) {
|
fun glossaryTable(glossary: List<Word>) {
|
||||||
val listState = rememberLazyListState()
|
val listState = rememberLazyListState()
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.height(500.dp)
|
||||||
|
.padding(10.dp)
|
||||||
|
) {
|
||||||
LazyColumn(state = listState, modifier = Modifier.padding(16.dp)) {
|
LazyColumn(state = listState, modifier = Modifier.padding(16.dp)) {
|
||||||
item {
|
item {
|
||||||
headerRow()
|
headerRow()
|
||||||
|
@ -60,6 +65,7 @@ fun glossaryTable(glossary: List<Word>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|
|
@ -151,30 +151,36 @@ fun GlossaryList(glossaries: List<Glossary>, onGlossarySelected: (Glossary) -> U
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
LazyColumn(
|
Box(
|
||||||
modifier = Modifier.padding(10.dp),
|
modifier = Modifier
|
||||||
verticalArrangement = Arrangement.spacedBy(10.dp)
|
.height(500.dp)
|
||||||
|
.padding(10.dp)
|
||||||
) {
|
) {
|
||||||
items(glossaries) { glossary ->
|
LazyColumn(
|
||||||
Row(
|
modifier = Modifier.padding(10.dp),
|
||||||
modifier = Modifier.width(200.dp).fillMaxWidth(),
|
verticalArrangement = Arrangement.spacedBy(10.dp)
|
||||||
horizontalArrangement = Arrangement.SpaceBetween
|
) {
|
||||||
) {
|
items(glossaries) { glossary ->
|
||||||
Button(
|
Row(
|
||||||
onClick = {
|
modifier = Modifier.width(200.dp).fillMaxWidth(),
|
||||||
onGlossarySelected(glossary)
|
horizontalArrangement = Arrangement.SpaceBetween
|
||||||
},
|
|
||||||
colors = ButtonDefaults.buttonColors(
|
|
||||||
backgroundColor = customRedColor,
|
|
||||||
contentColor = Color.White
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
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))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
LazyColumn(
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.height(300.dp)
|
||||||
|
.padding(10.dp)
|
||||||
|
) {
|
||||||
|
LazyColumn(
|
||||||
modifier = Modifier.padding(10.dp),
|
modifier = Modifier.padding(10.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(10.dp)
|
verticalArrangement = Arrangement.spacedBy(10.dp)
|
||||||
) {
|
) {
|
||||||
|
@ -103,6 +108,7 @@ fun app() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
// mettre un texte "ou"
|
// mettre un texte "ou"
|
||||||
|
|
Loading…
Reference in New Issue