summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2012-10-25 23:41:00 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-25 23:41:01 -0700
commit8b3ce9b01275151b653ea138324e47eb66a7b47e (patch)
tree712b3f69ab3b4d46b844796cd4a204225000aa0d
parent635aab5631e25488610ff5546c51ea2895dda2f0 (diff)
parentf0eb72eab7be3183417deff6dadb4937b90b9e59 (diff)
downloadandroid_packages_apps_Gallery2-8b3ce9b01275151b653ea138324e47eb66a7b47e.tar.gz
android_packages_apps_Gallery2-8b3ce9b01275151b653ea138324e47eb66a7b47e.tar.bz2
android_packages_apps_Gallery2-8b3ce9b01275151b653ea138324e47eb66a7b47e.zip
Merge "Fix crash when showing history" into gb-ub-photos-arches
-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;