OSDN Git Service

Fix crash when showing history
authornicolasroard <nicolasroard@google.com>
Fri, 26 Oct 2012 06:27:32 +0000 (23:27 -0700)
committernicolasroard <nicolasroard@google.com>
Fri, 26 Oct 2012 06:27:32 +0000 (23:27 -0700)
bug:7418823
Change-Id: I0a84bb4d8fc8b42fc953f8301bb2b24cf64edce7

src/com/android/gallery3d/filtershow/FilterShowActivity.java
src/com/android/gallery3d/filtershow/imageshow/ImageShow.java

index 7b4ae66..02acaea 100644 (file)
@@ -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;
index bf22c89..c113e5d 100644 (file)
@@ -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;