OSDN Git Service

Fix bugs relating to grid/filmstrip switching
authorBobby Georgescu <georgescu@google.com>
Mon, 17 Sep 2012 21:48:52 +0000 (14:48 -0700)
committerBobby Georgescu <georgescu@google.com>
Mon, 17 Sep 2012 21:48:52 +0000 (14:48 -0700)
Bug: 7180582
Bug: 7146147
Change-Id: I3d2ad8866a938f9f162e14f11bc2e021834ba513

src/com/android/gallery3d/app/AlbumPage.java
src/com/android/gallery3d/app/PhotoPage.java
src/com/android/gallery3d/data/FilterDeleteSet.java

index 298e083..fade00c 100644 (file)
@@ -567,6 +567,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
                 return true;
             }
             case R.id.action_filmstrip: {
+                if (mAlbumDataAdapter.size() < 1) return true;
                 int targetPhoto = mSlotView.getVisibleStart();
                 prepareAnimationBackToFilmstrip(targetPhoto);
                 if(mLaunchedFromPhotoPage) {
index cb6bd70..df61f89 100644 (file)
@@ -352,7 +352,6 @@ public class PhotoPage extends ActivityState implements
                 Log.w(TAG, "failed to restore " + mSetPathString);
             }
             if (itemPath == null) {
-                mMediaSet.reload();
                 if (mMediaSet.getMediaItemCount() > 0) {
                     itemPath = mMediaSet.getMediaItem(mCurrentIndex, 1)
                         .get(0).getPath();
index b2b84e8..fc44d48 100644 (file)
@@ -69,6 +69,7 @@ public class FilterDeleteSet extends MediaSet implements ContentListener {
         super(path, INVALID_DATA_VERSION);
         mBaseSet = baseSet;
         mBaseSet.addContentListener(this);
+        mMediaItemCount = mBaseSet.getMediaItemCount() - mCurrent.size();
     }
 
     @Override