Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There were a couple of issues causing the blinking on the home screen and on the season browser.
I haven't checked other screens yet, but my investigation told me that the DiffUtils/DiffCallback didn't seem to be working as expected.
For this I instead manually do a check before setting the items to see if there is a difference. Now it will only blink once when the content for the row is changing.
There was another issue with the way the coroutines were set up. They were being scheduled on start, every time the screen restarted. The schedule job was not being cancelled as the scope that it was being created is is only cancelled in onDestroy(), ending up with multiple instances of the refresh happening. If you went back and forth a few times you would see the refresh happening more and more frequently. Not a huge issue, but during my testing I set the refresh to every 10 seconds and I could consistently make the data refetch every couple of seconds by entering and exiting the season browser screen a few times. So I am manually cancelling the scheduled job in onStop on both the home screen and the season browser. This reduced the frequency of the blinking, even before resolving the blinking itself.
This should resolve issue #89
One other thing I changed was to only request the data for legacy seasons once, rather than every minute. I'm working on the basis that the older seasons won't have any content updates