Add typing indicator support in ChatView#51
Open
subhan9090 wants to merge 8 commits intotimigod:masterfrom
Open
Add typing indicator support in ChatView#51subhan9090 wants to merge 8 commits intotimigod:masterfrom
subhan9090 wants to merge 8 commits intotimigod:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for displaying a typing indicator in the ChatView when other users are typing. Key changes include:
Changes made:
ChatViewListAdapter
Added TYPING message type support.
Implemented addTypingIndicator(String sender) and removeTypingIndicator(String sender) methods for safely adding/removing typing indicators.
Ensured all list modifications and notifyDataSetChanged() calls occur on the UI thread using ListView.post().
Fixed getViewTypeCount() to return 3 (SENT, RECEIVED, TYPING), preventing ArrayIndexOutOfBoundsException.
ChatView
Added showTypingIndicator(String sender) and hideTypingIndicator(String sender) methods as a clean interface to manage typing indicators.
Supports multiple users typing concurrently without crashing.
Maintains existing message functionality intact.
Benefits:
Typing indicators now appear and disappear safely for each sender.
Fully compatible with existing messages.
Eliminates ArrayIndexOutOfBoundsException caused by incorrect view type count.
Usage:
chatView.showTypingIndicator("Alice");
chatView.hideTypingIndicator("Alice");