|
|
|
|
@ -9,6 +9,7 @@ import androidx.recyclerview.widget.ListAdapter
|
|
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
|
|
import com.cyb3rko.techniklogger.R
|
|
|
|
|
import com.cyb3rko.techniklogger.data.objects.Participation
|
|
|
|
|
import com.cyb3rko.techniklogger.toPrettyString
|
|
|
|
|
|
|
|
|
|
internal class ParticipationAdapter(
|
|
|
|
|
val action: (participation: Participation) -> Unit
|
|
|
|
|
@ -21,7 +22,7 @@ internal class ParticipationAdapter(
|
|
|
|
|
|
|
|
|
|
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
|
|
|
|
val entry = getItem(position)
|
|
|
|
|
val title = "${entry.name}, ${entry.duration} h"
|
|
|
|
|
val title = "${entry.name}, ${entry.duration.toPrettyString()} h"
|
|
|
|
|
holder.titleView.text = title
|
|
|
|
|
holder.titleView.setOnClickListener {
|
|
|
|
|
action(entry)
|
|
|
|
|
|