aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorDavid Morrissey <davemorrissey@gmail.com>2017-11-27 12:06:02 +0000
committerDavid Morrissey <davemorrissey@gmail.com>2017-11-27 12:06:02 +0000
commit01bc717f4e5b4b7c12127a860e1012e86438c223 (patch)
treec9537a688bc66bc7a8643799f628a8f3e1a385c5 /library
parentfc6b632786293b086ed3192b058717d0dfb48342 (diff)
downloadsubsampling-scale-image-view-01bc717f4e5b4b7c12127a860e1012e86438c223.tar.gz
Eager tile loading enabled by default
Diffstat (limited to 'library')
-rw-r--r--library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java b/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java
index 073a069..f4e880b 100644
--- a/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java
+++ b/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java
@@ -178,7 +178,7 @@ public class SubsamplingScaleImageView extends View {
private Executor executor = AsyncTask.THREAD_POOL_EXECUTOR;
// Whether tiles should be loaded while gestures and animations are still in progress
- private boolean eagerLoadingEnabled = false;
+ private boolean eagerLoadingEnabled = true;
// Gesture detection settings
private boolean panEnabled = true;
@@ -2797,11 +2797,12 @@ public class SubsamplingScaleImageView extends View {
/**
* Enable or disable eager loading of tiles that appear on screen during gestures or animations,
- * while the gesture or animation is still in progress. By default this is off; the view will
- * wait until the image is not panning or zooming before loading the tiles then required.
- * Enabling it will increase CPU and memory usage and result in the loading of tiles during a
- * gesture that are immediately discarded later, causing low frame rates on slower devices.
- * @param eagerLoadingEnabled true to enable loading during gestures
+ * while the gesture or animation is still in progress. By default this is enabled to improve
+ * responsiveness, but it can result in tiles being loaded and discarded more rapidly than
+ * necessary and reduce the animation frame rate on old/cheap devices. Disable this on older
+ * devices if you see poor performance. Tiles will then be loaded only when gestures and animations
+ * are completed.
+ * @param eagerLoadingEnabled true to enable loading during gestures, false to delay loading until gestures end
*/
public void setEagerLoadingEnabled(boolean eagerLoadingEnabled) {
this.eagerLoadingEnabled = eagerLoadingEnabled;