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

[WIP] changed view conversation to jump to location #3612

Closed
wants to merge 1 commit into from

Conversation

anjandev
Copy link

My attempt at #3101

This patch works if the message the user selects from the search activity is one of the messages that are loaded when user first taps the conversation from homescreen.

I need help with loading older messages while getIndexOf(uuid, this.messageList) < 0 in processExtras(Bundle extras). I have tried calling moveToMsg(0) with the hopes that the onScroll() function that loads more messages when user scrolls to top gets called, Unfortunately, this didnt work....
I cannot think of another fix please help.

I also did some refactoring (moving things to functions) so that I could re-use as much code as possible.

@iNPUTmice
Copy link
Owner

Thank you.

I’m afraid that this can’t be done. (Otherwise it would most likely have been implemented already.) There is currently no paging implemented. Meaning if you scroll up; bit after bit; the entire message history is loaded into memory. This only kinda works out because usually users are too lazy to scroll up far enough to run out of memory. But attempts to 'automatically scroll up' to load messages from a few years ago will always fail.
To fix this proper paging will have to be implemented (only loading a few messages into memory); that in turn is currently blocked by other operations throughout the app happening on in-memory structures instead of on the database. Therefor we need to completely refactor the app to make this work.

@licaon-kter
Copy link

licaon-kter commented Jan 11, 2020

Can you at least provide some messages?

Eg. Have a "Show in context" feature that opens a view with 5 messages before this one and 5 after (so no memory overload), and a button to "open chat for more".

5-10 whatever is manageble.

@knoy
Copy link

knoy commented Jan 28, 2020

I’m afraid that this can’t be done.

This seems unreasonable when many old messages can be searched and viewed without any performance overhead.

The user doesn't need to see EVERY message in the conversation from the present until when the message was sent, just messages around the time it was sent.

@iNPUTmice
Copy link
Owner

This is not going to be a comment on the desired effect. (No question on that front) but any naive approach like this is not going to work. The only viable option is to refactor Conversations to AndroidX, Jetpack, Room and the PagingAdapter.

@iNPUTmice iNPUTmice closed this Feb 29, 2020
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

4 participants