app / sg.edu.ntu.scse.cz2006.gymbuddies.adapter / ChatAdapter / ChatViewHolder

ChatViewHolder

open class ChatViewHolder : ViewHolder, OnClickListener

ViewHolder for Chat it holds reference to frequent update views and provides helper method to bind data information onto views

Constructors

<init>

constructor method that initialised the view holder by keeping reference to most frequent update views

ChatViewHolder(itemView: View)

Properties

cbFav

CheckBox button that denote the another user involved is buddy of current user

var cbFav: CheckBox!

imgPic

icon for chat, usually display other user's profile picture

var imgPic: ImageView!

tvLastMsg

last message of the chat

var tvLastMsg: TextView!

tvName

name of the chat, usually display name of another user involved in chat

var tvName: TextView!

tvUpdateTime

formatted timestamp for chat's last update time

var tvUpdateTime: TextView!

Functions

bind

helper method to bind Chat onto item view

open fun bind(chat: Chat!): Unit

onClick

catch user click event, and update observer via #listener

open fun onClick(v: View!): Unit