Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediate message load in room #332

Merged
merged 7 commits into from May 3, 2019
Merged

Immediate message load in room #332

merged 7 commits into from May 3, 2019

Conversation

RobotJINI
Copy link

@RobotJINI RobotJINI commented Apr 29, 2019

@RocketChat/android

Closes #ISSUE_NUMBER
#321
https://forums.rocket.chat/t/android-preload-chats-and-show-them-instantly/2628
https://open.rocket.chat/channel/immediate_message_load_in_room

Changes: [Add here what changes were made in this issue and if possible provide links.]

Changed the loading of moderator roles until after the room loads up so it does not block the loading of the ui. There isn't actually anything that uses the moderator roles right now, so i am leaving it to the implementer of that on how to best handle the delayed information. I wanted to make sure the functionality was the same after the changes though rather than just deleting it.

Update 4/30/2019:
Fixed two more issues: …

  1. recycler_view was adding its adapter in showMessages this was causing the error: "E/RecyclerView: No adapter attached; skipping layout"
    This seems to be the cause of a missed update step and ui delay. Code to add adapter was added to setupRecyclerView, which is called in the onViewCreated function.

  2. loadActiveMembers function was being called from ChatRoomFragment object and the network / data access was being done in the UI thread. Moved the function call from the end of the function loadMessages to just after the end of said function.
    Changed the function loadActiveMembers to do most of its work in an I.O. thread and just the view updating in a UI thread.

Screenshots or GIF for the change:

roomLoadDemo

@RobotJINI RobotJINI self-assigned this Apr 29, 2019
…creator of the moderator page should figure out how to best handle the update so that the UI is not loaded twice.
1. recycler_view was adding its adapter in showMessages this was causing the error: "E/RecyclerView: No adapter attached; skipping layout"
This seems to be the cause of a missed update step and ui delay.  Code to add adapter was added to setupRecyclerView, which is called in the onViewCreated function.

2. loadActiveMembers function was being called from ChatRoomFragment object and the network / data access was being done in the UI thread.  Moved the function call from the end of the function loadMessages to just after the end of said function.
Changed the function loadActiveMembers to do most of its work in an I.O. thread and just the view updating in a UI thread.
@jaytat0 jaytat0 merged commit dc6e47d into veranda May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants