diff options
Diffstat (limited to 'src/com')
| -rw-r--r-- | src/com/android/gallery3d/data/ClusterAlbum.java | 2 | ||||
| -rw-r--r-- | src/com/android/gallery3d/ui/TimeLineSlotView.java | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/data/ClusterAlbum.java b/src/com/android/gallery3d/data/ClusterAlbum.java index ceec4a4ac..b7d1c3f36 100644 --- a/src/com/android/gallery3d/data/ClusterAlbum.java +++ b/src/com/android/gallery3d/data/ClusterAlbum.java @@ -133,7 +133,7 @@ public class ClusterAlbum extends MediaSet implements ContentListener { public static ArrayList<MediaItem> getMediaItemFromPath( ArrayList<Path> paths, int start, int count, DataManager dataManager) { - if (start >= paths.size()) { + if (start >= paths.size() || start < 0) { return new ArrayList<MediaItem>(); } int end = Math.min(start + count, paths.size()); diff --git a/src/com/android/gallery3d/ui/TimeLineSlotView.java b/src/com/android/gallery3d/ui/TimeLineSlotView.java index bac5a0e4d..329ea75e3 100644 --- a/src/com/android/gallery3d/ui/TimeLineSlotView.java +++ b/src/com/android/gallery3d/ui/TimeLineSlotView.java @@ -459,9 +459,12 @@ public class TimeLineSlotView extends GLView { Rect offset = new Rect(); rootPane.getBoundsOf(this, offset); Rect r = getSlotRect(slotIndex); - r.offset(offset.left - getScrollX(), - offset.top - getScrollY()); - return r; + if (r != null) { + r.offset(offset.left - getScrollX(), + offset.top - getScrollY()); + return r; + } + return offset; } public int getTitleWidth() { |
