Change the color scheme of your chat widget

You can use one of our predefined themes or configure your chat appearance by yourself!
Written by Alex
Updated 2 months ago

HCTheme.Builder is pretty self-explanatory. To change how a chat screen looks like, you can use one of the three methods. They will return the instance of HCTheme, which you can configure in any way you want.

Default theme

HCTheme.Builder(HCTheme.Type.DEFAULT)

Dark theme

HCTheme.Builder(HCTheme.Type.DARK)

Custom main color theme

HCTheme.Builder(R.color.main_color, shouldPaintIconsAutomatically: true)

Example

Attach a theme during initialization:

Java:

HCTheme theme = new HCTheme.Builder(HCTheme.Type.DEFAULT).build()

HCOptions options = new HCOptions.Builder()
        .setTheme(theme)
        .build();

HelpCrunch.initialize(this, ORGANISATION, APP_ID, SECRET, (HCUser) null, options);

Kotlin:

val theme = HCTheme.Builder(HCTheme.Type.DEFAULT).build()

val options = HCOptions.Builder()
        .setTheme(theme)
        .build()

HelpCrunch.initialize(this, ORGANISATION, APP_ID, SECRET, options = options)

Attach a theme when starting a chat screen:

Java:

HCTheme theme = new HCTheme.Builder(HCTheme.Type.DEFAULT).build()

HCOptions options = new HCOptions.Builder()
        .setTheme(theme)
        .build();

HelpCrunch.showChatScreen(context, options);

Kotlin:

val theme = HCTheme.Builder(HCTheme.Type.DEFAULT).build()

val options = HCOptions.Builder()
        .setTheme(theme)
        .build()

HelpCrunch.showChatScreen(context, options)

Did this answer your question?