ChatAdapter

Author

Alper Sahin An adapter class for populating a RecyclerView with chat messages in a chat interface.

Parameters

receiverProfileImage

The profile image of the receiver (can be null if not available).

chatMessage

The list of chat messages to display.

senderId

The unique identifier of the message sender.

Constructors

Link copied to clipboard
constructor(receiverProfileImage: Bitmap?, chatMessage: List<ChatMessage>, senderId: String)

Types

Link copied to clipboard

View holder for received chat messages.

Link copied to clipboard

View holder for sent chat messages.

Functions

Link copied to clipboard
Link copied to clipboard
open override fun getItemCount(): Int

Returns the total number of items in the data set.

Link copied to clipboard
open fun getItemId(p0: Int): Long
Link copied to clipboard
open override fun getItemViewType(position: Int): Int

Determines the view type for an item in the RecyclerView.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun notifyItemMoved(p0: Int, p1: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

open override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int)

Binds data to a ViewHolder at the specified position.

Link copied to clipboard
open override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder

Creates and returns a new ViewHolder for an item in the RecyclerView.

Link copied to clipboard
Link copied to clipboard
open fun setHasStableIds(p0: Boolean)
Link copied to clipboard