WhatsApp Clone — Jetpack Compose — Search

Pradyot Prakash
2 min readAug 31, 2021

--

For current user to connect with any other user from our DB, we have to give them an option. For that we will be using Search which will show all the users currently in our DB.

For now this is a simple list with all the users in our DB. SearchView is the composable which renders the above UI.

In FirestoreUtility, we have already our allUsers method which listens to the user list.

Users listener

And in the SearchViewModel, we are updating the UI as the list are fetched from the Firestore.

Update user list

This way we show all the users on the search page. Search functionlity is not yet implemented. When it’s done the article will be updated. The current user can select any user from the list and start chatting. For this let’s move to our next article WhatsApp Clone — Jetpack Compose — Chat.

--

--