---
schema_version: "1"
id: 1ce5fd9f32abaee865bc84e7a5c5155ef73cb2a2321ae32b1f5ed0bc252098ab
title: Create an Interface Object
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-in-app/guides/android-create-interface-object.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-create-interface-object.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1db8590aa6db0bed4b492c822adee872bd1a5eb5b6972bd99be649eef3dc3afb
products:
  - Enhanced In-App Chat
  - Service Cloud Developer Content
---
# Create an Interface Object

Create an object that inherits from the [`ViewComponent`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/ui/com.salesforce.android.smi.ui/-view-components/index.html) interface. Pass this to the UI client to define how to treat each [`ChatFeedEntry`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/ui/com.salesforce.android.smi.ui/-chat-feed-entry/index.html) type using the `EntryRenderMode`.

```
val entryRenderMode: ((entry: ChatFeedEntry) -> EntryRenderMode) = { entry ->
   when (entry.contentType) {
// Display participant changed events using the existing UI
       ConversationEntryType.ParticipantChanged.name -> EntryRenderMode.Existing
	// Replace the UI for any Message type entry with the UI you provide
       ConversationEntryType.Message.name -> EntryRenderMode.None
	// Ignore RoutingWorkResult type entries
       ConversationEntryType.RoutingWorkResult.name -> EntryRenderMode.Ignore
       else -> EntryRenderMode.Existing
   }
}
uiClient.viewComponents = object : ViewComponents {
   @Composable
   override fun ChatFeedEntry(entry: ChatFeedEntry, content: @Composable () -> Unit) {
       when (entryRenderMode(entry)) {
           EntryRenderMode.None -> Unit
// Display default content
           EntryRenderMode.Existing -> content()
           EntryRenderMode.Replace -> ReplacementEntry(entry, uiClient.conversationClient(appContext))
       }
   }
}
```

**note:** All entries of a type are affected by the EntryRenderMode you set for that type. Use this feature with caution! For example, if you choose to hide `RoutingWorkResult` entries, it affects transfer events and estimated wait time.
