OSDN Git Service

Fix filmstrip item bounds to filmstrip scale
authorAlan Newberger <alann@google.com>
Sun, 21 Sep 2014 23:11:29 +0000 (16:11 -0700)
committerAlan Newberger <alann@google.com>
Sun, 21 Sep 2014 23:11:29 +0000 (16:11 -0700)
There's no reason to scale filmstrip items to anything other
than the fixed filmstrip scale, and doing otherwise interferes
with Glide caching and introduces flickers upon zoom.

Bug: 17597708
Change-Id: Ia143b4d95a48e9e23bbf36ec0edf93599caaa01b

src/com/android/camera/widget/FilmstripView.java

index 371dcdb..5774ab3 100644 (file)
@@ -797,8 +797,12 @@ public class FilmstripView extends ViewGroup {
             return null;
         }
 
-        int width = Math.round(mScale * getWidth());
-        int height = Math.round(mScale * getHeight());
+        // Always scale by fixed filmstrip scale, since we only show items when
+        // in filmstrip. Preloading images with a different scale and bounds
+        // interferes with caching.
+        int width = Math.round(FILM_STRIP_SCALE * getWidth());
+        int height = Math.round(FILM_STRIP_SCALE * getHeight());
+        Log.v(TAG, "suggesting item bounds: " + width + "x" + height);
         mDataAdapter.suggestViewSizeBound(width, height);
 
         data.prepare();