This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun updateMessagesList(messages: List<Message>) { | |
adapter.submitList(messages) | |
adapter.notifyDataSetChanged() | |
val scrollTarget = adapter.itemCount | |
messageListSmoothScroller.targetPosition = scrollTarget | |
messagesList.layoutManager?.startSmoothScroll(messageListSmoothScroller) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="wrap_content"> | |
<androidx.cardview.widget.CardView | |
android:id="@+id/avatarWrapper" | |
android:layout_width="@dimen/avatar_size" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChannelFragment : Fragment() { | |
//... | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
binding.messageListView.setMessageViewHolderFactory(MyCustomMessageViewHolderFactory()) | |
} | |
} |
OlderNewer