Open a comment creation experience

Provide users a way to create and post comments

The Android SDK provides two approaches for creating a new comment.

ApproachDescription
Comment Creation ScreenOpens a comment creation screen

When implemented, a user sees the comment creation screen directly above the full Conversation screen.
Floating Comment Creation ViewEnables creating a comment without leaving the Conversation

When implemented, a user sees floating keyboard with which a comment can be added.

📘

When the Conversation is in readOnlyMode, only the Conversation screen will be shown and the new comment screen won't open.



Open a comment creation screen

Use the following step to configure the Conversation:

  1. In onCreate() of an article activity, add the create comment to the Activity.
SpotIm.getCreateCommentIntent(context, CONVERSATION_ID, object :
    SpotCallback<Intent> {
        override fun onSuccess(intent: Intent) {
            startActivity(intent)
        }

        override fun onFailure(exception: SpotException) {
            //Handle error here
   	}
})


Open the floating comment creation view

Use the following step to configure the Conversation:

  1. When defining the CommentCreationStyle, select OWCommentCreationStyle.Floating.

    ConversationOptions.Builder()
                .setCommentCreationStyle(OWCommentCreationStyle.Floating)
                ...
                .build()