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
45 changes: 36 additions & 9 deletions stream-chat-android-compose/api/stream-chat-android-compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ public final class io/getstream/chat/android/compose/state/QueryConfig {
public final class io/getstream/chat/android/compose/state/channels/list/ChannelsState {
public static final field $stable I
public fun <init> ()V
public fun <init> (ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;)V
public synthetic fun <init> (ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;Z)V
public synthetic fun <init> (ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Z
public final fun component2 ()Z
public final fun component3 ()Z
public final fun component4 ()Ljava/util/List;
public final fun component5 ()Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;
public final fun copy (ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;)Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;ILjava/lang/Object;)Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;
public final fun component6 ()Z
public final fun copy (ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;Z)Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;ZZZLjava/util/List;Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;ZILjava/lang/Object;)Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;
public fun equals (Ljava/lang/Object;)Z
public final fun getChannelItems ()Ljava/util/List;
public final fun getEndOfChannels ()Z
public final fun getLoadingError ()Z
public final fun getSearchQuery ()Lio/getstream/chat/android/compose/state/channels/list/SearchQuery;
public fun hashCode ()I
public final fun isLoading ()Z
Expand Down Expand Up @@ -906,8 +908,8 @@ public final class io/getstream/chat/android/compose/ui/channels/list/ChannelIte
}

public final class io/getstream/chat/android/compose/ui/channels/list/ChannelListKt {
public static final fun ChannelList (Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModel;Landroidx/compose/foundation/lazy/LazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V
public static final fun ChannelList (Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;Lio/getstream/chat/android/models/User;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/foundation/lazy/LazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V
public static final fun ChannelList (Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModel;Landroidx/compose/foundation/lazy/LazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V
public static final fun ChannelList (Lio/getstream/chat/android/compose/state/channels/list/ChannelsState;Lio/getstream/chat/android/models/User;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/foundation/lazy/LazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;III)V
}

public final class io/getstream/chat/android/compose/ui/channels/list/ComposableSingletons$ChannelItemKt {
Expand All @@ -934,13 +936,20 @@ public final class io/getstream/chat/android/compose/ui/channels/list/Composable
public final fun getLambda$633588870$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/channels/list/ComposableSingletons$ChannelListBannerKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/channels/list/ComposableSingletons$ChannelListBannerKt;
public fun <init> ()V
public final fun getLambda$-638741787$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1086266154$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/channels/list/ComposableSingletons$ChannelListKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/channels/list/ComposableSingletons$ChannelListKt;
public fun <init> ()V
public final fun getLambda$-1574868688$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda$-9786949$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda$-1069945477$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda$-269013763$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda$1011130122$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function4;
public final fun getLambda$1179005625$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda$2087787954$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
}

public final class io/getstream/chat/android/compose/ui/channels/list/ComposableSingletons$ChannelsKt {
Expand Down Expand Up @@ -2925,6 +2934,22 @@ public final class io/getstream/chat/android/compose/ui/theme/ChannelItemUnreadC
public fun toString ()Ljava/lang/String;
}

public final class io/getstream/chat/android/compose/ui/theme/ChannelListBannerParams {
public static final field $stable I
public fun <init> ()V
public fun <init> (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;)V
public synthetic fun <init> (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Landroidx/compose/ui/Modifier;
public final fun component2 ()Lkotlin/jvm/functions/Function0;
public final fun copy (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;)Lio/getstream/chat/android/compose/ui/theme/ChannelListBannerParams;
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/ui/theme/ChannelListBannerParams;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/theme/ChannelListBannerParams;
public fun equals (Ljava/lang/Object;)Z
public final fun getModifier ()Landroidx/compose/ui/Modifier;
public final fun getOnClick ()Lkotlin/jvm/functions/Function0;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class io/getstream/chat/android/compose/ui/theme/ChannelListConfig {
public static final field $stable I
public fun <init> ()V
Expand Down Expand Up @@ -3413,6 +3438,7 @@ public abstract interface class io/getstream/chat/android/compose/ui/theme/ChatC
public fun ChannelItemReadStatusIndicator (Lio/getstream/chat/android/compose/ui/theme/ChannelItemReadStatusIndicatorParams;Landroidx/compose/runtime/Composer;I)V
public fun ChannelItemTrailingContent (Landroidx/compose/foundation/layout/RowScope;Lio/getstream/chat/android/compose/ui/theme/ChannelItemTrailingContentParams;Landroidx/compose/runtime/Composer;I)V
public fun ChannelItemUnreadCountIndicator (Lio/getstream/chat/android/compose/ui/theme/ChannelItemUnreadCountIndicatorParams;Landroidx/compose/runtime/Composer;I)V
public fun ChannelListBanner (Lio/getstream/chat/android/compose/ui/theme/ChannelListBannerParams;Landroidx/compose/runtime/Composer;I)V
public fun ChannelListDividerItem (Landroidx/compose/foundation/lazy/LazyItemScope;Lio/getstream/chat/android/compose/ui/theme/ChannelListDividerItemParams;Landroidx/compose/runtime/Composer;I)V
public fun ChannelListEmptyContent (Lio/getstream/chat/android/compose/ui/theme/ChannelListEmptyContentParams;Landroidx/compose/runtime/Composer;I)V
public fun ChannelListEmptySearchContent (Lio/getstream/chat/android/compose/ui/theme/ChannelListEmptySearchContentParams;Landroidx/compose/runtime/Composer;I)V
Expand Down Expand Up @@ -3604,6 +3630,7 @@ public final class io/getstream/chat/android/compose/ui/theme/ChatComponentFacto
public static fun ChannelItemReadStatusIndicator (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ChannelItemReadStatusIndicatorParams;Landroidx/compose/runtime/Composer;I)V
public static fun ChannelItemTrailingContent (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Landroidx/compose/foundation/layout/RowScope;Lio/getstream/chat/android/compose/ui/theme/ChannelItemTrailingContentParams;Landroidx/compose/runtime/Composer;I)V
public static fun ChannelItemUnreadCountIndicator (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ChannelItemUnreadCountIndicatorParams;Landroidx/compose/runtime/Composer;I)V
public static fun ChannelListBanner (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ChannelListBannerParams;Landroidx/compose/runtime/Composer;I)V
public static fun ChannelListDividerItem (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Landroidx/compose/foundation/lazy/LazyItemScope;Lio/getstream/chat/android/compose/ui/theme/ChannelListDividerItemParams;Landroidx/compose/runtime/Composer;I)V
public static fun ChannelListEmptyContent (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ChannelListEmptyContentParams;Landroidx/compose/runtime/Composer;I)V
public static fun ChannelListEmptySearchContent (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ChannelListEmptySearchContentParams;Landroidx/compose/runtime/Composer;I)V
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2014-2026 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.chat.android.compose.state.channels.list

import io.getstream.result.Error

/**
* One-off events emitted by the channel list in response to user-triggered actions, used to drive transient feedback
* such as a snackbar.
*/
internal sealed interface ChannelListEvent {

/**
* A user-triggered channel action failed.
*
* @param action The action that failed, used to pick the feedback message.
* @param error The error that caused the failure.
*/
data class ActionError(val action: ChannelListAction, val error: Error) : ChannelListEvent

/**
* A channel was successfully deleted.
*/
data object ChannelDeleted : ChannelListEvent
}

/**
* The user-triggered channel actions that can produce a [ChannelListEvent.ActionError].
*/
internal enum class ChannelListAction {
MuteChannel,
UnmuteChannel,
PinChannel,
UnpinChannel,
ArchiveChannel,
UnarchiveChannel,
DeleteChannel,
LeaveGroup,
MuteUser,
UnmuteUser,
BlockUser,
UnblockUser,
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ package io.getstream.chat.android.compose.state.channels.list
* @param endOfChannels If we've reached the end of channels, to stop triggering pagination.
* @param channelItems The channel items to represent in the list.
* @param searchQuery The current search query.
* @param loadingError If the last channel load failed. Cleared once a subsequent load succeeds.
*/
public data class ChannelsState(
val isLoading: Boolean = true,
val isLoadingMore: Boolean = false,
val endOfChannels: Boolean = false,
val channelItems: List<ItemState> = emptyList(),
val searchQuery: SearchQuery = SearchQuery.Empty,
val loadingError: Boolean = false,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2014-2026 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.chat.android.compose.ui.channels

import androidx.annotation.StringRes
import androidx.annotation.VisibleForTesting
import io.getstream.chat.android.compose.R
import io.getstream.chat.android.compose.state.channels.list.ChannelListAction

/**
* The snackbar message shown when [this] channel action fails.
*/
@StringRes
@VisibleForTesting
internal fun ChannelListAction.errorMessageResId(): Int = when (this) {
ChannelListAction.MuteChannel -> R.string.stream_compose_channel_list_action_error_mute_channel
ChannelListAction.UnmuteChannel -> R.string.stream_compose_channel_list_action_error_unmute_channel
ChannelListAction.PinChannel -> R.string.stream_compose_channel_list_action_error_pin_channel
ChannelListAction.UnpinChannel -> R.string.stream_compose_channel_list_action_error_unpin_channel
ChannelListAction.ArchiveChannel -> R.string.stream_compose_channel_list_action_error_archive_channel
ChannelListAction.UnarchiveChannel -> R.string.stream_compose_channel_list_action_error_unarchive_channel
ChannelListAction.DeleteChannel -> R.string.stream_compose_channel_list_action_error_delete_channel
ChannelListAction.LeaveGroup -> R.string.stream_compose_channel_list_action_error_leave_group
ChannelListAction.MuteUser -> R.string.stream_compose_channel_list_action_error_mute_user
ChannelListAction.UnmuteUser -> R.string.stream_compose_channel_list_action_error_unmute_user
ChannelListAction.BlockUser -> R.string.stream_compose_channel_list_action_error_block_user
ChannelListAction.UnblockUser -> R.string.stream_compose_channel_list_action_error_unblock_user
}
Loading
Loading