-
- Downloads
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:Danny 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:
Danny 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:
Danny 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:
Danny Baumann <dannybaumann@web.de>
Showing
- mobile/src/main/java/org/openhab/habdroid/ui/OpenHABWidgetAdapter.java 2 additions, 2 deletions...in/java/org/openhab/habdroid/ui/OpenHABWidgetAdapter.java
- mobile/src/main/java/org/openhab/habdroid/ui/OpenHABWidgetListFragment.java 1 addition, 1 deletion...va/org/openhab/habdroid/ui/OpenHABWidgetListFragment.java
- mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.java 19 additions, 15 deletions.../java/org/openhab/habdroid/ui/widget/WidgetImageView.java
Loading
Please register or sign in to comment