fix #9 images projets

This commit is contained in:
Raphael
2025-03-11 14:36:01 +01:00
parent 35b6120ebe
commit fe51ff6804
3 changed files with 5 additions and 4 deletions

View File

@@ -47,7 +47,8 @@ class ProjectAdapter(private val projects: List<Project>, private val listener:
val context = holder.itemView.context val context = holder.itemView.context
val color = project.getStatusColor() val color = project.getStatusColor()
Glide.with(holder.projectImage.context) Glide.with(holder.projectImage.context)
.load("https://timelapse.kerboul.me/api/smile") // L'URL de l'image .load("https://timelapse.kerboul.me/api/images/${project.id}/${1}") // L'URL de l'image
.placeholder(R.drawable.not_found)
.into(holder.projectImage) .into(holder.projectImage)
DrawableCompat.setTint(holder.projectBadge.background, ContextCompat.getColor(context, color)) DrawableCompat.setTint(holder.projectBadge.background, ContextCompat.getColor(context, color))
holder.itemView.setOnClickListener { holder.itemView.setOnClickListener {

View File

@@ -19,7 +19,7 @@ data class Project(
val description: String, val description: String,
val start_date: Date, val start_date: Date,
val status: Int, val status: Int,
val thumbnail_url: String? //val thumbnail_url: String?
) : Parcelable { ) : Parcelable {
fun getStatusText(): String{ fun getStatusText(): String{
@@ -44,7 +44,7 @@ data class Project(
parcel.readString() ?: "", parcel.readString() ?: "",
Date(parcel.readLong()), Date(parcel.readLong()),
parcel.readInt(), parcel.readInt(),
parcel.readString() //parcel.readString()
) )
// Write object to Parcel // Write object to Parcel

View File

@@ -66,7 +66,7 @@ class ProjectRepository(private val apiService: ApiService) {
}) })
} }
fun createProject(name: String, description: String, onSuccess: () -> Unit, onError: (String) -> Unit) { fun createProject(name: String, description: String, onSuccess: () -> Unit, onError: (String) -> Unit) {
val call = apiService.createProject(Project(0, name, description, Date(), 0, null)) val call = apiService.createProject(Project(0, name, description, Date(), 0))
call.enqueue(object : Callback<Confirmation> { call.enqueue(object : Callback<Confirmation> {
override fun onResponse(call: Call<Confirmation>, response: Response<Confirmation>) { override fun onResponse(call: Call<Confirmation>, response: Response<Confirmation>) {
if (response.isSuccessful) { if (response.isSuccessful) {