---
schema_version: "1"
id: 17e03b3c00c6ab7d3475fee964b289922eb8be7cdbf4ff613adb5d6bf66ed5be
title: Define Your UI For Each Entry Type
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-in-app/guides/android-define-ui.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-define-ui.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a8e011cbf395e68e293eb7d4e26d7d39d4e3f56287a7ea7056b7f8847a68a22b
products:
  - Enhanced In-App Chat
  - Service Cloud Developer Content
---
# Define Your UI For Each Entry Type

Define your UI for each entry type you replaced in the [Hide or Replace Messages in a Chat Feed](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-hide-replace-entries.md#replace-all-entries-of-a-certain-type) section.

## Sample Code for Defining Your Own UI for the Text Message Entry Type

```
@Composable
internal fun TextMessageReplacementEntry(
   isLocal: Boolean,
   text: String?
) {
   val shape = RoundedCornerShape(16)
   ReplacementMessageContainer(isLocal = isLocal) {
       Card(
           modifier = Modifier
               .wrapContentSize()
               .border(shape = shape, width = 1.dp, color = Color.Green),
           shape = shape
       ) {
           Box(
               contentAlignment = Alignment.Center,
               modifier = Modifier
                   .wrapContentSize(),
           ) {
               Text(
                   text = text ?: "",
                   color = Color.Green,
                   modifier = Modifier.padding(horizontal = 30.dp, vertical = 10.dp),
               )
           }
       }
   }
}
```

## Sample Code for Defining Your Own UI for the Choices Message Entry Type

```
@Composable
internal fun DisplayableOptionsReplacementEntry(
   title: String,
   optionItems: List<OptionItem.TypedOptionItem.TitleOptionItem>,
   onSelection: ((OptionItem) -> Unit)
) {
   val shape = RoundedCornerShape(16)
   Card(
       modifier = Modifier
           .wrapContentSize()
           .border(shape = shape, width = 1.dp, color = Color.Green),
       shape = shape
   ) {
       Text(
           modifier = Modifier.fillMaxWidth().padding(16.dp),
           text = title, color = Color.Green
       )
       optionItems.forEach {
           TextButton(
               modifier = Modifier.fillMaxWidth().border(1.dp, Color.Green, shape), onClick = {
                   onSelection(OptionItem.SelectionsOptionItem(it.optionId))
               }
           ) {
               Text(text = (it.titleItem.title), color = Color.Green)
           }
       }
   }
}
```

In the [Replace All Entries](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-hide-replace-entries.md#replace-all-entries-of-a-certain-type) section, ‌this code snippet intercepts the reply and sends it by using the `ConversationClient`.

```
CoroutineScope(Dispatchers.Main).launch {
   conversationClient?.sendReply(it)
}
```

In the sample code for defining your own UI for the choices message entry type above, this code snippet defines the click handler for the intercepted reply.

```
onClick = {
   onSelection(OptionItem.SelectionsOptionItem(it.optionId))
}
```
