diff options
| author | zdi <zdi@codeaurora.org> | 2016-03-30 17:28:17 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-04 20:04:57 -0700 |
| commit | 1162ee9c919127ce1a3bcc7fe0b0c275d6e616a8 (patch) | |
| tree | c2b8dc2fb4de935c20132dc1b4f2fc670a1dd355 /src | |
| parent | 41bc426af4b148f264ab7b07141636b06add4d0a (diff) | |
| download | android_packages_apps_Gallery2-1162ee9c919127ce1a3bcc7fe0b0c275d6e616a8.tar.gz android_packages_apps_Gallery2-1162ee9c919127ce1a3bcc7fe0b0c275d6e616a8.tar.bz2 android_packages_apps_Gallery2-1162ee9c919127ce1a3bcc7fe0b0c275d6e616a8.zip | |
Gallery2: Fix NullPointerException when scroll pictures in TimeLine.
Fix NullPointerException when scroll pictures in TimeLine with steps:
scroll pictures --> slideshow --> backpress.
Change-Id: I5d43f8951aeea3bc5dabb306be5366d7db108b39
CRs-Fixed: 980466
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/ui/TimeLineSlotView.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/ui/TimeLineSlotView.java b/src/com/android/gallery3d/ui/TimeLineSlotView.java index 5c93d31bd..81fc3a57c 100644 --- a/src/com/android/gallery3d/ui/TimeLineSlotView.java +++ b/src/com/android/gallery3d/ui/TimeLineSlotView.java @@ -107,9 +107,10 @@ public class TimeLineSlotView extends GLView { return; } Rect rect = mLayout.getSlotRect(index); - int position = (rect.top + rect.bottom - getHeight()) / 2; - - setScrollPosition(position); + if (rect != null) { + int position = (rect.top + rect.bottom - getHeight()) / 2; + setScrollPosition(position); + } } public void makeSlotVisible(int index) { |
