add startActivity onClick on item of boardsList
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
842573ece9
commit
2b060f7d38
@ -1,6 +1,7 @@
|
|||||||
package it.unisannio.ding.ids.wedroid.app.view.adapter
|
package it.unisannio.ding.ids.wedroid.app.view.adapter
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@ -33,14 +34,21 @@ class BoardsListAdapter internal constructor(
|
|||||||
|
|
||||||
override fun onBindViewHolder(holder: BoardViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: BoardViewHolder, position: Int) {
|
||||||
val board = boards[position]
|
val board = boards[position]
|
||||||
holder.itemView.setOnClickListener {
|
|
||||||
// TODO start board activity
|
|
||||||
}
|
|
||||||
holder.boardTitle.text = board.title
|
holder.boardTitle.text = board.title
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener {
|
||||||
|
val intent = Intent(it.context, TODO())
|
||||||
|
intent.putExtra(BOARD_ID, board.id)
|
||||||
|
it.context.startActivity(intent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun setBoards(boards: List<Board>) {
|
internal fun setBoards(boards: List<Board>) {
|
||||||
this.boards = boards
|
this.boards = boards
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val BOARD_ID = "BOARD_ID"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user