summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2012-03-27 12:10:27 +0800
committerYuli Huang <yuli@google.com>2012-03-27 12:10:27 +0800
commited46d77c16cd80357f4a0feada2435dfba8104a6 (patch)
treed97e2f13786d6ed942c70c29d0c389c33539e2fb
parentbf71930c60d207fa92790e0f2f57b99c78d6b9a2 (diff)
downloadandroid_packages_apps_Gallery2-ed46d77c16cd80357f4a0feada2435dfba8104a6.tar.gz
android_packages_apps_Gallery2-ed46d77c16cd80357f4a0feada2435dfba8104a6.tar.bz2
android_packages_apps_Gallery2-ed46d77c16cd80357f4a0feada2435dfba8104a6.zip
Fix b/6212093: Title wasn't updated for orientation changes.
Change-Id: I407cfb8f2bde5bab302045188f4f511bdcd2347a b:6212093
-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;
}