Loading src/com/android/gallery3d/app/PhotoDataAdapter.java +12 −2 Original line number Diff line number Diff line Loading @@ -1308,6 +1308,7 @@ public class PhotoDataAdapter implements PhotoPage.Model { } } mDirty = false; version = mSource.reload(); if (mIsFromTimelineScreen) { mSource.setClusterKind(GalleryActivity.CLUSTER_ALBUMSET_NO_TITLE); Loading @@ -1316,6 +1317,12 @@ public class PhotoDataAdapter implements PhotoPage.Model { if (version == MediaObject.INVALID_DATA_VERSION) { continue; } if (mSource.isLoading()) { mDirty = true; continue; } else { mSourceVersion = version; } UpdateInfo info = executeAndWait(new GetUpdateInfo()); updateLoading(true); Loading @@ -1331,9 +1338,9 @@ public class PhotoDataAdapter implements PhotoPage.Model { if (info.version != version) { info.reloadContent = true; info.size = mSource.getMediaItemCount(); } if (!info.reloadContent) continue; info.size = mSource.getMediaItemCount(); // Check it is from camera or not boolean isCameraFlag = false; Loading Loading @@ -1436,7 +1443,10 @@ public class PhotoDataAdapter implements PhotoPage.Model { // Don't change index if mSize == 0 if (mSize > 0) { if (index >= mSize) index = mSize - 1; // Due to the set identification and new photo, photos // in the last two positions disappear in the temp info.items. // Don't change index in such a situation. if (index >= mSize + 2) index = mSize - 1; } info.indexHint = index; Loading src/com/android/gallery3d/data/ClusterAlbum.java +5 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,11 @@ public class ClusterAlbum extends MediaSet implements ContentListener { return super.getMediaType(); } @Override public boolean isLoading() { return mClusterAlbumSet.isLoading(); } @Override public long reload() { long version = mClusterAlbumSet.reload(); Loading src/com/android/gallery3d/data/ClusterAlbumSet.java +9 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { private MediaSet mBaseSet; private int mKind; private ArrayList<ClusterAlbum> mAlbums = new ArrayList<ClusterAlbum>(); private boolean mIsLoading; private int mTotalMediaItemCount; /** mTotalSelectableMediaItemCount is the count of items Loading Loading @@ -63,12 +64,19 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { return mBaseSet.getName(); } @Override public synchronized boolean isLoading() { return mIsLoading; } @Override public long reload() { synchronized (this) { long version = mBaseSet.reload(); if (version > mDataVersion && !mBaseSet.isLoading()) { mIsLoading = mBaseSet.isLoading(); if (version > mDataVersion && !mIsLoading) { updateClusters(); mIsLoading = false; mDataVersion = nextVersionNumber(); } if (mKind == ClusterSource.CLUSTER_ALBUMSET_TIME) { Loading src/com/android/gallery3d/data/FilterDeleteSet.java +14 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ public class FilterDeleteSet extends MediaSet implements ContentListener { private static final int REQUEST_REMOVE = 2; private static final int REQUEST_CLEAR = 3; private boolean mIsLoading; private static class Request { int type; // one of the REQUEST_* constants Path path; Loading Loading @@ -141,12 +143,21 @@ public class FilterDeleteSet extends MediaSet implements ContentListener { return base; } @Override public boolean isLoading() { return mIsLoading; } // We apply the pending requests in the mRequests to construct mCurrent in reload(). @Override public long reload() { mIsLoading = true; boolean newData = mBaseSet.reload() > mDataVersion; synchronized (mRequests) { if (!newData && mRequests.isEmpty()) { if (!mBaseSet.isLoading()) { mIsLoading = false; } return mDataVersion; } for (int i = 0; i < mRequests.size(); i++) { Loading Loading @@ -220,6 +231,9 @@ public class FilterDeleteSet extends MediaSet implements ContentListener { } mDataVersion = nextVersionNumber(); if (!mBaseSet.isLoading()) { mIsLoading = false; } return mDataVersion; } Loading Loading
src/com/android/gallery3d/app/PhotoDataAdapter.java +12 −2 Original line number Diff line number Diff line Loading @@ -1308,6 +1308,7 @@ public class PhotoDataAdapter implements PhotoPage.Model { } } mDirty = false; version = mSource.reload(); if (mIsFromTimelineScreen) { mSource.setClusterKind(GalleryActivity.CLUSTER_ALBUMSET_NO_TITLE); Loading @@ -1316,6 +1317,12 @@ public class PhotoDataAdapter implements PhotoPage.Model { if (version == MediaObject.INVALID_DATA_VERSION) { continue; } if (mSource.isLoading()) { mDirty = true; continue; } else { mSourceVersion = version; } UpdateInfo info = executeAndWait(new GetUpdateInfo()); updateLoading(true); Loading @@ -1331,9 +1338,9 @@ public class PhotoDataAdapter implements PhotoPage.Model { if (info.version != version) { info.reloadContent = true; info.size = mSource.getMediaItemCount(); } if (!info.reloadContent) continue; info.size = mSource.getMediaItemCount(); // Check it is from camera or not boolean isCameraFlag = false; Loading Loading @@ -1436,7 +1443,10 @@ public class PhotoDataAdapter implements PhotoPage.Model { // Don't change index if mSize == 0 if (mSize > 0) { if (index >= mSize) index = mSize - 1; // Due to the set identification and new photo, photos // in the last two positions disappear in the temp info.items. // Don't change index in such a situation. if (index >= mSize + 2) index = mSize - 1; } info.indexHint = index; Loading
src/com/android/gallery3d/data/ClusterAlbum.java +5 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,11 @@ public class ClusterAlbum extends MediaSet implements ContentListener { return super.getMediaType(); } @Override public boolean isLoading() { return mClusterAlbumSet.isLoading(); } @Override public long reload() { long version = mClusterAlbumSet.reload(); Loading
src/com/android/gallery3d/data/ClusterAlbumSet.java +9 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { private MediaSet mBaseSet; private int mKind; private ArrayList<ClusterAlbum> mAlbums = new ArrayList<ClusterAlbum>(); private boolean mIsLoading; private int mTotalMediaItemCount; /** mTotalSelectableMediaItemCount is the count of items Loading Loading @@ -63,12 +64,19 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { return mBaseSet.getName(); } @Override public synchronized boolean isLoading() { return mIsLoading; } @Override public long reload() { synchronized (this) { long version = mBaseSet.reload(); if (version > mDataVersion && !mBaseSet.isLoading()) { mIsLoading = mBaseSet.isLoading(); if (version > mDataVersion && !mIsLoading) { updateClusters(); mIsLoading = false; mDataVersion = nextVersionNumber(); } if (mKind == ClusterSource.CLUSTER_ALBUMSET_TIME) { Loading
src/com/android/gallery3d/data/FilterDeleteSet.java +14 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ public class FilterDeleteSet extends MediaSet implements ContentListener { private static final int REQUEST_REMOVE = 2; private static final int REQUEST_CLEAR = 3; private boolean mIsLoading; private static class Request { int type; // one of the REQUEST_* constants Path path; Loading Loading @@ -141,12 +143,21 @@ public class FilterDeleteSet extends MediaSet implements ContentListener { return base; } @Override public boolean isLoading() { return mIsLoading; } // We apply the pending requests in the mRequests to construct mCurrent in reload(). @Override public long reload() { mIsLoading = true; boolean newData = mBaseSet.reload() > mDataVersion; synchronized (mRequests) { if (!newData && mRequests.isEmpty()) { if (!mBaseSet.isLoading()) { mIsLoading = false; } return mDataVersion; } for (int i = 0; i < mRequests.size(); i++) { Loading Loading @@ -220,6 +231,9 @@ public class FilterDeleteSet extends MediaSet implements ContentListener { } mDataVersion = nextVersionNumber(); if (!mBaseSet.isLoading()) { mIsLoading = false; } return mDataVersion; } Loading