Class ParticipantListFragment.Builder

  • Enclosing class:
    ParticipantListFragment

    public static class ParticipantListFragment.Builder
    extends java.lang.Object
    This is a Builder that is able to create the fragment of participants list. The builder provides options how the channel is showing and working. Also you can set the event handler what you want to override.
    Since:
    2.0.0
    • Constructor Detail

      • Builder

        public Builder​(@NonNull
                       java.lang.String channelUrl)
        Constructor
        Parameters:
        channelUrl - the url of the channel will be implemented.
      • Builder

        public Builder​(@NonNull
                       java.lang.String channelUrl,
                       @StyleRes
                       int customThemeResId)
        Constructor
        Parameters:
        channelUrl - the url of the channel will be implemented.
        customThemeResId - the resource identifier for custom theme.
    • Method Detail

      • withArguments

        @NonNull
        public ParticipantListFragment.Builder withArguments​(@NonNull
                                                             Bundle args)
        Sets arguments to this fragment.
        Parameters:
        args - the arguments supplied when the fragment was instantiated.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0
      • setHeaderTitle

        @NonNull
        public ParticipantListFragment.Builder setHeaderTitle​(@NonNull
                                                              java.lang.String title)
        Sets the title of the header.
        Parameters:
        title - text to be displayed.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setUseHeader

        @NonNull
        public ParticipantListFragment.Builder setUseHeader​(boolean useHeader)
        Sets whether the header is used.
        Parameters:
        useHeader - true if the header is used, false otherwise.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setUseHeaderLeftButton

        @NonNull
        public ParticipantListFragment.Builder setUseHeaderLeftButton​(boolean useHeaderLeftButton)
        Sets whether the left button of the header is used.
        Parameters:
        useHeaderLeftButton - true if the left button of the header is used, false otherwise.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setHeaderLeftButtonIconResId

        @NonNull
        public ParticipantListFragment.Builder setHeaderLeftButtonIconResId​(@DrawableRes
                                                                            int resId)
        Sets the icon on the left button of the header.
        Parameters:
        resId - the resource identifier of the drawable.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setHeaderLeftButtonIcon

        @NonNull
        public ParticipantListFragment.Builder setHeaderLeftButtonIcon​(@DrawableRes
                                                                       int resId,
                                                                       @Nullable
                                                                       ColorStateList tint)
        Sets the icon on the left button of the header.
        Parameters:
        resId - the resource identifier of the drawable.
        tint - Color state list to use for tinting this resource, or null to clear the tint.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        2.1.0
      • setUseHeaderRightButton

        @NonNull
        public ParticipantListFragment.Builder setUseHeaderRightButton​(boolean useHeaderRightButton)
        Sets whether the right button of the header is used.
        Parameters:
        useHeaderRightButton - true if the right button of the header is used, false otherwise.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setHeaderRightButtonIconResId

        @NonNull
        public ParticipantListFragment.Builder setHeaderRightButtonIconResId​(@DrawableRes
                                                                             int resId)
        Sets the icon on the right button of the header.
        Parameters:
        resId - the resource identifier of the drawable.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setHeaderRightButtonIcon

        @NonNull
        public ParticipantListFragment.Builder setHeaderRightButtonIcon​(@DrawableRes
                                                                        int resId,
                                                                        @Nullable
                                                                        ColorStateList tint)
        Sets the icon on the right button of the header.
        Parameters:
        resId - the resource identifier of the drawable.
        tint - Color state list to use for tinting this resource, or null to clear the tint.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        2.1.0
      • setEmptyIcon

        @NonNull
        public ParticipantListFragment.Builder setEmptyIcon​(@DrawableRes
                                                            int resId)
        Sets the icon when the data is not exists.
        Parameters:
        resId - the resource identifier of the drawable.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setEmptyIcon

        @NonNull
        public ParticipantListFragment.Builder setEmptyIcon​(@DrawableRes
                                                            int resId,
                                                            @Nullable
                                                            ColorStateList tint)
        Sets the icon when the data is not exists.
        Parameters:
        resId - the resource identifier of the drawable.
        tint - Color state list to use for tinting this resource, or null to clear the tint.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        2.1.0
      • setEmptyText

        @NonNull
        public ParticipantListFragment.Builder setEmptyText​(@StringRes
                                                            int resId)
        Sets the text when the data is not exists
        Parameters:
        resId - the resource identifier of text to be displayed.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setErrorText

        @NonNull
        public ParticipantListFragment.Builder setErrorText​(@StringRes
                                                            int resId)
        Sets the text when error occurs
        Parameters:
        resId - the resource identifier of text to be displayed.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0
      • setOnHeaderLeftButtonClickListener

        @NonNull
        public ParticipantListFragment.Builder setOnHeaderLeftButtonClickListener​(@NonNull
                                                                                  View.OnClickListener listener)
        Sets the click listener on the left button of the header.
        Parameters:
        listener - The callback that will run.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0
      • setOnHeaderRightButtonClickListener

        @NonNull
        public ParticipantListFragment.Builder setOnHeaderRightButtonClickListener​(@NonNull
                                                                                   View.OnClickListener listener)
        Sets the click listener on the right button of the header.
        Parameters:
        listener - The callback that will run.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0
      • setParticipantListAdapter

        @NonNull
        public <T extends ParticipantListAdapterParticipantListFragment.Builder setParticipantListAdapter​(T adapter)
        Sets the participants list adapter.
        Parameters:
        adapter - the adapter for the participant list.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0
      • setOnItemClickListener

        @NonNull
        public ParticipantListFragment.Builder setOnItemClickListener​(@NonNull
                                                                      OnItemClickListener<com.sendbird.android.user.User> itemClickListener)
        Sets the click listener on the item of participants list.
        Parameters:
        itemClickListener - The callback that will run.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0
      • setOnItemLongClickListener

        @NonNull
        public ParticipantListFragment.Builder setOnItemLongClickListener​(@NonNull
                                                                          OnItemLongClickListener<com.sendbird.android.user.User> itemLongClickListener)
        Sets the long click listener on the item of participants list.
        Parameters:
        itemLongClickListener - The callback that will run.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0
      • setOnProfileClickListener

        @NonNull
        public ParticipantListFragment.Builder setOnProfileClickListener​(@NonNull
                                                                         OnItemClickListener<com.sendbird.android.user.User> profileClickListener)
        Sets the click listener on the profile of message.
        Parameters:
        profileClickListener - The callback that will run.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setUseUserProfile

        @NonNull
        public ParticipantListFragment.Builder setUseUserProfile​(boolean useUserProfile)
        Sets whether the user profile uses.
        Parameters:
        useUserProfile - true if the user profile is shown when the profile image clicked, false otherwise.
        Returns:
        This Builder object to allow for chaining of calls to set methods.
      • setOnActionItemClickListener

        @NonNull
        public ParticipantListFragment.Builder setOnActionItemClickListener​(@Nullable
                                                                            OnItemClickListener<com.sendbird.android.user.User> actionItemClickListener)
        Register a callback to be invoked when the action button of the item is clicked.
        Parameters:
        actionItemClickListener - The callback that will run
        Returns:
        This Builder object to allow for chaining of calls to set methods.
        Since:
        3.0.0