Loading src/com/android/gallery3d/ui/AlbumSetSlidingWindow.java +0 −3 Original line number Diff line number Diff line Loading @@ -165,9 +165,6 @@ public class AlbumSetSlidingWindow implements AlbumSetView.ModelListener { mActiveStart = start; mActiveEnd = end; // If no data is visible, keep the cache content if (start == end) return; int contentStart = Utils.clamp((start + end) / 2 - data.length / 2, 0, Math.max(0, mSize - data.length)); int contentEnd = Math.min(contentStart + data.length, mSize); Loading src/com/android/gallery3d/ui/AlbumSetView.java +9 −2 Original line number Diff line number Diff line Loading @@ -206,8 +206,15 @@ public class AlbumSetView extends SlotView { private class MyCacheListener implements AlbumSetSlidingWindow.Listener { public void onSizeChanged(int size) { if (setSlotCount(size)) { // If the layout parameters are changed, we need reput all items. if (setSlotCount(size)) updateVisibleRange(0, 0); // We keep the visible range at the same center but with size 0. // So that we can: // 1.) flush all visible items // 2.) keep the cached data int center = (getVisibleStart() + getVisibleEnd()) / 2; updateVisibleRange(center, center); } updateVisibleRange(getVisibleStart(), getVisibleEnd()); invalidate(); } Loading src/com/android/gallery3d/ui/AlbumSlidingWindow.java +3 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.gallery3d.ui; import android.graphics.Bitmap; import android.os.Message; import com.android.gallery3d.app.GalleryActivity; import com.android.gallery3d.common.BitmapUtils; import com.android.gallery3d.common.LruCache; Loading @@ -29,10 +32,6 @@ import com.android.gallery3d.util.JobLimiter; import com.android.gallery3d.util.ThreadPool.Job; import com.android.gallery3d.util.ThreadPool.JobContext; import android.graphics.Bitmap; import android.graphics.Color; import android.os.Message; public class AlbumSlidingWindow implements AlbumView.ModelListener { @SuppressWarnings("unused") private static final String TAG = "AlbumSlidingWindow"; Loading Loading @@ -178,9 +177,6 @@ public class AlbumSlidingWindow implements AlbumView.ModelListener { mActiveStart = start; mActiveEnd = end; // If no data is visible, keep the cache content if (start == end) return; int contentStart = Utils.clamp((start + end) / 2 - data.length / 2, 0, Math.max(0, mSize - data.length)); int contentEnd = Math.min(contentStart + data.length, mSize); Loading src/com/android/gallery3d/ui/AlbumView.java +11 −4 Original line number Diff line number Diff line Loading @@ -16,12 +16,12 @@ package com.android.gallery3d.ui; import android.graphics.Rect; import com.android.gallery3d.app.GalleryActivity; import com.android.gallery3d.data.MediaItem; import com.android.gallery3d.ui.PositionRepository.Position; import android.graphics.Rect; public class AlbumView extends SlotView { @SuppressWarnings("unused") private static final String TAG = "AlbumView"; Loading Loading @@ -163,8 +163,15 @@ public class AlbumView extends SlotView { } public void onSizeChanged(int size) { if (setSlotCount(size)) { // If the layout parameters are changed, we need reput all items. if (setSlotCount(size)) updateVisibleRange(0, 0); // We keep the visible range at the same center but with size 0. // So that we can: // 1.) flush all visible items // 2.) keep the cached data int center = (getVisibleStart() + getVisibleEnd()) / 2; updateVisibleRange(center, center); } updateVisibleRange(getVisibleStart(), getVisibleEnd()); invalidate(); } Loading Loading
src/com/android/gallery3d/ui/AlbumSetSlidingWindow.java +0 −3 Original line number Diff line number Diff line Loading @@ -165,9 +165,6 @@ public class AlbumSetSlidingWindow implements AlbumSetView.ModelListener { mActiveStart = start; mActiveEnd = end; // If no data is visible, keep the cache content if (start == end) return; int contentStart = Utils.clamp((start + end) / 2 - data.length / 2, 0, Math.max(0, mSize - data.length)); int contentEnd = Math.min(contentStart + data.length, mSize); Loading
src/com/android/gallery3d/ui/AlbumSetView.java +9 −2 Original line number Diff line number Diff line Loading @@ -206,8 +206,15 @@ public class AlbumSetView extends SlotView { private class MyCacheListener implements AlbumSetSlidingWindow.Listener { public void onSizeChanged(int size) { if (setSlotCount(size)) { // If the layout parameters are changed, we need reput all items. if (setSlotCount(size)) updateVisibleRange(0, 0); // We keep the visible range at the same center but with size 0. // So that we can: // 1.) flush all visible items // 2.) keep the cached data int center = (getVisibleStart() + getVisibleEnd()) / 2; updateVisibleRange(center, center); } updateVisibleRange(getVisibleStart(), getVisibleEnd()); invalidate(); } Loading
src/com/android/gallery3d/ui/AlbumSlidingWindow.java +3 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.gallery3d.ui; import android.graphics.Bitmap; import android.os.Message; import com.android.gallery3d.app.GalleryActivity; import com.android.gallery3d.common.BitmapUtils; import com.android.gallery3d.common.LruCache; Loading @@ -29,10 +32,6 @@ import com.android.gallery3d.util.JobLimiter; import com.android.gallery3d.util.ThreadPool.Job; import com.android.gallery3d.util.ThreadPool.JobContext; import android.graphics.Bitmap; import android.graphics.Color; import android.os.Message; public class AlbumSlidingWindow implements AlbumView.ModelListener { @SuppressWarnings("unused") private static final String TAG = "AlbumSlidingWindow"; Loading Loading @@ -178,9 +177,6 @@ public class AlbumSlidingWindow implements AlbumView.ModelListener { mActiveStart = start; mActiveEnd = end; // If no data is visible, keep the cache content if (start == end) return; int contentStart = Utils.clamp((start + end) / 2 - data.length / 2, 0, Math.max(0, mSize - data.length)); int contentEnd = Math.min(contentStart + data.length, mSize); Loading
src/com/android/gallery3d/ui/AlbumView.java +11 −4 Original line number Diff line number Diff line Loading @@ -16,12 +16,12 @@ package com.android.gallery3d.ui; import android.graphics.Rect; import com.android.gallery3d.app.GalleryActivity; import com.android.gallery3d.data.MediaItem; import com.android.gallery3d.ui.PositionRepository.Position; import android.graphics.Rect; public class AlbumView extends SlotView { @SuppressWarnings("unused") private static final String TAG = "AlbumView"; Loading Loading @@ -163,8 +163,15 @@ public class AlbumView extends SlotView { } public void onSizeChanged(int size) { if (setSlotCount(size)) { // If the layout parameters are changed, we need reput all items. if (setSlotCount(size)) updateVisibleRange(0, 0); // We keep the visible range at the same center but with size 0. // So that we can: // 1.) flush all visible items // 2.) keep the cached data int center = (getVisibleStart() + getVisibleEnd()) / 2; updateVisibleRange(center, center); } updateVisibleRange(getVisibleStart(), getVisibleEnd()); invalidate(); } Loading