summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2012-10-06 01:06:43 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-06 12:09:47 -0700
commit3eb0a21071f7acae42077d11773f872ffd9628d3 (patch)
treeb2f6cb5b580c9e67a38111692653d2dfe4eca3c1 /src/com/android/gallery3d
parent82da69ff867e4e19f0adb970933a42eb65d973ed (diff)
downloadandroid_packages_apps_Snap-3eb0a21071f7acae42077d11773f872ffd9628d3.tar.gz
android_packages_apps_Snap-3eb0a21071f7acae42077d11773f872ffd9628d3.tar.bz2
android_packages_apps_Snap-3eb0a21071f7acae42077d11773f872ffd9628d3.zip
Fix display of spinner and SQL exception for view intent
Bug: 7288544 Bug: 7219163 Remove the query for photo DISPLAY_NAME in view intent since it is no longer used, and hide the spinner when launching PhotoPage via this intent. Change-Id: Id41ff3d623e7fd2e708b1042782333b48e8ba4a7
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r--src/com/android/gallery3d/app/Gallery.java20
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java8
2 files changed, 6 insertions, 22 deletions
diff --git a/src/com/android/gallery3d/app/Gallery.java b/src/com/android/gallery3d/app/Gallery.java
index dadb32c48..6ca4bab2d 100644
--- a/src/com/android/gallery3d/app/Gallery.java
+++ b/src/com/android/gallery3d/app/Gallery.java
@@ -212,26 +212,6 @@ public final class Gallery extends AbstractGalleryActivity implements OnCancelLi
}
}
- // Displays the filename as title, reading the filename from the interface:
- // {@link android.provider.OpenableColumns#DISPLAY_NAME}.
- AsyncQueryHandler queryHandler = new AsyncQueryHandler(getContentResolver()) {
- @Override
- protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
- try {
- if ((cursor != null) && cursor.moveToFirst()) {
- String displayName = cursor.getString(0);
-
- // Just show empty title if other apps don't set DISPLAY_NAME
- setTitle((displayName == null) ? "" : displayName);
- }
- } finally {
- Utils.closeSilently(cursor);
- }
- }
- };
- queryHandler.startQuery(0, null, uri, new String[] {OpenableColumns.DISPLAY_NAME},
- null, null, null);
-
getStateManager().startState(PhotoPage.class, data);
}
}
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 2a088b1fa..a219f51e4 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -149,6 +149,7 @@ public class PhotoPage extends ActivityState implements
private MediaItem mCurrentPhoto = null;
private MenuExecutor mMenuExecutor;
private boolean mIsActive;
+ private boolean mShowSpinner;
private String mSetPathString;
// This is the original mSetPathString before adding the camera preview item.
private String mOriginalSetPathString;
@@ -339,6 +340,7 @@ public class PhotoPage extends ActivityState implements
MSG_ALBUMPAGE_NONE) == MSG_ALBUMPAGE_STARTED;
mCurrentIndex = data.getInt(KEY_INDEX_HINT, 0);
if (mSetPathString != null) {
+ mShowSpinner = true;
mAppBridge = (AppBridge) data.getParcelable(KEY_APP_BRIDGE);
if (mAppBridge != null) {
mShowBars = false;
@@ -360,6 +362,7 @@ public class PhotoPage extends ActivityState implements
if (SecureSource.isSecurePath(mSetPathString)) {
mSecureAlbum = (SecureAlbum) mActivity.getDataManager()
.getMediaSet(mSetPathString);
+ mShowSpinner = false;
}
if (data.getBoolean(KEY_SHOW_WHEN_LOCKED, false)) {
// Set the flag to be on top of the lock screen.
@@ -483,6 +486,7 @@ public class PhotoPage extends ActivityState implements
mModel = new SinglePhotoDataAdapter(mActivity, mPhotoView, mediaItem);
mPhotoView.setModel(mModel);
updateCurrentPhoto(mediaItem);
+ mShowSpinner = false;
}
mPhotoView.setFilmMode(mStartInFilmstrip && mMediaSet.getMediaItemCount() > 1);
@@ -1186,7 +1190,7 @@ public class PhotoPage extends ActivityState implements
mPhotoView.pause();
mHandler.removeMessages(MSG_HIDE_BARS);
mActionBar.removeOnMenuVisibilityListener(mMenuVisibilityListener);
- if (mSecureAlbum == null) {
+ if (mShowSpinner) {
mActionBar.disableAlbumModeMenu(true);
}
onCommitDeleteImage();
@@ -1271,7 +1275,7 @@ public class PhotoPage extends ActivityState implements
mActionBar.setDisplayOptions(
((mSecureAlbum == null) && (mSetPathString != null)), false);
mActionBar.addOnMenuVisibilityListener(mMenuVisibilityListener);
- if (mSecureAlbum == null) {
+ if (mShowSpinner) {
mActionBar.enableAlbumModeMenu(
GalleryActionBar.ALBUM_FILMSTRIP_MODE_SELECTED, this);
}