summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 7daf5df0c..3a18dd2e4 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -322,25 +322,15 @@ public class PhotoPage extends ActivityState
}
}
- private void setTitle(String title) {
- if (title == null) return;
- boolean showTitle = mActivity.getAndroidContext().getResources().getBoolean(
- R.bool.show_action_bar_title);
- if (showTitle)
- mActionBar.setTitle(title);
- else
- mActionBar.setTitle("");
- }
-
private void updateCurrentPhoto(MediaItem photo) {
if (mCurrentPhoto == photo) return;
mCurrentPhoto = photo;
if (mCurrentPhoto == null) return;
updateMenuOperations();
+ updateTitle();
if (mShowDetails) {
mDetailsHelper.reloadDetails(mModel.getCurrentIndex());
}
- setTitle(photo.getName());
mPhotoView.showVideoPlayIcon(
photo.getMediaType() == MediaObject.MEDIA_TYPE_VIDEO);
@@ -349,6 +339,16 @@ public class PhotoPage extends ActivityState
}
}
+ private void updateTitle() {
+ if (mCurrentPhoto == null) return;
+ boolean showTitle = mActivity.getAndroidContext().getResources().getBoolean(
+ R.bool.show_action_bar_title);
+ if (showTitle && mCurrentPhoto.getName() != null)
+ mActionBar.setTitle(mCurrentPhoto.getName());
+ else
+ mActionBar.setTitle("");
+ }
+
private void updateMenuOperations() {
if (mMenu == null) return;
MenuItem item = mMenu.findItem(R.id.action_slideshow);
@@ -470,6 +470,7 @@ public class PhotoPage extends ActivityState
mMenu = menu;
mShowBars = true;
updateMenuOperations();
+ updateTitle();
return true;
}