|
|
@ -3,6 +3,7 @@ package com.example.veraxapplication.ui.article
|
|
|
|
import androidx.compose.foundation.Image
|
|
|
|
import androidx.compose.foundation.Image
|
|
|
|
import androidx.compose.foundation.background
|
|
|
|
import androidx.compose.foundation.background
|
|
|
|
import androidx.compose.foundation.border
|
|
|
|
import androidx.compose.foundation.border
|
|
|
|
|
|
|
|
import androidx.compose.foundation.clickable
|
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
@ -13,9 +14,11 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
|
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.draw.clip
|
|
|
|
import androidx.compose.ui.draw.clip
|
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
|
|
|
|
|
import androidx.compose.ui.layout.ContentScale
|
|
|
|
import androidx.compose.ui.text.font.FontFamily
|
|
|
|
import androidx.compose.ui.text.font.FontFamily
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
@ -28,14 +31,20 @@ import com.example.veraxapplication.ui.theme.Salmon
|
|
|
|
fun AffichageLesArticles(articles : List<Article>){
|
|
|
|
fun AffichageLesArticles(articles : List<Article>){
|
|
|
|
Column(modifier = Modifier.verticalScroll(rememberScrollState())){
|
|
|
|
Column(modifier = Modifier.verticalScroll(rememberScrollState())){
|
|
|
|
for(article in articles){
|
|
|
|
for(article in articles){
|
|
|
|
AffichageUnArticle(e = article)
|
|
|
|
Box (Modifier.clickable { /*faut je regarde la doc*/ }){
|
|
|
|
|
|
|
|
AffichageUnArticle(e = article)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AffichageUnArticle(e : Article){
|
|
|
|
fun AffichageUnArticle(e : Article){
|
|
|
|
Column() {
|
|
|
|
Column(modifier = Modifier
|
|
|
|
|
|
|
|
.padding(7.dp)
|
|
|
|
|
|
|
|
.border(width = 1.dp, color = Color.Black, shape = RoundedCornerShape(10.dp))
|
|
|
|
|
|
|
|
.padding(5.dp)) {
|
|
|
|
/*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)
|
|
|
@ -46,26 +55,27 @@ fun AffichageUnArticle(e : Article){
|
|
|
|
Text(text = e.titre, fontFamily = FontFamily.Serif, fontSize = 30.sp)
|
|
|
|
Text(text = e.titre, fontFamily = FontFamily.Serif, fontSize = 30.sp)
|
|
|
|
|
|
|
|
|
|
|
|
Box(modifier = Modifier
|
|
|
|
Box(modifier = Modifier
|
|
|
|
.fillMaxWidth()
|
|
|
|
.padding(15.dp)
|
|
|
|
.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)) {
|
|
|
|
) {
|
|
|
|
Column () {
|
|
|
|
Column (modifier = Modifier.padding(15.dp)) {
|
|
|
|
Text(text = e.auteur)
|
|
|
|
Text(text = e.auteur, fontSize = 17.sp)
|
|
|
|
Text(text = e.description)
|
|
|
|
Text(text = e.description, fontSize = 17.sp)
|
|
|
|
Text(text = "Lecture Time: " + e.temps + " minutes")
|
|
|
|
Text(text = "Lecture Time: " + e.temps + " minutes", fontSize = 17.sp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Image(
|
|
|
|
Image(
|
|
|
|
painter = rememberImagePainter(
|
|
|
|
painter = rememberImagePainter(
|
|
|
|
data = e.imagePrincipale,
|
|
|
|
data = e.imagePrincipale
|
|
|
|
builder = {
|
|
|
|
|
|
|
|
scale(Scale.FILL)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
contentScale = ContentScale.Crop,
|
|
|
|
contentDescription = null,
|
|
|
|
contentDescription = null,
|
|
|
|
modifier = Modifier.size(250.dp),
|
|
|
|
modifier = Modifier
|
|
|
|
|
|
|
|
.size(350.dp)
|
|
|
|
|
|
|
|
.align(Alignment.CenterHorizontally)
|
|
|
|
|
|
|
|
.padding(5.dp, 35.dp)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|