Skip to content
Snippets Groups Projects
Commit 9e932321 authored by maniac103's avatar maniac103 Committed by mueller-ma
Browse files

Fix image refresh regressions (#987)


* Re-bind all widgets after pull-to-refresh.

When not doing so, image views won't reload the respective images.

Signed-off-by: default avatarDanny Baumann <dannybaumann@web.de>

* Discard last image request when detaching view.

Doing so is important in two scenarios:
- View is detached, then reattached and bound to the same URL with refresh
  In that case, the refresh was canceled in onDetachedFromWindow(), but
  never resumed as the setImageUrl() call would break out early due to
  old and new URL matching
- Widget list is refreshed
  In that case, views are detached and reattached, but due to the URLs
  being the same the load of the new image was never actually done.

Signed-off-by: default avatarDanny Baumann <dannybaumann@web.de>

* Next take on fixing image refresh.

Don't clear out last request when detaching view, so we can reuse it
after reattaching for resuming the refresh ... and start actually doing
the resume. Also make sure to create a request for the same purpose if
the image view was freshly created and the initial load request could be
satisfied from the cache.

Signed-off-by: default avatarDanny Baumann <dannybaumann@web.de>

* Fix image load 'has completed' logic.

The load is considered completed when there is *no* pending call around.
Also stop clearing out the call when canceling, as otherwise
hasCompleted() is always going to return true when reattaching views.

Signed-off-by: default avatarDanny Baumann <dannybaumann@web.de>
parent 859bdca7
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment