Fix alignment changes resetting reader article position #190

Merged
AmineB merged 2 commits from davidoskky/ReaderForSelfoss-multiplatform:alignment into master 2025-03-16 13:14:47 +00:00
Contributor

Types of changes

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This is NOT translation related.

This closes issue #179

Text alignment was resetting the position in the article list of the reader because we were restarting the reader activity to reinitialize all fragments. Rather than do that, now we tell all the fragments to update their text alignment.
I cleaned up a little bit the Reader activity as some functions were really confusing. I kept all that in a separate commit in case you wish to revert.

Tested in simulated API versions 25, 34 and 35. All tests pass.

I'll point out: after #84 I'm now getting a bunch of messages appearing about connectivity coming and going. Often when opening the home I have to force it to load articles as none will appear. I'm not opening an issue just because I did not install it on physical device yet and I just experienced this in the emulator.

## Types of changes - [x] I have read the **CONTRIBUTING** document. - [x] My code follows the code style of this project. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [x] All new and existing tests passed. - [x] This is **NOT** translation related. This closes issue #179 Text alignment was resetting the position in the article list of the reader because we were restarting the reader activity to reinitialize all fragments. Rather than do that, now we tell all the fragments to update their text alignment. I cleaned up a little bit the Reader activity as some functions were really confusing. I kept all that in a separate commit in case you wish to revert. Tested in simulated API versions 25, 34 and 35. All tests pass. I'll point out: after #84 I'm now getting a bunch of messages appearing about connectivity coming and going. Often when opening the home I have to force it to load articles as none will appear. I'm not opening an issue just because I did not install it on physical device yet and I just experienced this in the emulator.
davidoskky added 2 commits 2025-03-11 16:20:20 +00:00
When changing alignment in the reader we were restarting the reader activity to reload. Doing this led to reloading the article which was initially opened every time you changed alignment. Now, when changing the alignment we retain all existing fragments but command all of them to update their alignment setting.
Refactor star icon handling
Some checks failed
Check PR code / Lint (pull_request) Successful in 2m50s
Check PR code / translations (pull_request) Failing after 29s
Check PR code / build (pull_request) Successful in 9m27s
4a55bc0f1d
Extracted all favorite handling to two functions. Makes it a little bit more readable.
Owner

Thanks for the heads-up. I may have fixed the issue here

Thanks for the heads-up. I may have fixed the issue [here](https://gitea.amine-bouabdallaoui.fr/Louvorg/ReaderForSelfoss-multiplatform/pulls/192)
Author
Contributor

Build is failing for some api token misconfiguration.

Build is failing for some api token misconfiguration.
Owner

Could you try rebasing your PR ?

Could you try rebasing your PR ?
davidoskky force-pushed alignment from 4a55bc0f1d to c3ee07dd85 2025-03-13 18:42:24 +00:00 Compare
Owner

Just tried it. It seems to be working fine.

Just tried it. It seems to be working fine.
AmineB merged commit ceba58e98f into master 2025-03-16 13:14:47 +00:00
AmineB deleted branch alignment 2025-03-16 13:14:47 +00:00
Sign in to join this conversation.
No description provided.