Build Message Layout items

We created two bubbles for a different type of users (MY & FRIEND), Will do the same for the Message Items.

As you see below we made a constraint layout that contains TextView with my_bubble_shape.xml as a background.

my_message_item.xml

And here we made anther constraint layout that contains TextView with friend_bubble_shape.xml as a background.

but as you see in friend_message_item.xml we add extra circular ImageView that contains my friend avatar.

Data UI Model

Data Model from it’s now that it holds the business data like (message content, user avatar, etc…).

Message Data Model

And with Android application evolving DataUiModel has been introduced to present the view attributes ready to the adapter encapsulated in it.

Here as you, I added UI element the text color in case if there are different text colors depend on the state like the last message is read is with different color instead of black, or hide and show read indicator, etc …...

Also, the companion object contains the two types we support now. we will use it later in the adapter