Suggestion List View

LAST EDIT Feb 19 2021

SuggestionListView is a view which cooperates with MessageInputView and displays available commands and mentions.

SuggestionListView in light mode

SuggestionListView, like our other components, supports dark mode:

SuggestionListView in dark mode

Connecting with MessageInputViewCopied!

In order to display available commands and mentions, SuggestionListView needs to be added to layout together with MessageInputView Here you can find an example layout:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="utf-8"?> 
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    > 
 
    <io.getstream.chat.android.ui.suggestion.list.SuggestionListView 
        android:id="@+id/suggestionListView" 
        android:layout_width="0dp" 
        android:layout_height="wrap_content" 
        app:layout_constraintBottom_toTopOf="@id/messageInputView" 
        app:layout_constraintEnd_toEndOf="parent" 
        app:layout_constraintStart_toStartOf="parent" 
        /> 
 
    <io.getstream.chat.android.ui.message.input.MessageInputView 
        android:id="@+id/messageInputView" 
        android:layout_width="0dp" 
        android:layout_height="wrap_content" 
        app:layout_constraintBottom_toBottomOf="parent" 
        app:layout_constraintEnd_toEndOf="parent" 
        app:layout_constraintStart_toStartOf="parent" 
        /> 
 
</androidx.constraintlayout.widget.ConstraintLayout>

Besides that, you need to pass SuggestionListView to MessageInputView:

1
messageInputView.setSuggestionListView(suggestionListView)
1
messageInputView.setSuggestionListView(suggestionListView);

From that point, you will be able to see either available commands (by clicking on the light button or typing /) and available mentions (by typing @).