Remove RecyclerView padding when floating action button is disabled

This commit is contained in:
cketti 2023-01-04 12:39:06 +01:00
parent 1c6bb9d6f0
commit 7963c3562d

View file

@ -16,6 +16,7 @@ import androidx.appcompat.view.ActionMode
import androidx.core.os.bundleOf
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.core.view.setPadding
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.RecyclerView
@ -300,6 +301,10 @@ class MessageListFragment :
private fun initializeRecyclerView(view: View) {
val recyclerView = view.findViewById<RecyclerView>(R.id.message_list)
if (!isShowFloatingActionButton) {
recyclerView.setPadding(0)
}
val itemDecoration = MessageListItemDecoration(requireContext())
recyclerView.addItemDecoration(itemDecoration)