diff options
| author | huiyan <huiyan@codeaurora.org> | 2016-04-21 16:47:32 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-22 02:03:56 -0700 |
| commit | e16558a99e4bc0c9b78ee0587c4b4ac92c672eb0 (patch) | |
| tree | b1fa62a9a815855837ce33c1dba53bf6e2af375a /src | |
| parent | 317616930e7273b40e8b7a367fee225b1c9e6bea (diff) | |
| download | android_packages_apps_Gallery2-e16558a99e4bc0c9b78ee0587c4b4ac92c672eb0.tar.gz android_packages_apps_Gallery2-e16558a99e4bc0c9b78ee0587c4b4ac92c672eb0.tar.bz2 android_packages_apps_Gallery2-e16558a99e4bc0c9b78ee0587c4b4ac92c672eb0.zip | |
Gallery2: Fix menu icon is missing when change language on Videos page.
If the gallery is in background ,the video page is saved to the stack.
After the language change, the Gallery is destroyed.
If gallery start again, the video page is restored from the stack.
But the action bar is set to don't display the home as up in onResume,
which set the navigation icon to null, so the menu icon can't display.
If albumpage is started by Video option, the action bar set to display home
option. If albumpage is start by others(albumnsetpage), the action bar set
to display home as up option,to display menu icon or up icon rightly
in action bar.
Besides, fix to display the right title with the different language.
Change-Id: Ieec0bd47400f6c0b698f5c2e842dc1038d9addcf
CRs-Fixed: 1002171
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 8 | ||||
| -rw-r--r-- | src/com/android/gallery3d/app/GalleryActionBar.java | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 44fe2a650..4d2e291c1 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -498,8 +498,12 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster boolean enableHomeButton = (mActivity.getStateManager().getStateCount() > 1) | mParentMediaSetString != null; //GalleryActionBar actionBar = mActivity.getGalleryActionBar(); - mActionBar.setDisplayOptions(enableHomeButton, true); - + if (mIsVideoScreen) { + //if from video screen, show display navigation icon as home and title + mActionBar.setDisplayHome(true, true); + } else { + mActionBar.setDisplayOptions(enableHomeButton, true); + } Toolbar toolBar = mActivity.getToolbar(); if (enableHomeButton && toolBar != null) { toolBar.setNavigationContentDescription("back"); diff --git a/src/com/android/gallery3d/app/GalleryActionBar.java b/src/com/android/gallery3d/app/GalleryActionBar.java index 1e8458738..71bb6381a 100644 --- a/src/com/android/gallery3d/app/GalleryActionBar.java +++ b/src/com/android/gallery3d/app/GalleryActionBar.java @@ -329,6 +329,17 @@ public class GalleryActionBar { mActionBar.setHomeButtonEnabled(displayHomeAsUp); } + public void setDisplayHome(boolean displayHome, boolean showTitle) { + if (mActionBar == null) return; + int options = 0; + if (displayHome) options |= ActionBar.DISPLAY_SHOW_HOME; + if (showTitle) options |= ActionBar.DISPLAY_SHOW_TITLE; + + mActionBar.setDisplayOptions(options, + ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE); + mActionBar.setHomeButtonEnabled(displayHome); + } + public void setTitle(String title) { if (mActionBar != null) mActionBar.setTitle(title); } |
