diff options
Diffstat (limited to 'src/com/android/gallery3d/app')
-rw-r--r-- | src/com/android/gallery3d/app/AbstractGalleryActivity.java | 1 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/GalleryActionBar.java | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java index 5e779cd59..cb3aa9d0a 100644 --- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java +++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java @@ -84,6 +84,7 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext public void onConfigurationChanged(Configuration config) { super.onConfigurationChanged(config); mStateManager.onConfigurationChange(config); + getGalleryActionBar().onConfigurationChanged(); invalidateOptionsMenu(); toggleStatusBarByOrientation(); } diff --git a/src/com/android/gallery3d/app/GalleryActionBar.java b/src/com/android/gallery3d/app/GalleryActionBar.java index 1729c6433..f0be01a91 100644 --- a/src/com/android/gallery3d/app/GalleryActionBar.java +++ b/src/com/android/gallery3d/app/GalleryActionBar.java @@ -57,6 +57,7 @@ public class GalleryActionBar implements OnNavigationListener { private AlbumModeAdapter mAlbumModeAdapter; private OnAlbumModeSelectedListener mAlbumModeListener; + private int mLastAlbumModeSelected; private CharSequence [] mAlbumModes; public static final int ALBUM_FILMSTRIP_MODE_SELECTED = 0; public static final int ALBUM_GRID_MODE_SELECTED = 1; @@ -254,6 +255,13 @@ public class GalleryActionBar implements OnNavigationListener { } } + public void onConfigurationChanged() { + if (mActionBar != null && mAlbumModeListener != null) { + OnAlbumModeSelectedListener listener = mAlbumModeListener; + enableAlbumModeMenu(mLastAlbumModeSelected, listener); + } + } + public void enableAlbumModeMenu(int selected, OnAlbumModeSelectedListener listener) { if (mActionBar != null) { if (mAlbumModeAdapter == null) { @@ -265,6 +273,7 @@ public class GalleryActionBar implements OnNavigationListener { mAlbumModeAdapter = new AlbumModeAdapter(); } mAlbumModeListener = null; + mLastAlbumModeSelected = selected; mActionBar.setListNavigationCallbacks(mAlbumModeAdapter, this); mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); mActionBar.setSelectedNavigationItem(selected); |