Add stickyHeader for compare view
parent
b1bb3a1319
commit
5f358bf772
|
@ -1,5 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
|
@ -33,12 +34,6 @@ 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(
|
||||||
|
@ -48,9 +43,16 @@ fun compareResults(
|
||||||
) {
|
) {
|
||||||
Text("Retour")
|
Text("Retour")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
|
commonWordsTable(glossaryWords, codeWords)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun commonWordsTable(
|
fun commonWordsTable(
|
||||||
glossaryWords: List<Word>,
|
glossaryWords: List<Word>,
|
||||||
|
@ -61,7 +63,7 @@ fun commonWordsTable(
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxSize().padding(16.dp),
|
modifier = Modifier.fillMaxSize().padding(16.dp),
|
||||||
content = {
|
content = {
|
||||||
item {
|
stickyHeader {
|
||||||
commonWordsHeaderRow()
|
commonWordsHeaderRow()
|
||||||
}
|
}
|
||||||
items(glossaryWords) { word ->
|
items(glossaryWords) { word ->
|
||||||
|
|
|
@ -28,12 +28,6 @@ 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(
|
||||||
|
@ -44,6 +38,12 @@ 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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue