Kotlin Chat Tutorial: The Clean Way
A Roadmap for building customizable android chat app using Kotlin
Published in
4 min readNov 10, 2019
Chat is one of the most wanted features to include in any mobile apps, It varies from simple one-on-one chat to AI Bot. It’s an open market that still didn’t get saturated yet.
Here a Quick Points will be cover in this tutorial.
- Chat Speech Bubbles
- Different Layout items
- Create DataUIModel that hold all the UI attributes
- Create Multiple Item ViewHolder
- Build Multiple Item Type Adapter
- Create The ViewModel “From Android Jetpack”
- How To use LiveData“From Android Jetpack” to update the adapter
Create the Speech Bubble Drawables
In the Basic Chat application, there are two types of user lets call them, for now, MY & Friend.
One of the best practices of chat UI that My Chat Bubble “MY” background color will match the app primary color.