Commit 795883ce authored by Lukas Bersinger's avatar Lukas Bersinger
Browse files

add item click handler / animation

parent a7e7fa9f
package ch.ost.rj.mge.miniproject.tasktracker.adapters
import android.util.Log
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.TextView
......@@ -30,6 +31,11 @@ class TaskListAdapter(private val dataset: List<Task>) :
val dueDateView = holder.cardView.findViewById<TextView>(R.id.txtCardDueDate)
dueDateView.text = DateFormat.getDateInstance().format(activeTask.dueDate!!.time)
holder.cardView.setOnClickListener {
// Go To Edit Activity
Log.println(Log.DEBUG, "TaskListAdapter", "Opened Task with ID: " + activeTask.id.toString())
}
}
override fun getItemCount(): Int {
......
......@@ -2,11 +2,14 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/crdTaskListItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:clickable="true"
android:foreground="?attr/selectableItemBackground"
app:contentPadding="16dp">
<androidx.constraintlayout.widget.ConstraintLayout
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment