Temporary hack to make images show in gallery. Bug 2417823.
diff --git a/src/com/cooliris/cache/CacheService.java b/src/com/cooliris/cache/CacheService.java
index 6b8f9f0..0bd6afe 100644
--- a/src/com/cooliris/cache/CacheService.java
+++ b/src/com/cooliris/cache/CacheService.java
@@ -1012,6 +1012,14 @@
}
Log.i(TAG, "Refreshing dirty albums");
populateMediaItemsForSets(context, sets, acceleratedSets, true);
+ // Logic to refresh the UI for dirty sets
+ if (context instanceof Gallery) {
+ int numSets = sets.size();
+ for (int i = 0; i < numSets; ++i) {
+ MediaSet set = sets.get(i);
+ ((Gallery)context).refreshUIForSet(set);
+ }
+ }
}
}
sAlbumCache.delete(ALBUM_CACHE_DIRTY_BUCKET_INDEX);
diff --git a/src/com/cooliris/media/Gallery.java b/src/com/cooliris/media/Gallery.java
index 0ea80dd..13d3320 100644
--- a/src/com/cooliris/media/Gallery.java
+++ b/src/com/cooliris/media/Gallery.java
@@ -438,4 +438,21 @@
setResult(RESULT_OK, result);
finish();
}
+
+ public void refreshUIForSet(MediaSet set) {
+ if (mGridLayer != null) {
+ final MediaFeed feed = mGridLayer.getFeed();
+ if (feed != null) {
+ final MediaSet currentSet = feed.getMediaSet(set.mId);
+ if (currentSet != null) {
+ // We need to refresh the UI with this set if the number of items have changed
+ if (currentSet.getNumItems() != set.getNumItems() || currentSet.mMaxAddedTimestamp != set.mMaxAddedTimestamp) {
+ final MediaSet newSet = feed.replaceMediaSet(set.mId, currentSet.mDataSource);
+ newSet.mName = currentSet.mName;
+ newSet.generateTitle(true);
+ }
+ }
+ }
+ }
+ }
}