OSDN Git Service

Use framework orientation
authorJohn Reck <jreck@google.com>
Mon, 8 Oct 2012 21:52:07 +0000 (14:52 -0700)
committerJohn Reck <jreck@google.com>
Mon, 8 Oct 2012 22:24:57 +0000 (15:24 -0700)
 Bug: 7292373

Change-Id: I66e0c3a3b43a5d544ecc3fc9a4a04fa5521d36b2

src/com/android/gallery3d/app/PhotoPage.java
src/com/android/gallery3d/ui/PhotoView.java

index 3a97c53..aecbb16 100644 (file)
@@ -84,8 +84,6 @@ public class PhotoPage extends ActivityState implements
     private static final String TAG = "PhotoPage";
 
     private static final int MSG_HIDE_BARS = 1;
-    private static final int MSG_LOCK_ORIENTATION = 2;
-    private static final int MSG_UNLOCK_ORIENTATION = 3;
     private static final int MSG_ON_FULL_SCREEN_CHANGED = 4;
     private static final int MSG_UPDATE_ACTION_BAR = 5;
     private static final int MSG_UNFREEZE_GLROOT = 6;
@@ -270,14 +268,6 @@ public class PhotoPage extends ActivityState implements
                         if (mBottomControls != null) mBottomControls.refresh();
                         break;
                     }
-                    case MSG_LOCK_ORIENTATION: {
-                        mOrientationManager.lockOrientation();
-                        break;
-                    }
-                    case MSG_UNLOCK_ORIENTATION: {
-                        mOrientationManager.unlockOrientation();
-                        break;
-                    }
                     case MSG_ON_FULL_SCREEN_CHANGED: {
                         mAppBridge.onFullScreenChanged(message.arg1 == 1);
                         break;
@@ -308,7 +298,6 @@ public class PhotoPage extends ActivityState implements
                         }
 
                         if (stayedOnCamera) {
-                            lockOrientation();
                             updateBars();
                             updateCurrentPhoto(mModel.getMediaItem(0));
                         }
@@ -347,7 +336,6 @@ public class PhotoPage extends ActivityState implements
                 mShowBars = false;
                 mInCameraRoll = true;
                 mAppBridge.setServer(this);
-                mOrientationManager.lockOrientation();
 
                 // Get the ScreenNail from AppBridge and register it.
                 int id = SnailSource.newId();
@@ -1025,16 +1013,6 @@ public class PhotoPage extends ActivityState implements
     }
 
     @Override
-    public void lockOrientation() {
-        mHandler.sendEmptyMessage(MSG_LOCK_ORIENTATION);
-    }
-
-    @Override
-    public void unlockOrientation() {
-        mHandler.sendEmptyMessage(MSG_UNLOCK_ORIENTATION);
-    }
-
-    @Override
     public void onActionBarAllowed(boolean allowed) {
         mActionBarAllowed = allowed;
         mHandler.sendEmptyMessage(MSG_UPDATE_ACTION_BAR);
index 7097dff..8f5a84f 100644 (file)
@@ -115,8 +115,6 @@ public class PhotoView extends GLView {
 
     public interface Listener {
         public void onSingleTapUp(int x, int y);
-        public void lockOrientation();
-        public void unlockOrientation();
         public void onFullScreenChanged(boolean full);
         public void onActionBarAllowed(boolean allowed);
         public void onActionBarWanted();
@@ -1280,7 +1278,6 @@ public class PhotoView extends GLView {
         boolean isCamera = mPictures.get(0).isCamera();
         if (isCamera && !mFilmMode) {
             // Move into camera in page mode, lock
-            mListener.lockOrientation();
             mListener.onActionBarAllowed(false);
         } else {
             mListener.onActionBarAllowed(true);