OSDN Git Service

Change ActionBar spinner text size on rotate
authorBobby Georgescu <georgescu@google.com>
Thu, 11 Oct 2012 21:49:09 +0000 (14:49 -0700)
committerBobby Georgescu <georgescu@google.com>
Thu, 11 Oct 2012 22:20:07 +0000 (15:20 -0700)
Bug: 7333151
Update the grid/filmstrip spinner switch text to
look and behave like the text in the Gmail app, as
requested by UX.

Change-Id: If822b21899172a35402477868d4f146a8e00cfea

src/com/android/gallery3d/app/AbstractGalleryActivity.java
src/com/android/gallery3d/app/GalleryActionBar.java

index 5e779cd..cb3aa9d 100644 (file)
@@ -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();
     }
index 1729c64..f0be01a 100644 (file)
@@ -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);