|
|
@ -71,12 +71,6 @@ class MainActivity : ComponentActivity() {
|
|
|
|
var articles = dataManager.getDerniersArticles(4)
|
|
|
|
var articles = dataManager.getDerniersArticles(4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var theme = listOf("Economique", "Culture", "Politique", "Faits divers")
|
|
|
|
var theme = listOf("Economique", "Culture", "Politique", "Faits divers")
|
|
|
|
var color = Color(0xFF00FF00)
|
|
|
|
var color = Color(0xFF00FF00)
|
|
|
|
|
|
|
|
|
|
|
@ -88,20 +82,7 @@ class MainActivity : ComponentActivity() {
|
|
|
|
|
|
|
|
|
|
|
|
articles?.forEach({ a ->
|
|
|
|
articles?.forEach({ a ->
|
|
|
|
Log.println(Log.ASSERT, "debug articles", a.toString())
|
|
|
|
Log.println(Log.ASSERT, "debug articles", a.toString())
|
|
|
|
|
|
|
|
})
|
|
|
|
// if (a != null) {
|
|
|
|
|
|
|
|
// a.contenus.forEach({cont ->
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Log.println(Log.ASSERT, "contenus de l'article " + a.id, cont.toString())
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TopBarVerax(theme = theme, article = articles)
|
|
|
|
|
|
|
|
// allez sur la doc de Scaffold sur Android Dev et si vous comprenez comment on doit faire bien ouej
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -205,7 +186,11 @@ fun AffichageUnArticle(article : List<Article>){
|
|
|
|
Column() {
|
|
|
|
Column() {
|
|
|
|
for (e in article) {
|
|
|
|
for (e in article) {
|
|
|
|
DisplayTitle(title = e.Title)
|
|
|
|
DisplayTitle(title = e.Title)
|
|
|
|
DisplayHeader(author = e.Author, description = e.Description, lectureTime = e.LectureTime)
|
|
|
|
DisplayHeader(
|
|
|
|
|
|
|
|
author = e.Author,
|
|
|
|
|
|
|
|
description = e.Description,
|
|
|
|
|
|
|
|
lectureTime = e.LectureTime
|
|
|
|
|
|
|
|
)
|
|
|
|
DisplayImage(image = e.Image)
|
|
|
|
DisplayImage(image = e.Image)
|
|
|
|
DisplayContentArticle(content = e.Content)
|
|
|
|
DisplayContentArticle(content = e.Content)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -238,15 +223,16 @@ fun DisplayImage(image: String) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun DisplayHeader(author: String, description: String, lectureTime: String) {
|
|
|
|
fun DisplayHeader(author: String, description: String, lectureTime: String) {
|
|
|
|
Box(modifier = Modifier
|
|
|
|
Box(
|
|
|
|
|
|
|
|
modifier = Modifier
|
|
|
|
.fillMaxWidth()
|
|
|
|
.fillMaxWidth()
|
|
|
|
.border(width = 1.dp, color = Color.Black, shape = RoundedCornerShape(10.dp))
|
|
|
|
.border(width = 1.dp, color = Color.Black, shape = RoundedCornerShape(10.dp))
|
|
|
|
.clip(RoundedCornerShape(10.dp))
|
|
|
|
.clip(RoundedCornerShape(10.dp))
|
|
|
|
.background(Salmon)
|
|
|
|
.background(Salmon)
|
|
|
|
.padding(10.dp)) {
|
|
|
|
.padding(10.dp)
|
|
|
|
|
|
|
|
) {
|
|
|
|
Column() {
|
|
|
|
Column() {
|
|
|
|
Text(text = author)
|
|
|
|
Text(text = author)
|
|
|
|
Text(text = description)
|
|
|
|
Text(text = description)
|
|
|
@ -257,7 +243,10 @@ fun DisplayHeader(author: String, description: String, lectureTime: String) {
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun DisplayTitle(title: String) {
|
|
|
|
fun DisplayTitle(title: String) {
|
|
|
|
Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally){
|
|
|
|
Column(
|
|
|
|
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
|
|
|
horizontalAlignment = Alignment.CenterHorizontally
|
|
|
|
|
|
|
|
) {
|
|
|
|
Text(text = title, fontFamily = FontFamily.Serif, fontSize = 30.sp)
|
|
|
|
Text(text = title, fontFamily = FontFamily.Serif, fontSize = 30.sp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -266,7 +255,14 @@ fun DisplayTitle(title: String) {
|
|
|
|
fun DisplayContentArticle(content: List<Paragraph>) {
|
|
|
|
fun DisplayContentArticle(content: List<Paragraph>) {
|
|
|
|
Column {
|
|
|
|
Column {
|
|
|
|
for (e in content) {
|
|
|
|
for (e in content) {
|
|
|
|
Text(text = e.Content, fontSize = 15.sp, fontFamily = FontFamily.Serif, textAlign = TextAlign.Justify, modifier = Modifier.padding(10.dp))
|
|
|
|
Text(
|
|
|
|
|
|
|
|
text = e.Content,
|
|
|
|
|
|
|
|
fontSize = 15.sp,
|
|
|
|
|
|
|
|
fontFamily = FontFamily.Serif,
|
|
|
|
|
|
|
|
textAlign = TextAlign.Justify,
|
|
|
|
|
|
|
|
modifier = Modifier.padding(10.dp)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|