Skinning & Customization

Learn about Skinning the Helpshift SDK to match the look-n-feel of your app. Customize localizable strings to support multiple languages in the SDK UI.

Introduction

If you want to customize Helpshift SDK theme as per your app's theme, see Theming and Skinning

If you want to change strings used in the SDK's UI or want to translate them as per device language, see String Customization.

Theming and Skinning

Before you begin

  1. Integrate Helpshift Unity Android SDK as documented here: Integration Guide
  2. Though optional, we recommend you to download and set up the Android Studio. Android Studio Setup Guide

Helpshift Android SDK comes with following themes -

  • Helpshift.Theme.Light.DarkActionBar (default)
  • Helpshift.Theme.Light
  • Helpshift.Theme.Dark
  • Helpshift.Theme.HighContrast
Helpshift.Theme.Dark Helpshift.Theme.HighContrast Helpshift.Theme.Light Helpshift.Theme.Light.DarkActionbar

The Helpshift Unity SDK zip folder includes the HelpshiftUnityAndroidResources, an open source android studio project, to customize theme and string resources according to your application.

The Helpshift Unity SDK includes a default build of HelpshiftUnityAndroidResources project i.e helpshift-plugin-resources.aar. The default theme is Helpshift.Theme.Light.DarkActionBar.

To customize the look and feel of the Helpshift SDK to match your app's style, please follow the steps given below -

  • Open the Android Studio and import the HelpshiftUnityAndroidResources project
    • If Android Studio is launched for the first time, select Open an existing Android Studio project and navigate to the directory where you downloaded the Helpshift Unity SDK and select HelpshiftUnityAndroidResources directory.
    • If Android Studio already has an open project, select from the menu File > New > Import Project and navigate to the directory where you downloaded the Helpshift Unity SDK and select HelpshiftUnityAndroidResources directory.
  • Navigate and open the HelpshiftUnityAndroidResources/helpshift-plugin/src/main/res/values/styles.xml styles file.
  • Define your custom Helpshift theme in your styles.xml and inherit it from one of the Helpshift themes mentioned above.
    • You can customize a few attributes to match the look and feel of your app with Helpshift SDK.
<style name="MyCustomHelpshiftTheme" parent="Helpshift.Theme.Light">
    <item name="colorAccent">@color/your_custom_color</item>
    <item name="colorPrimary">@color/your_custom_color</item>
    <item name="colorPrimaryDark">@color/your_custom_color</item>
</style>
  • Update Helpshift Unity activity as well as Unity dialog style parents to your custom Helpshift theme as mentioned below.
<style name="Helpshift.Theme.Unity.Activity" parent="MyCustomHelpshiftTheme"/>
<style name="Helpshift.Theme.Unity.Dialog" parent="MyCustomHelpshiftTheme"/>
  • Open the terminal window and run the following command: ./gradlew clean build
    • Once build is executed successfully, the helpshift-plugin-resources.aar file is generated in HelpshiftUnityAndroidResources directory.
    • Output path: /HelpshiftUnityAndroidResources/helpshift-plugin-resources.aar
  • Copy the helpshift-plugin-resources.aar file and replace it with /Assets/Plugins/Android/helpshift-plugin-resources.aar file.
    • Build and run the Unity project to verify your design changes.

In the custom theme, you can customize Android's styleable attributes along with Helpshift's styleable attributes.

Example:

<style name="MyCustomHelpshiftTheme" parent="Helpshift.Theme.Light">
    <item name="colorAccent">@color/your_custom_color</item>
    <item name="colorPrimary">@color/your_custom_color</item>
    <item name="colorPrimaryDark">@color/your_custom_color</item>

    <item name="hs__chatBubbleAdminText">@color/your_custom_color_of_admin_text</item>
    <item name="hs__chatBubbleUserText">@color/your_custom_color_of_user_text</item>
</style>

Helpshift styleable attributes

Field Summary
colorPrimary The primary branding color for the app.
colorPrimaryDark Dark variant of the primary branding color.
colorAccent Bright complement to the primary branding color.
titleTextColor Color of the Toolbar title string.
navigationIcon Drawable to use for the navigation button located at the start of the Toolbar (back button).
homeAsUpIndicator Drawable to use for the 'home as up' (back button when SearchView is expanded) indicator.
android:windowBackground Drawable to use as the overall window background.
android:textColorPrimary The most prominent text color.
android:textColorSecondary Secondary text color.
android:textColorHint Color of hint text (displayed when the field is empty).
hs__tabTextColor Color of the text in a tab on FAQ section pager screen.
hs__tabSelectedTextColor Color of the text in the selected tab on FAQs section pager screen.
hs__chatBubbleUserText Color of user text in conversation.
hs__chatBubbleUserLink Color of links in user's text in conversation.
hs__chatBubbleUserBackgroundColor Color applied to the background of user message bubble
hs__chatBubbleAdminText Color of admin text in conversation.
hs__chatBubbleAdminLink Color of links in admin's text in conversation.
hs__chatBubbleAdminBackgroundColor Color applied to the background of admin message bubble
hs__chatBubbleMediaBackgroundColor Color of the background shown in the attachment message or answer bot FAQs message bubble.
hs__chatBubbleMediaBorderColor Color of the border shown in the attachment message bubble.
hs__composeBackgroundColor Color of the active 'send' button on the conversation screen. Background color of the 'jump to latest message' button.
hs__selectableOptionColor Color of the text in the option pills of the Answer Bot or 'skip' button. Color of the 'jump to latest message' icon.
hs__tabletConversationContainerBackgroundColor Color used as background for Tablets
hs__typingIndicatorColor Color of typing indicator shown in Conversation screen
hs__attachmentBackgroundColor Color used as background for attachment meta data info while filing new issue.
hs__separatorColor Color of horizontal or vertical separators in the SDK.
hs__searchHighlightColor Color the highlighted text in search results.
hs__inboxTitleTextColor Color of title text of a message in campaigns inbox list.
hs__inboxTitleUnreadTextColor Color of title text of a message in campaign inbox list when message is unread.
hs__inboxTimeStampTextColor Color of message time stamp text in campaigns inbox list.
hs__inboxTimeStampUnreadTextColor Color of meesage time stamp text in campaign inbox list when message is unread.
hs__inboxBodyTextColor Color of body text of a message in campaign inbox list.
hs__inboxSwipeToDeleteBackgroundColor Background color of message in campaign list when it is being swiped for deletion.
hs__inboxSwipeToDeleteIconColor Color of delete icon which is displayed when user is swiping a campaign message for deletion.
hs__inboxIconBackgroundColor Background color of default icon image of a message (Displayed when icon image is not available).
hs__inboxSeparatorColor Color of horizontal or vertical separators in campaigns inbox.
hs__footerPromptBackground Color of footer background in FAQ and Conversation screens.
hs__expandedPickerIconColor Color of collapse (down arrow), search, clear, back icons in the list picker's expanded mode.
hs__collapsedPickerIconColor Color of expand (up arrow) icon in the list picker's collapsed mode

Styleable attributes in action

The following illustrates use of these styleable attributes over Helpshift SDK's UI:

hs__tabletConversationContainerBackgroundColor is used only on tablets, to surround the conversation card.

Helpshift dimensions

You can use the following dimension to change certain aspect of the SDK. These dimensions are independent of the theme set for the SDK.

For example:

<dimen name="DIMENSION_NAME">VALUE</dimen>
Dimension Summary Default value
hs_support_recyclerview_item_vertical_padding Top and bottom padding of each item in the Recyclerview Item. Any value less than 16 is ignored and will have no effect. This affects the Recyclerview Item used for FAQ list, FAQ sections list and search results 16dp

Orientation support

By default, the Android SDK will obey the orientation of the device. If the device rotates to landscape mode, the SDK will update its UI to landscape orientation. Rotating back to portrait mode will bring the UI back to portrait orientation.

Lock the Helpshift SDK window to landscape/portrait mode :

Use one of the following solutions to lock the Helpshift SDK window to landscape/portrait mode, irrespective of the app's orientation.

Using screenOrientation config:

You can programmatically set the orientation for the Helpshift SDK using the screenOrientation install configuration, documented here. This config takes precedence over the orientation set in AndroidManifest.xml.