Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2664,7 +2664,7 @@ public final class io/getstream/chat/android/compose/ui/messages/list/MessageLis
}

public final class io/getstream/chat/android/compose/ui/messages/list/MessagesKt {
public static final fun Messages (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/foundation/layout/Arrangement$Vertical;Lio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function5;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
public static final fun Messages (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/foundation/layout/Arrangement$Vertical;Lio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function5;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;III)V
}

public final class io/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ import kotlin.math.abs
* @param loadingMoreContent Composable that represents the loading more content, when we're loading the next page.
* @param itemModifier Modifier for styling the message item container.
* @param itemContent Composable that represents the item that displays each message.
* @param headerContent The content shown at the top of the list of message items.
* @param footerContent The content shown at the bottom of the list of message items.
*/
@Composable
@Suppress("LongParameterList", "LongMethod", "ComplexMethod")
Expand Down Expand Up @@ -131,6 +133,8 @@ public fun Messages(
}
},
itemContent: @Composable LazyItemScope.(MessageListItemState) -> Unit,
headerContent: (@Composable () -> Unit)? = null,
footerContent: (@Composable () -> Unit)? = null,
) {
val lazyListState = messagesLazyListState.lazyListState
val messages = messagesState.messageItems
Expand Down Expand Up @@ -170,6 +174,12 @@ public fun Messages(
reverseLayout = true,
contentPadding = contentPadding,
) {
footerContent?.let { content ->
item {
content.invoke()
}
}

if (isLoadingMoreNewMessages && !endOfNewMessages) {
item {
loadingMoreContent()
Expand Down Expand Up @@ -201,6 +211,12 @@ public fun Messages(
loadingMoreContent()
}
}

headerContent?.let { content ->
item {
content.invoke()
}
}
}

helperContent()
Expand Down
Loading