Skip to content

Commit

Permalink
[i108] Expose itemAnimator for MessageListView (#4922)
Browse files Browse the repository at this point in the history
* [i108] Expose itemAnimator for MessageListView

* [i108] add CHANGELOG

---------

Co-authored-by: kanat <>
  • Loading branch information
kanat authored Aug 16, 2023
1 parent d1f2e37 commit d9352d1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
- Improved trailing buttons customization for `MessageComposerView`. [#4915](https://github.com/GetStream/stream-chat-android/pull/4915)

### ✅ Added
- Added `MessageListView.setCustomItemAnimator` to allow customizing the item animator used by the `MessageListView`. [#4922](https://github.com/GetStream/stream-chat-android/pull/4922)

### ⚠️ Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,7 @@ public final class io/getstream/chat/android/ui/feature/messages/list/MessageLis
public final fun setConfirmFlagMessageHandler (Lio/getstream/chat/android/ui/feature/messages/list/MessageListView$ConfirmFlagMessageHandler;)V
public final fun setCopyMessageEnabled (Z)V
public final fun setCustomActionHandler (Lio/getstream/chat/android/ui/feature/messages/list/MessageListView$CustomActionHandler;)V
public final fun setCustomItemAnimator (Landroidx/recyclerview/widget/RecyclerView$ItemAnimator;)V
public final fun setCustomLinearLayoutManager (Landroidx/recyclerview/widget/LinearLayoutManager;)V
public final fun setDeleteMessageConfirmationEnabled (Z)V
public final fun setDeleteMessageEnabled (Z)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.core.view.isVisible
import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ItemAnimator
import io.getstream.chat.android.client.ChatClient
import io.getstream.chat.android.client.utils.attachment.isGiphy
import io.getstream.chat.android.client.utils.attachment.isImage
Expand Down Expand Up @@ -828,6 +829,17 @@ public class MessageListView : ConstraintLayout {
binding.chatMessagesRV.layoutManager = layoutManager
}

/**
* Set a custom item animator for MessageListView.
* That will handle animations involving changes to the items in this MessageListView.
*
* @param itemAnimator The ItemAnimator being set. If null, no animations will occur when changes occur
* to the items in this MessageListView.
*/
public fun setCustomItemAnimator(itemAnimator: ItemAnimator) {
binding.chatMessagesRV.itemAnimator = itemAnimator
}

/**
* Sets the view to be displayed when the message list is loading.
*
Expand Down

0 comments on commit d9352d1

Please sign in to comment.