diff --git a/src/main/kotlin/main/Compare.kt b/src/main/kotlin/main/Compare.kt index 3db8c67..ac3eaf8 100644 --- a/src/main/kotlin/main/Compare.kt +++ b/src/main/kotlin/main/Compare.kt @@ -1,5 +1,6 @@ package main +import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.* @@ -33,12 +34,6 @@ 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( @@ -48,9 +43,16 @@ fun compareResults( ) { Text("Retour") } + + Spacer(modifier = Modifier.height(16.dp)) + + commonWordsTable(glossaryWords, codeWords) + + Spacer(modifier = Modifier.height(16.dp)) } } +@OptIn(ExperimentalFoundationApi::class) @Composable fun commonWordsTable( glossaryWords: List, @@ -61,7 +63,7 @@ fun commonWordsTable( LazyColumn( modifier = Modifier.fillMaxSize().padding(16.dp), content = { - item { + stickyHeader { commonWordsHeaderRow() } items(glossaryWords) { word -> diff --git a/src/main/kotlin/main/Detail.kt b/src/main/kotlin/main/Detail.kt index f4c0775..a9c4350 100644 --- a/src/main/kotlin/main/Detail.kt +++ b/src/main/kotlin/main/Detail.kt @@ -28,12 +28,6 @@ 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( @@ -44,6 +38,12 @@ 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)) } }