Package 

Class ChannelOptionsKt

    • Method Summary

      Modifier and Type Method Description
      final static Unit ChannelOptions(List<ChannelAction> actions, Function1<ChannelAction, Unit> onChannelOptionConfirm, Modifier modifier) This is the default bottom drawer UI that shows up when the user long taps on a channel item.
      final static List<ChannelAction> buildDefaultChannelActions(Channel selectedChannel, Set<String> ownCapabilities, ChannelListViewModel viewModel, Function1<Channel, Unit> onViewInfoAction) Builds the default list of channel actions, based on the current user permissions and channel state.
      final static List<ChannelAction> buildDefaultChannelActions(Channel selectedChannel, Boolean isMuted, Set<String> ownCapabilities, ChannelListViewModel viewModel, Function1<Channel, Unit> onViewInfoAction) Deprecated overload that forwarded an isMuted argument never read by the action builders.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ChannelOptions

        @Composable() final static Unit ChannelOptions(List<ChannelAction> actions, Function1<ChannelAction, Unit> onChannelOptionConfirm, Modifier modifier)

        This is the default bottom drawer UI that shows up when the user long taps on a channel item.

        It sets up different actions that we provide, based on user permissions.

        Parameters:
        actions - The list of channel actions to show in the UI.
        onChannelOptionConfirm - Handler for when the user selects a channel action.
        modifier - Modifier for styling.
      • buildDefaultChannelActions

        @Composable() final static List<ChannelAction> buildDefaultChannelActions(Channel selectedChannel, Set<String> ownCapabilities, ChannelListViewModel viewModel, Function1<Channel, Unit> onViewInfoAction)

        Builds the default list of channel actions, based on the current user permissions and channel state. Each action is self-describing and carries its icon, label, and execution handler.

        Actions vary by channel type:

        • DM: View Info, Pin/Unpin Chat, Mute/Unmute User, Block/Unblock User, Archive/Unarchive Chat, Delete Chat

        • Group (owner): View Info, Pin/Unpin Chat, Archive/Unarchive Chat, Leave Group, Delete Group

        • Group (member): View Info, Pin/Unpin Chat, Archive/Unarchive Chat, Leave Group

        Pin and Archive actions are opt-in via ChannelOptionsVisibility.isPinChannelVisible and ChannelOptionsVisibility.isArchiveChannelVisible respectively.

        Parameters:
        selectedChannel - The currently selected channel.
        ownCapabilities - Set of capabilities the user is given for the current channel.
        viewModel - The ChannelListViewModel to bind action handlers to.
        onViewInfoAction - Handler invoked when the user selects the "View Info" action.
      • buildDefaultChannelActions

        @Deprecated(message = The isMuted parameter is unused and will be removed in a future release., replaceWith = @ReplaceWith(imports = {}, expression = buildDefaultChannelActions(selectedChannel, ownCapabilities, viewModel, onViewInfoAction)), level = DeprecationLevel.WARNING)@Composable() final static List<ChannelAction> buildDefaultChannelActions(Channel selectedChannel, Boolean isMuted, Set<String> ownCapabilities, ChannelListViewModel viewModel, Function1<Channel, Unit> onViewInfoAction)

        Deprecated overload that forwarded an isMuted argument never read by the action builders. Use the overload without isMuted instead.

        Parameters:
        selectedChannel - The currently selected channel.
        isMuted - Unused.
        ownCapabilities - Set of capabilities the user is given for the current channel.
        viewModel - The ChannelListViewModel to bind action handlers to.
        onViewInfoAction - Handler invoked when the user selects the "View Info" action.