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

Added loading of items when the view can't be scrolled #7638

Closed

Conversation

AbduAmeen
Copy link

@AbduAmeen AbduAmeen commented Jan 9, 2022

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Added loading of items when scrolling isn't possible for classes implementing BaseListFragment class.

Before/After Screenshots/Screen Record

Fixes the following issue(s)

Relies on the following changes

APK testing

Comment:

Due diligence

@AudricV AudricV added bug Issue is related to a bug GUI Issue is related to the graphical user interface multiservice Issues related to multiple services labels Jan 9, 2022
…agment.java

Co-authored-by: Mohammed Anas <triallax@tutanota.com>
@woheller69 woheller69 mentioned this pull request Jan 11, 2022
4 tasks
@sonarcloud
Copy link

sonarcloud bot commented Jan 13, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR 😄

It seems to work but:

  • this seems to work just by sheer luck:
    grafik
    I don't know who designed an API that calls onScrolled when no scroll event occurs...
  • This will be called whenever a scroll occurs - that can be quite resource intensitive

Let's have a look at the problem:
So there is not enough data initially loaded.

Then I think we should load enough data initially:

  • initially load the data
  • if there is more data loadable and the view is not scrollable → load more data
  • repeat above if needed

I will try to create a PR for my mentioned resolution this week.

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but I have to block the PR:
Tested the PR again - on a tablet and with grid mode - and the search crashes in >60% of all cases:

NP7638NW.gif.mp4

PS: I'm still working on the PR but I run into some unexpected errors when using RecyclerView which might be related to #4475

litetex added a commit to litetex/NewPipe that referenced this pull request Jan 16, 2022
The previous/reverted behavior caused unwanted data transmission:
* Removed loading via handleResults/loadMoreItems-callback because the RecyclerView is apparently not immediately updated in the UI when the data is set which causes one load of data to much.
@litetex
Copy link
Member

litetex commented Jan 16, 2022

Superseded by #7659

Anyway thank you for the work 😄

@litetex litetex closed this Jan 16, 2022
litetex added a commit to litetex/NewPipe that referenced this pull request Jan 16, 2022
The previous/reverted behavior caused unwanted data transmission:
* Removed loading via handleResults/loadMoreItems-callback because the RecyclerView is apparently not immediately updated in the UI when the data is set which causes one load of data to much.
litetex added a commit to litetex/NewPipe that referenced this pull request Jan 24, 2022
The previous/reverted behavior caused unwanted data transmission:
* Removed loading via handleResults/loadMoreItems-callback because the RecyclerView is apparently not immediately updated in the UI when the data is set which causes one load of data to much.
@AbduAmeen AbduAmeen deleted the fix_list_loading_for_small_pages branch February 1, 2022 03:31
litetex added a commit to litetex/NewPipe that referenced this pull request Feb 17, 2022
The previous/reverted behavior caused unwanted data transmission:
* Removed loading via handleResults/loadMoreItems-callback because the RecyclerView is apparently not immediately updated in the UI when the data is set which causes one load of data to much.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug GUI Issue is related to the graphical user interface multiservice Issues related to multiple services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loading in lists when streams aren't filling the screen
4 participants