kiwix / kiwix-android

Kiwix for Android
https://android.kiwix.org
GNU General Public License v3.0
861 stars 443 forks source link

Save the back stack of visited pages before exiting from app #398

Open RohanBh opened 6 years ago

RohanBh commented 6 years ago

Currently, the back stack of pages is lost when the app is restarted. Chrome on Android remembers the order of visited pages if same happens to it. This must be the expected behavior.

Would you like to work on it? Yes

mhutti1 commented 6 years ago

Sounds good I would cap it at a certain distance though. Try playing around and working out what might be best.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

kelson42 commented 3 years ago

Per default it shoudl open with the same tabs (and not the library), but this behaviour should be driven by a new settings: "remember open tabs when existing"

EDIT: forget this comment

gouri-panda commented 3 years ago

"remember open tabs when existing"

@kelson42 Isn't this ticket about remembering the back stack of pages?

s-ayush2903 commented 3 years ago

Why does it sound like dupe of https://github.com/kiwix/kiwix-android/issues/2582 or vice-versa

kelson42 commented 3 years ago

@s-ayush2903 Indeed! Closing

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

rishujam commented 1 year ago

Currently, we are using the inbuilt functions of webview for going forward and backwards. So in order to maintain a backstack we have to make our own manager which saves the pages while moving to the next pages right? Or do we have to do it any other way?

kelson42 commented 1 year ago

@rishujam Assuming #3042, the we should just have an import/export feature tomRoom DB (we should wait that new Room DAO to be merged).

Saifuddin53 commented 2 weeks ago

@Kelson, I need some clarifications to get started on this issue.

Should the solution only focus on saving and restoring the in-article back/forward navigation history, or is the goal to preserve both, the history of visited articles and the internal navigation?

Currently, the forward and backward navigation history within an article relies on WebView history ( #3042 ), which is lost when the app restarts. Should the plan be to store this unified list of visited articles/pages in the Room database to ensure persistence across sessions?

kelson42 commented 2 weeks ago

At this stage this is only about saving/restoring the navigation history. But restoring tabs will come next, so you should save the history for each tab separatly. Yes, Room should be used for that.

kelson42 commented 1 week ago

@Saifuddin53 Requirements all all clear to you? Have you been able to make progresses?

Saifuddin53 commented 1 week ago

Yes @kelson42 all clear and have started working on it.

MohitMaliFtechiz commented 4 days ago

@Saifuddin53 Any update on this? if you need any help on this then let me know.

Saifuddin53 commented 4 days ago

@MohitMaliFtechiz Sir, I am going to store the WebBackForwardList in Room, and then when the reader is opened, I will split it into back and forward lists. After that, I'll restore the web history based on these lists. Let me know if this approach sounds good or if there's anything you'd suggest!

MohitMaliFtechiz commented 4 days ago

Are you saving the WebBackForwardList in the room database on every page load? Please make sure to store the latest history in the database. Once your work is done open a PR so that we can review your work.

Saifuddin53 commented 4 days ago

Are you saving the WebBackForwardList in the room database on every page load?

I will store the WebBackForwardList in the Room database when the reader fragment's onPause() is called, and on onResume(), I will retrieve the list and restore the history. And once it's done, I'll open a PR for review.