Custom UI

CustomUIDelegate

The SDK supports to customize the following UI components via CustomUIDelegate:

CustomizableViewType

CustomizableViewType

Notes

1

Login prompt TextView

LOGIN_PROMPT_TEXT_VIEW

2

Say control TextView in pre-conversation

SAY_CONTROL_IN_PRE_CONVERSATION_TEXT_VIEW

3

Say control TextView in conversation

SAY_CONTROL_IN_CONVERSATION_TEXT_VIEW

4

Community question TextView

COMMUNITY_QUESTION_TEXT_VIEW

5

Conversation footer View

CONVERSATION_FOOTER_VIEW

6

Navigation title TextView

NAVIGATION_TITLE_TEXT_VIEW

7

Community guidelines TextView

COMMUNITY_GUIDELINES_TEXT_VIEW

8

Create Comment action button

COMMENT_CREATION_ACTION_BUTTON

9

Read only label

READ_ONLY_TEXT_VIEW

10

Empty state read only label

EMPTY_STATE_READ_ONLY_TEXT_VIEW

In order to add your own customization for SpotIm UI elements, you have to set a CustomUIDelegate as follows:

SpotIm.setCustomUIDelegate(object: CustomUIDelegate {
    override fun customizeView(viewType: CustomizableViewType, view: View, isDarkModeEnabled: Boolean) {
        when (viewType) {
            CustomizableViewType.LOGIN_PROMPT_TEXT_VIEW -> {
                val textView = view as? TextView
                // set your own customization
            }
      // set more customizations to other CustomizableViewType
    }
  }
}
SpotIm.setCustomUIDelegate(new CustomUIDelegate() {
    @Override
    public void customizeView(@NotNull CustomizableViewType viewType, @NotNull View view, boolean isDarkModeEnabled) {
        switch (viewType) {
            case LOGIN_PROMPT_TEXT_VIEW:
                TextView textView = (TextView) view;
        // set your own customization
        break;
        // set more customizations to other CustomizableViewType
        }
    }
});

Other customization

You can customize the text for sorting options

// Method signature
fun setCustomSortByOptionText(type: SpotImSortOption, textResId: Int)

// SpotImSortOption enum
enum class SpotImSortOption {
    BEST,
    NEWEST,
    OLDEST
}

// Example - Use with `ConversationOptions` `Builder`
var builder = ConversationOptions.Builder()
builder.setCustomSortByOptionText(SpotImSortOption.BEST, R.string.customTitle)

Did this page help you?