summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2012-10-25 23:27:32 -0700
committernicolasroard <nicolasroard@google.com>2012-10-25 23:27:32 -0700
commit32cd4fad9f8866d10f2bb68e1b1ded209b08d676 (patch)
tree35abe452936432f8db306f65d9353d1996ba1437 /src
parent6a03661ca41acfd5f4cc804338d930a024955e4e (diff)
downloadandroid_packages_apps_Snap-32cd4fad9f8866d10f2bb68e1b1ded209b08d676.tar.gz
android_packages_apps_Snap-32cd4fad9f8866d10f2bb68e1b1ded209b08d676.tar.bz2
android_packages_apps_Snap-32cd4fad9f8866d10f2bb68e1b1ded209b08d676.zip
Fix crash when showing history
bug:7418823 Change-Id: I0a84bb4d8fc8b42fc953f8301bb2b24cf64edce7
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java3
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageShow.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 7b4ae6691..02acaeab1 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -457,6 +457,9 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
int accessoryPanelWidth = viewPanel.getWidth();
int mainViewWidth = findViewById(R.id.mainView).getWidth();
int mainPanelWidth = mImageShow.getDisplayedImageBounds().width();
+ if (mainPanelWidth == 0) {
+ mainPanelWidth = mainViewWidth;
+ }
int leftOver = mainViewWidth - mainPanelWidth - accessoryPanelWidth;
if (leftOver < 0) {
return -accessoryPanelWidth;
diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java b/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
index bf22c891f..c113e5d92 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
@@ -83,7 +83,7 @@ public class ImageShow extends View implements OnGestureListener,
private HistoryAdapter mHistoryAdapter = null;
private ImageStateAdapter mImageStateAdapter = null;
- private Rect mImageBounds = null;
+ private Rect mImageBounds = new Rect();
private boolean mTouchShowOriginal = false;
private long mTouchShowOriginalDate = 0;