Skip to main content
Version: v6


Many aspects of the UI components can be changed and customized. For example, it's possible to change:

  • Font family
  • Text color
  • Background of views
  • Item views in lists
  • Enable and disable features
  • Text style (italic, bold, normal)
  • Drawable of icons
  • Stroke widths
  • Divider color

It is not possible to change the tint of icons. Use colored drawables instead.

These customizations can be applied in multiple ways. From simplest to most complex, these are:

  • Adding attributes to the View in the XML layout where it's created.
  • Using the TransformStyle object to apply transformations to all style objects of a given type.
  • Using themes to style all Views globally.

Be careful when using multiple theming approaches. Themes are applied first, then XML attributes, then style transformations. Values applied later will override previously set values.

XML Attributes

The simplest way to customize Views is by setting attributes on them in the XML layout. For example, here are some custom values you can set on MessageListView.

app:streamUiMessageTextColorTheirs="@android:color/white" />

This will have the following result:

Custom messages

You can find the full list of available attributes for each view linked on their individual component pages, or in the attrs_view_name files here.

Style Transformations

Styles can be configured programmatically by overriding the corresponding StyleTransformer from the TransformStyle object. These transformations will be applied to all UI Components of the given type.


You have to set up any custom StyleTransformer instances before the View instances are initialized, otherwise they won't take effect.

Here's an example using TransformStyle to change multiple appearance characteristics of all MessageListView instances:

TransformStyle.messageListItemStyleTransformer = StyleTransformer { defaultViewStyle ->
messageBackgroundColorMine = Color.parseColor("#0277BD"),
messageBackgroundColorTheirs = Color.parseColor("#2E7D32"),
textStyleMine = defaultViewStyle.textStyleMine.copy(color = Color.WHITE),
textStyleTheirs = defaultViewStyle.textStyleTheirs.copy(color = Color.WHITE),

This will have the following result:

Custom messages

This is the same as the XML customization shown above, but applied to all MessageListView instances in the app, and configured programmatically.


You can also use Android themes to set attributes for the UI Components. To do this, set a streamUiTheme attribute within your app's theme, in the themes.xml file:

<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Other items... -->
<item name="streamUiTheme">@style/CustomStreamUiTheme</item>

The theme you pass in as the streamUiTheme can then define a style for each type of UI Component where you can set attribute values.

For example, you can achieve the same styling like in the examples above by overriding the streamUiMessageListStyle attribute:

<style name="CustomStreamUiTheme" parent="@style/StreamUiTheme">
<item name="streamUiMessageListStyle">@style/CustomMessageListStyle</item>

<style name="CustomMessageListStyle" parent="StreamUi.MessageList">
<item name="streamUiMessageBackgroundColorMine">#0277BD</item>
<item name="streamUiMessageBackgroundColorTheirs">#2E7D32</item>
<item name="streamUiMessageTextColorMine">@android:color/white</item>
<item name="streamUiMessageTextColorTheirs">@android:color/white</item>

The list of available styles you can define here is available here in our attrs file.

Themes for Activities

SDK contains the following activities: AttachmentMediaActivity, AttachmentActivity and AttachmentGalleryActivity. You can customize them by overriding the activity with a custom theme in your manifest.

Let's see how to change the color of the title on the gallery screen:


tools:replace="android:theme" />


<style name="CustomAttachmentGalleryTheme" parent="StreamUi.AttachmentGallery">
<item name="streamUiTheme">@style/CustomStreamUiTheme</item>

<style name="CustomStreamUiTheme" parent="@style/StreamUiTheme">
<item name="streamUiAttachmentGalleryTitleStyle">@style/CustomAttachmentGalleryTitleStyle</item>

<style name="CustomAttachmentGalleryTitleStyle">
<item name="android:textAppearance">@style/CustomAttachmentGalleryTitleTextAppearance</item>

<style name="CustomAttachmentGalleryTitleTextAppearance" parent="StreamUiTextAppearance.HeadlineBold">
<item name="android:textColor">#FF0000</item>

This will produce the UI below:

Custom activity theme

Choose Light/Dark Theme

Our SDK already provides a DayNight theme. If you want to force Dark or Light mode, you need to follow the default Android mechanism to use it:

// Force Dark theme

// Force Light theme

Did you find this page helpful?