add login and board_list #26
@ -1,6 +1,7 @@
|
||||
package it.unisannio.ding.ids.wedroid.app.view.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@ -33,14 +34,21 @@ class BoardsListAdapter internal constructor(
|
||||
|
||||
override fun onBindViewHolder(holder: BoardViewHolder, position: Int) {
|
||||
val board = boards[position]
|
||||
holder.itemView.setOnClickListener {
|
||||
// TODO start board activity
|
||||
}
|
||||
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>) {
|
||||
this.boards = boards
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val BOARD_ID = "BOARD_ID"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user