Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dependencies {
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'it.xabaras.android:recyclerview-swipedecorator:1.4'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
9 changes: 9 additions & 0 deletions app/src/main/java/otus/gpb/recyclerview/ChatItem.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package otus.gpb.recyclerview

data class ChatItem(
val id: Int,
val userImage: Int,
val date: String,
val username: String,
val message: String
)
54 changes: 54 additions & 0 deletions app/src/main/java/otus/gpb/recyclerview/ChatItemDataGenerator.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package otus.gpb.recyclerview

object ChatItemDataGenerator {

fun generateChatItemsList(count: Int): MutableList<ChatItem> {
return MutableList(count) {
ChatItem(
id = it,
username = listOf(
"Dima Murantsev",
"Catbird",
"just design",
"R4IN80W",
"SMDDN",
"Midnight",
"Nikita Dmitriev",
"Evgenia Smud",
"MidNighT",
"bravo-social"
).random(),
message = listOf(
"Hello",
"Good day",
"du biest mein sonnechein",
"How're you?",
"let's make it",
"in the evening, i suppose",
"a lot of fun",
"Have you seen this?",
"yep",
"don't think so",
"you won't believe"
).random(),
userImage = listOf(
R.drawable.ic_avatar_1,
R.drawable.ic_avatar_2,
R.drawable.ic_avatar_3,
R.drawable.ic_avatar_4,
R.drawable.ic_avatar_5,
R.drawable.ic_avatar_6,
R.drawable.ic_avatar_7
).random(),
date = listOf(
"14:28",
"13:45",
"17:20",
"21:57",
"18:12"
).random()

)
}
}
}
46 changes: 46 additions & 0 deletions app/src/main/java/otus/gpb/recyclerview/ChatListAdapter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package otus.gpb.recyclerview

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView

class ChatListAdapter :
ListAdapter<ChatItem, RecyclerView.ViewHolder>(DiffChatItemCallback()) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return ChatListViewHolder(
LayoutInflater.from(parent.context).inflate(R.layout.chat_item, parent, false)
)
}

override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
(holder as ChatListViewHolder).bind(currentList[position])
}

override fun getItemCount(): Int = currentList.size

fun removeItem(fromPosition: Int) {
val list = currentList.toMutableList()
list.removeAt(fromPosition)
submitList(list)
}

fun addItems(count: Int) {
val list = currentList.toMutableList()
list.addAll(ChatItemDataGenerator.generateChatItemsList(count))
submitList(list)
}

class DiffChatItemCallback : DiffUtil.ItemCallback<ChatItem>() {

override fun areItemsTheSame(oldItem: ChatItem, newItem: ChatItem): Boolean {
return oldItem.id == newItem.id
}

override fun areContentsTheSame(oldItem: ChatItem, newItem: ChatItem): Boolean {
return oldItem == newItem
}
}
}
21 changes: 21 additions & 0 deletions app/src/main/java/otus/gpb/recyclerview/ChatListViewHolder.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package otus.gpb.recyclerview

import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.imageview.ShapeableImageView

class ChatListViewHolder(private val view: View) : RecyclerView.ViewHolder(view) {

private val userImage = view.findViewById<ShapeableImageView>(R.id.user_avatar_siv)
private val username = view.findViewById<TextView>(R.id.username_tv)
private val message = view.findViewById<TextView>(R.id.message_tv)
private val date = view.findViewById<TextView>(R.id.published_date_tv)

fun bind(item: ChatItem) {
userImage.setImageResource(item.userImage)
username.text = item.username
message.text = item.message
date.text = item.date
}
}
56 changes: 56 additions & 0 deletions app/src/main/java/otus/gpb/recyclerview/ItemSwipeHelper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package otus.gpb.recyclerview

import android.content.Context
import android.graphics.Canvas
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import it.xabaras.android.recyclerview.swipedecorator.RecyclerViewSwipeDecorator


class ItemSwipeHelper(private val context: Context) : ItemTouchHelper.Callback() {

override fun getMovementFlags(
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder
): Int = makeMovementFlags(0, ItemTouchHelper.LEFT)

override fun onMove(
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder
): Boolean = false

override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
viewHolder.chatAdapter.removeItem(viewHolder.absoluteAdapterPosition)
}

override fun onChildDraw(
c: Canvas,
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder,
dX: Float,
dY: Float,
actionState: Int,
isCurrentlyActive: Boolean
) {
RecyclerViewSwipeDecorator.Builder(
c,
recyclerView,
viewHolder,
dX,
dY,
actionState,
isCurrentlyActive
)
.addBackgroundColor(ContextCompat.getColor(context, R.color.pale_blue))
.addActionIcon(R.drawable.ic_archive)
.create()
.decorate()

super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive)
}

private val RecyclerView.ViewHolder.chatAdapter: ChatListAdapter
get() = bindingAdapter as? ChatListAdapter ?: error("Not ChatListAdapter")
}
39 changes: 38 additions & 1 deletion app/src/main/java/otus/gpb/recyclerview/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,49 @@
package otus.gpb.recyclerview

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView

class MainActivity : AppCompatActivity() {

private lateinit var list: MutableList<ChatItem>
private val adapter by lazy { ChatListAdapter() }

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

val recyclerView: RecyclerView = findViewById(R.id.recyclerView)
val divider = DividerItemDecoration(this, DividerItemDecoration.VERTICAL)
divider.setDrawable(
ContextCompat.getDrawable(this, R.drawable.rv_item_divider)
?: error("Not divider drawable")
)

recyclerView.addItemDecoration(divider)
ItemTouchHelper(ItemSwipeHelper(this)).attachToRecyclerView(recyclerView)

list = ChatItemDataGenerator.generateChatItemsList(20)
recyclerView.adapter = adapter
adapter.submitList(list)

recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {

override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)

val lastPosition =
(recyclerView.layoutManager as LinearLayoutManager).findLastVisibleItemPosition()
val itemCount = adapter.itemCount

if (lastPosition + 1 >= itemCount) {
adapter.addItems(5)
}
}
})
}
}
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_archive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M6.665,36.989L3.903,45H2.234L5.712,35.758H6.779L6.665,36.989ZM8.975,45L6.208,36.989L6.087,35.758H7.16L10.651,45H8.975ZM8.842,41.572V42.835H3.814V41.572H8.842ZM13.069,39.439V45H11.54V38.132H13L13.069,39.439ZM15.17,38.087L15.158,39.509C15.065,39.492 14.963,39.48 14.853,39.471C14.747,39.463 14.641,39.458 14.536,39.458C14.273,39.458 14.043,39.497 13.844,39.573C13.645,39.645 13.478,39.75 13.342,39.89C13.211,40.026 13.109,40.191 13.038,40.385C12.966,40.58 12.923,40.798 12.911,41.039L12.561,41.064C12.561,40.633 12.604,40.233 12.689,39.865C12.773,39.497 12.9,39.173 13.069,38.894C13.243,38.614 13.459,38.396 13.717,38.24C13.979,38.083 14.282,38.005 14.625,38.005C14.718,38.005 14.817,38.013 14.923,38.03C15.033,38.047 15.115,38.066 15.17,38.087ZM18.808,43.908C19.057,43.908 19.282,43.86 19.48,43.762C19.684,43.661 19.847,43.521 19.969,43.343C20.096,43.166 20.166,42.96 20.179,42.728H21.62C21.611,43.172 21.48,43.576 21.226,43.94C20.972,44.304 20.636,44.594 20.217,44.81C19.798,45.021 19.334,45.127 18.827,45.127C18.302,45.127 17.845,45.038 17.456,44.86C17.066,44.678 16.743,44.429 16.484,44.111C16.226,43.794 16.032,43.428 15.9,43.013C15.773,42.598 15.71,42.154 15.71,41.68V41.458C15.71,40.984 15.773,40.54 15.9,40.125C16.032,39.706 16.226,39.338 16.484,39.021C16.743,38.703 17.066,38.456 17.456,38.278C17.845,38.096 18.3,38.005 18.82,38.005C19.37,38.005 19.853,38.115 20.268,38.335C20.682,38.551 21.008,38.853 21.245,39.243C21.486,39.628 21.611,40.076 21.62,40.588H20.179C20.166,40.334 20.103,40.106 19.988,39.903C19.878,39.695 19.722,39.53 19.519,39.408C19.32,39.285 19.081,39.224 18.801,39.224C18.492,39.224 18.236,39.287 18.033,39.414C17.83,39.537 17.671,39.706 17.557,39.922C17.443,40.133 17.36,40.373 17.31,40.639C17.263,40.902 17.24,41.174 17.24,41.458V41.68C17.24,41.964 17.263,42.239 17.31,42.505C17.356,42.772 17.437,43.011 17.551,43.223C17.669,43.43 17.83,43.597 18.033,43.724C18.236,43.847 18.494,43.908 18.808,43.908ZM24.305,35.25V45H22.781V35.25H24.305ZM24.038,41.312L23.543,41.306C23.547,40.832 23.613,40.394 23.74,39.992C23.871,39.59 24.053,39.241 24.286,38.944C24.523,38.644 24.806,38.413 25.136,38.252C25.466,38.087 25.832,38.005 26.234,38.005C26.573,38.005 26.878,38.051 27.148,38.145C27.424,38.238 27.66,38.388 27.859,38.595C28.058,38.798 28.208,39.065 28.31,39.395C28.416,39.721 28.469,40.119 28.469,40.588V45H26.933V40.576C26.933,40.246 26.884,39.983 26.787,39.789C26.694,39.594 26.556,39.454 26.374,39.37C26.192,39.281 25.97,39.236 25.708,39.236C25.433,39.236 25.189,39.291 24.978,39.401C24.77,39.511 24.597,39.662 24.457,39.852C24.317,40.042 24.212,40.263 24.14,40.512C24.072,40.762 24.038,41.028 24.038,41.312ZM31.655,38.132V45H30.119V38.132H31.655ZM30.018,36.329C30.018,36.096 30.094,35.904 30.246,35.751C30.403,35.595 30.618,35.517 30.894,35.517C31.164,35.517 31.378,35.595 31.535,35.751C31.691,35.904 31.77,36.096 31.77,36.329C31.77,36.558 31.691,36.748 31.535,36.9C31.378,37.053 31.164,37.129 30.894,37.129C30.618,37.129 30.403,37.053 30.246,36.9C30.094,36.748 30.018,36.558 30.018,36.329ZM35.565,43.788L37.248,38.132H38.834L36.448,45H35.458L35.565,43.788ZM34.277,38.132L35.991,43.813L36.073,45H35.083L32.684,38.132H34.277ZM42.719,45.127C42.211,45.127 41.752,45.044 41.342,44.879C40.936,44.71 40.589,44.475 40.301,44.175C40.017,43.874 39.799,43.521 39.647,43.115C39.495,42.708 39.418,42.271 39.418,41.801V41.547C39.418,41.009 39.497,40.523 39.653,40.087C39.81,39.651 40.028,39.279 40.307,38.97C40.586,38.657 40.917,38.417 41.297,38.252C41.678,38.087 42.091,38.005 42.535,38.005C43.026,38.005 43.456,38.087 43.824,38.252C44.192,38.417 44.497,38.65 44.738,38.951C44.983,39.247 45.165,39.6 45.284,40.011C45.406,40.421 45.468,40.874 45.468,41.369V42.023H40.161V40.925H43.957V40.804C43.949,40.529 43.894,40.271 43.792,40.03C43.695,39.789 43.544,39.594 43.341,39.446C43.138,39.298 42.867,39.224 42.529,39.224C42.275,39.224 42.049,39.279 41.85,39.389C41.655,39.494 41.492,39.649 41.361,39.852C41.23,40.055 41.128,40.301 41.056,40.588C40.988,40.872 40.955,41.191 40.955,41.547V41.801C40.955,42.101 40.995,42.381 41.075,42.639C41.16,42.893 41.283,43.115 41.443,43.305C41.604,43.496 41.799,43.646 42.027,43.756C42.256,43.862 42.516,43.915 42.808,43.915C43.176,43.915 43.504,43.84 43.792,43.692C44.08,43.544 44.329,43.335 44.541,43.064L45.347,43.845C45.199,44.061 45.007,44.268 44.77,44.467C44.533,44.661 44.243,44.82 43.9,44.943C43.561,45.066 43.168,45.127 42.719,45.127Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M34,21.292V7.415C34,7.133 34,6.4 33.661,6.061L29.935,2.338C29.823,2.226 29.461,2 28.919,2H18.081C17.539,2 17.177,2.226 17.065,2.338L13.339,6.061C13,6.4 13,7.133 13,7.415V21.292C13,22.788 14.213,24 15.71,24H31.29C32.787,24 34,22.788 34,21.292ZM28.919,3.692H18.081L16.048,5.723H30.952L28.919,3.692ZM25.532,12.154V13.507H28.455C28.751,13.507 28.899,13.866 28.69,14.075L23.5,19.261L18.31,14.075C18.101,13.866 18.249,13.507 18.545,13.507H21.468V12.154C21.468,11.612 21.919,11.477 22.145,11.477H24.855C25.397,11.477 25.532,11.928 25.532,12.154Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>
Binary file added app/src/main/res/drawable/ic_avatar_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_avatar_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_avatar_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_avatar_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_avatar_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_avatar_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_avatar_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2.667,6.222H20.445V8.296H2.667V6.222ZM2.667,11.407H20.445V13.481H2.667V11.407ZM2.667,16.593H20.445V18.667H2.667V16.593Z"
android:fillColor="#ffffff"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_pencil.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="27dp"
android:height="27dp"
android:viewportWidth="27"
android:viewportHeight="27">
<path
android:pathData="M22.675,7.491C23.108,7.058 23.108,6.336 22.675,5.925L20.075,3.325C19.664,2.892 18.942,2.892 18.509,3.325L16.465,5.358L20.631,9.524L22.675,7.491ZM3,18.834V23H7.166L19.453,10.702L15.287,6.536L3,18.834Z"
android:fillColor="@color/white"
android:fillType="evenOdd"/>
</vector>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/ic_pinned.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="23dp"
android:height="23dp"
android:viewportWidth="23"
android:viewportHeight="23">
<path
android:pathData="M11.5,23C17.851,23 23,17.851 23,11.5C23,5.149 17.851,0 11.5,0C5.149,0 0,5.149 0,11.5C0,17.851 5.149,23 11.5,23ZM11.5,22C17.299,22 22,17.299 22,11.5C22,5.701 17.299,1 11.5,1C5.701,1 1,5.701 1,11.5C1,17.299 5.701,22 11.5,22Z"
android:fillColor="#868686"
android:fillType="evenOdd"/>
<path
android:pathData="M11.528,14.481C11.291,14.235 10.91,14.201 10.633,14.4L7.779,16.451C7.749,16.473 7.721,16.497 7.692,16.521C7.644,16.562 7.589,16.595 7.531,16.619C7.455,16.65 7.374,16.667 7.291,16.667C7.209,16.667 7.128,16.65 7.052,16.619C6.977,16.588 6.908,16.542 6.85,16.484C6.792,16.426 6.746,16.357 6.714,16.281C6.683,16.205 6.667,16.124 6.667,16.042C6.667,15.96 6.683,15.878 6.714,15.803C6.746,15.727 6.792,15.658 6.85,15.6L9.054,12.891C9.278,12.616 9.255,12.214 9,11.966L7.565,10.568C7.291,10.301 7.287,9.858 7.605,9.644C8.217,9.234 9.198,8.821 10.616,8.856C10.814,8.861 11.009,8.79 11.149,8.65L13.25,6.55L13.648,6.152C13.916,5.884 14.35,5.884 14.618,6.152L15.016,6.55L16.783,8.316L17.181,8.714C17.449,8.982 17.449,9.417 17.181,9.685L16.783,10.083L14.703,12.163C14.551,12.315 14.482,12.53 14.5,12.744C14.628,14.25 14.164,15.174 13.718,15.748C13.482,16.052 13.031,16.039 12.765,15.763L11.528,14.481Z"
android:fillColor="#868686"/>
<path
android:pathData="M11.528,14.481C11.291,14.235 10.91,14.201 10.633,14.4L7.779,16.451C7.749,16.473 7.721,16.497 7.692,16.521C7.644,16.562 7.589,16.595 7.531,16.619C7.455,16.65 7.374,16.667 7.291,16.667C7.209,16.667 7.128,16.65 7.052,16.619C6.977,16.588 6.908,16.542 6.85,16.484C6.792,16.426 6.746,16.357 6.714,16.281C6.683,16.205 6.667,16.124 6.667,16.042C6.667,15.96 6.683,15.878 6.714,15.803C6.746,15.727 6.792,15.658 6.85,15.6L9.054,12.891C9.278,12.616 9.255,12.214 9,11.966L7.565,10.568C7.291,10.301 7.287,9.858 7.605,9.644C8.217,9.234 9.198,8.821 10.616,8.856C10.814,8.861 11.009,8.79 11.149,8.65L13.25,6.55L13.648,6.152C13.916,5.884 14.35,5.884 14.618,6.152L15.016,6.55L16.783,8.316L17.181,8.714C17.449,8.982 17.449,9.417 17.181,9.685L16.783,10.083L14.703,12.163C14.551,12.315 14.482,12.53 14.5,12.744C14.628,14.25 14.164,15.174 13.718,15.748C13.482,16.052 13.031,16.039 12.765,15.763L11.528,14.481Z"
android:fillColor="#868686"
android:fillType="evenOdd"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/rv_item_divider.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:left="67dp">
<shape android:shape="rectangle">
<solid android:color="@color/light_grey" />
<size android:height="1dp" />
</shape>
</item>

</layer-list>
33 changes: 32 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/main_activity_abl"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:navigationIcon="@drawable/ic_menu"
app:title="@string/recyclerview"
app:titleTextAppearance="@style/TextAppearance.Material3.TitleMedium"
app:titleTextColor="@color/white" />
</com.google.android.material.appbar.AppBarLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="0dp"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/main_activity_abl"
tools:listitem="@layout/chat_item" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="14dp"
android:contentDescription="@string/fab"
android:src="@drawable/ic_pencil"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Loading