OpenChannelFragment

Fragment that provides chat in OpenChannel

Types

Link copied to clipboard
open class Builder
This is a Builder that is able to create the OpenChannel fragment.

Functions

Link copied to clipboard
protected open fun deleteMessage(@NonNull message: BaseMessage)
Delete a message
Link copied to clipboard
protected open fun getChannelUrl(): String
Returns the URL of the channel with the required data to use this fragment.
Link copied to clipboard
protected open fun makeMessageContextMenu(@NonNull message: BaseMessage): List<DialogListItem>
Make context menu items that are shown when the message is long clicked.
Link copied to clipboard
protected open fun onBeforeReady(@NonNull status: ReadyStatus, @NonNull module: OpenChannelModule, @NonNull viewModel: OpenChannelViewModel)
After authenticate ()} is finished, onReady will be called with the result of authentication and all preparations will be ready to use.
Link copied to clipboard
protected open fun onBeforeSendFileMessage(@NonNull params: FileMessageCreateParams)
It will be called before sending message.
Link copied to clipboard
protected open fun onBeforeSendUserMessage(@NonNull params: UserMessageCreateParams)
It will be called before sending message.
Link copied to clipboard
protected open fun onBeforeUpdateUserMessage(@NonNull params: UserMessageUpdateParams)
It will be called before updating message.
Link copied to clipboard
protected open fun onBindChannelHeaderComponent(@NonNull headerComponent: OpenChannelHeaderComponent, @NonNull viewModel: OpenChannelViewModel, @Nullable channel: OpenChannel)
Called to bind events to the OpenChannelHeaderComponent.
Link copied to clipboard
protected open fun onBindMessageInputComponent(@NonNull inputComponent: OpenChannelMessageInputComponent, @NonNull viewModel: OpenChannelViewModel, @Nullable channel: OpenChannel)
Called to bind events to the OpenChannelMessageInputComponent.
Link copied to clipboard
protected open fun onBindMessageListComponent(@NonNull messageListComponent: OpenChannelMessageListComponent, @NonNull viewModel: OpenChannelViewModel, @Nullable channel: OpenChannel)
Called to bind events to the OpenChannelMessageListComponent.
Link copied to clipboard
protected open fun onBindStatusComponent(@NonNull statusComponent: StatusComponent, @NonNull viewModel: OpenChannelViewModel, @Nullable channel: OpenChannel)
Called to bind events to the StatusComponent.
Link copied to clipboard
Link copied to clipboard
protected open fun onConfigureParams(@NonNull module: OpenChannelModule, @NonNull args: Bundle)
Called to initialize the module's params or components' params.
Link copied to clipboard
open fun onCreate(@Nullable savedInstanceState: Bundle)
Create a module and a view model, and proceed with the authentication process in the view model.
Link copied to clipboard
Called to do initial creation of a module.
Link copied to clipboard
open fun onDestroy()
Link copied to clipboard
protected open fun onMessageClicked(@NonNull view: View, position: Int, @NonNull message: BaseMessage)
Called when the item of the message list is clicked.
Link copied to clipboard
protected open fun onMessageContextMenuItemClicked(@NonNull message: BaseMessage, @NonNull view: View, position: Int, @NonNull item: DialogListItem): Boolean
It will be called when the message context menu was clicked.
Link copied to clipboard
protected open fun onMessageLongClicked(@NonNull view: View, position: Int, @NonNull message: BaseMessage)
Called when the item of the message list is long-clicked.
Link copied to clipboard
protected open fun onMessageProfileClicked(@NonNull view: View, position: Int, @NonNull message: BaseMessage)
Called when the profile view of the message is clicked.
Link copied to clipboard
protected open fun onReady(@NonNull status: ReadyStatus, @NonNull module: OpenChannelModule, @NonNull viewModel: OpenChannelViewModel)
Called to start the operation of the fragment after authentication and module setup.
Link copied to clipboard
open fun onViewCreated(@NonNull view: View, @Nullable savedInstanceState: Bundle)
Link copied to clipboard
protected open fun resendMessage(@NonNull message: BaseMessage)
Resends a failed message.
Link copied to clipboard
protected open fun saveFileMessage(@NonNull message: FileMessage)
Download FileMessage into external storage.
Link copied to clipboard
protected open fun sendFileMessage(@NonNull uri: Uri)
Sends a file with given file information.
Link copied to clipboard
protected open fun sendUserMessage(@NonNull params: UserMessageCreateParams)
Sends a user message.
Link copied to clipboard
protected open fun shouldDismissLoadingDialog()
It will be called when the loading dialog needs dismissing.
Link copied to clipboard
protected open fun shouldShowLoadingDialog(): Boolean
It will be called when the loading dialog needs displaying.
Link copied to clipboard
protected open fun showMediaSelectDialog()
It will be called when the input message's left button is clicked.
Link copied to clipboard
open fun takeCamera()
Call taking camera application.
Link copied to clipboard
open fun takeFile()
Call taking file chooser application.
Link copied to clipboard
open fun takePhoto()
Call taking gallery application.
Link copied to clipboard
open fun takeVideo()
Call taking camera application for video capture.
Link copied to clipboard
open fun tryToChangeEnableInputView(enabled: Boolean, @NonNull hintText: String): Boolean
Enables or disables the input view with hint text.
Link copied to clipboard
protected open fun updateUserMessage(messageId: Long, @NonNull params: UserMessageUpdateParams)
Updates a UserMessage that was previously sent in the channel.