summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/app
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2015-01-26 10:07:21 +0800
committerLikai Ding <likaid@codeaurora.org>2015-02-02 13:55:08 +0800
commite2fb5dc7798cf677f6a66b6a697c4a011b0a101f (patch)
tree9250c3a47e27b90e3c094c9d3ffa1365c3914178 /src/com/android/camera/app
parent07cf80cc97c68f12d5728919fcebba28e750761d (diff)
downloadandroid_packages_apps_Snap-e2fb5dc7798cf677f6a66b6a697c4a011b0a101f.tar.gz
android_packages_apps_Snap-e2fb5dc7798cf677f6a66b6a697c4a011b0a101f.tar.bz2
android_packages_apps_Snap-e2fb5dc7798cf677f6a66b6a697c4a011b0a101f.zip
SnapdragonCamera: fix portrait orientation
Fix camera activity to portrait, so there is no delay when rotation occurs. Main changes are: 1. RotateLayout now supports padding and dynamically added child. 2. Camera controls and gesture detetion are now orientation-aware. 3. Toasts are replaced with RotateTextToast. 4. Obselete layout files are removed. Change-Id: I338849bd7fb84b847eb357f771a24a5cc09bf6fa
Diffstat (limited to 'src/com/android/camera/app')
-rw-r--r--src/com/android/camera/app/OrientationManager.java42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/com/android/camera/app/OrientationManager.java b/src/com/android/camera/app/OrientationManager.java
index ef03a0163..7dcd3064f 100644
--- a/src/com/android/camera/app/OrientationManager.java
+++ b/src/com/android/camera/app/OrientationManager.java
@@ -36,12 +36,6 @@ public class OrientationManager {
private Activity mActivity;
private MyOrientationEventListener mOrientationListener;
- // If the framework orientation is locked.
- private boolean mOrientationLocked = false;
-
- // This is true if "Settings -> Display -> Rotation Lock" is checked. We
- // don't allow the orientation to be unlocked if the value is true.
- private boolean mRotationLockedSetting = false;
public OrientationManager(Activity activity) {
mActivity = activity;
@@ -50,8 +44,6 @@ public class OrientationManager {
public void resume() {
ContentResolver resolver = mActivity.getContentResolver();
- mRotationLockedSetting = Settings.System.getInt(
- resolver, Settings.System.ACCELEROMETER_ROTATION, 0) != 1;
mOrientationListener.enable();
}
@@ -59,40 +51,6 @@ public class OrientationManager {
mOrientationListener.disable();
}
- ////////////////////////////////////////////////////////////////////////////
- // Orientation handling
- //
- // We can choose to lock the framework orientation or not. If we lock the
- // framework orientation, we calculate a a compensation value according to
- // current device orientation and send it to listeners. If we don't lock
- // the framework orientation, we always set the compensation value to 0.
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Lock the framework orientation to the current device orientation
- * rotates. No effect if the system setting of auto-rotation is off.
- */
- public void lockOrientation() {
- if (mOrientationLocked || mRotationLockedSetting) return;
- mOrientationLocked = true;
- if (ApiHelper.HAS_ORIENTATION_LOCK) {
- mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
- } else {
- mActivity.setRequestedOrientation(calculateCurrentScreenOrientation());
- }
- }
-
- /**
- * Unlock the framework orientation, so it can change when the device
- * rotates. No effect if the system setting of auto-rotation is off.
- */
- public void unlockOrientation() {
- if (!mOrientationLocked || mRotationLockedSetting) return;
- mOrientationLocked = false;
- Log.d(TAG, "unlock orientation");
- mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
- }
-
private int calculateCurrentScreenOrientation() {
int displayRotation = getDisplayRotation();
// Display rotation >= 180 means we need to use the REVERSE landscape/portrait