How can I change the background color of the chat ui


#1

How can I change the background color of the chat ui? I’m using the Skygear Chat Android UIKit


#2

Currently you can only change the background color of the whole screen, which means also the chat list and the input field. See below:

To achieve this, you need to add a custom layout file with the content below. Update the android:background to the color you want:

<?xml version="1.0" encoding="utf-8"?>
<io.skygear.plugins.chat.ui.ConversationView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:uikit="http://schemas.android.com/apk/res-auto"
    android:background="@color/blue_1"
    />

Then, use the custom layout when opening the ConversationActivity.

Intent i = new Intent(context, ConversationActivity.class);
i.putExtra(ConversationActivity.ConversationIntentKey, c.toJson().toString());	
i.putExtra(ConversationActivity.LayoutIntentKey, R.layout.custom_conversation_view); // using custom layout
context.startActivity(i);

hope it helps!