---
schema_version: "1"
id: 185164c054460c831ff1ca2175a12be40c794b415e36c7105b0181117416adfe
title: Hide or Replace Messages in a Chat Feed
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-in-app/guides/android-hide-replace-entries.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-hide-replace-entries.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8bc046e48121bd3d33fcdc2dd333d2c743e67cb1c6989ea7bbb9bf44e5c74859
products:
  - Enhanced In-App Chat
  - Service Cloud Developer Content
---
# Hide or Replace Messages in a Chat Feed

Configure how each individual message in a chat feed is rendered in the Chat UI using custom logic and by extending the OverridableUI class.

Configure the `renderMode` function with your custom logic. This function is invoked per message to determine its UI representation, which can be hidden, default, or custom.

Using the sample code, set the `EntryRenderMode` enum value for each ChatFeedEntry of the ViewComponents interface.

- To hide a chat message, have your `renderMode` function return `EntryRenderMode.None` for that specific entry.
- To use the default built-in UI to display chat entries, set `EntryRenderMode.Existing`.
- To use a customized UI to display chat entries using the composable CustomEntryContainer, set `EntryRenderMode.Replace`.

```
open class OverridableUI {
  open fun renderMode(entry: ChatFeedEntry): EntryRenderMode = EntryRenderMode.Existing
  inner class CustomViewComponents(private val conversationClient: ConversationClient) : ViewComponents {
    @Composable
    override fun ChatFeedEntry(entry: ChatFeedEntry, content: @Composable () -> Unit) {
      when (renderMode(entry)) {
        EntryRenderMode.None -> Unit
        EntryRenderMode.Existing -> content()
        EntryRenderMode.Replace -> CustomEntryContainer(entry, conversationClient)
      }
    }
  }
}
```

**note:** You must provide replacements for the entries that you replace. See the [​Sample Code for Defining Your Own UI for the Text Message Entry Type](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-define-ui.md#sample-code-for-defining-your-own-ui-for-the-text-message-entry-type) and [Sample Code for Defining Your Own UI for the Choices message Entry Type​](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-define-ui.md#sample-code-for-defining-your-own-ui-for-the-choices-message-entry-type) sections for examples.
