|
|
@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.padding
|
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
|
import androidx.compose.material.icons.Icons
|
|
|
|
import androidx.compose.material.icons.Icons
|
|
|
|
|
|
|
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
|
|
|
import androidx.compose.material.icons.filled.ArrowBack
|
|
|
|
import androidx.compose.material.icons.filled.ArrowBack
|
|
|
|
import androidx.compose.material.icons.filled.Menu
|
|
|
|
import androidx.compose.material.icons.filled.Menu
|
|
|
|
import androidx.compose.material3.CenterAlignedTopAppBar
|
|
|
|
import androidx.compose.material3.CenterAlignedTopAppBar
|
|
|
@ -32,8 +33,11 @@ import androidx.compose.ui.text.TextStyle
|
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
|
|
|
|
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
|
|
|
|
|
|
|
import androidx.navigation.compose.rememberNavController
|
|
|
|
import com.example.veraxapplication.R
|
|
|
|
import com.example.veraxapplication.R
|
|
|
|
import com.example.veraxapplication.modele.articles.Article
|
|
|
|
import com.example.veraxapplication.modele.articles.Article
|
|
|
|
|
|
|
|
import com.example.veraxapplication.navigation.VeraxNavHost
|
|
|
|
import com.example.veraxapplication.ui.article.AffichageLesArticles
|
|
|
|
import com.example.veraxapplication.ui.article.AffichageLesArticles
|
|
|
|
import com.example.veraxapplication.ui.article.AfficherArticle
|
|
|
|
import com.example.veraxapplication.ui.article.AfficherArticle
|
|
|
|
import com.example.veraxapplication.ui.theme.Orange
|
|
|
|
import com.example.veraxapplication.ui.theme.Orange
|
|
|
@ -44,6 +48,11 @@ fun TopBarVerax(theme: List<String>, articles: List<Article>) {
|
|
|
|
var leMenu by remember {
|
|
|
|
var leMenu by remember {
|
|
|
|
mutableStateOf(false)
|
|
|
|
mutableStateOf(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val navController = rememberNavController()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
|
|
|
|
|
|
|
|
|
|
|
Row() {
|
|
|
|
Row() {
|
|
|
|
Scaffold(
|
|
|
|
Scaffold(
|
|
|
|
topBar = {
|
|
|
|
topBar = {
|
|
|
@ -59,14 +68,16 @@ fun TopBarVerax(theme: List<String>, articles: List<Article>) {
|
|
|
|
modifier = Modifier.fillMaxWidth()
|
|
|
|
modifier = Modifier.fillMaxWidth()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
navigationIcon = {
|
|
|
|
navigationIcon = { if (navBackStackEntry?.destination?.route != "accueil"){
|
|
|
|
IconButton(onClick = { /* action() */ }) {
|
|
|
|
IconButton(onClick = { navController.popBackStack() }) {
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
imageVector = Icons.Filled.ArrowBack,
|
|
|
|
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
|
|
|
contentDescription = "Retour",
|
|
|
|
contentDescription = "Retour",
|
|
|
|
Modifier.size(30.dp)
|
|
|
|
Modifier.size(30.dp)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
actions = {
|
|
|
|
actions = {
|
|
|
|
IconButton(onClick = { leMenu = !leMenu }) {
|
|
|
|
IconButton(onClick = { leMenu = !leMenu }) {
|
|
|
@ -79,7 +90,11 @@ fun TopBarVerax(theme: List<String>, articles: List<Article>) {
|
|
|
|
DropdownMenu(
|
|
|
|
DropdownMenu(
|
|
|
|
expanded = leMenu, onDismissRequest = { leMenu = false },
|
|
|
|
expanded = leMenu, onDismissRequest = { leMenu = false },
|
|
|
|
modifier = Modifier
|
|
|
|
modifier = Modifier
|
|
|
|
.border(width = 1.dp, color = Color.Black, shape = RoundedCornerShape(10.dp))
|
|
|
|
.border(
|
|
|
|
|
|
|
|
width = 1.dp,
|
|
|
|
|
|
|
|
color = Color.Black,
|
|
|
|
|
|
|
|
shape = RoundedCornerShape(10.dp)
|
|
|
|
|
|
|
|
)
|
|
|
|
.background(Orange)
|
|
|
|
.background(Orange)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
theme.sorted().forEach {
|
|
|
|
theme.sorted().forEach {
|
|
|
@ -126,8 +141,10 @@ fun TopBarVerax(theme: List<String>, articles: List<Article>) {
|
|
|
|
verticalArrangement = Arrangement.spacedBy(16.dp),
|
|
|
|
verticalArrangement = Arrangement.spacedBy(16.dp),
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
|
|
AffichageLesArticles(articles = articles)
|
|
|
|
// AffichageLesArticles(articles = articles)
|
|
|
|
// AfficherArticle(articles.get(0));
|
|
|
|
// AfficherArticle(articles.get(0))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VeraxNavHost(articles = articles, navController)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|