Loading src/com/android/camera/ui/CameraControls.java +19 −6 Original line number Diff line number Diff line Loading @@ -62,12 +62,7 @@ public class CameraControls extends RotatableLayout { @Override public void onDisplayChanged(int arg0) { int currentRotation = Util.getDisplayRotation((Activity) getContext()); if ((currentRotation - mLastRotation) % 180 == 0) { flipChildren(); getParent().requestLayout(); } mLastRotation = currentRotation; checkLayoutFlip(); } @Override Loading @@ -76,6 +71,15 @@ public class CameraControls extends RotatableLayout { } } private void checkLayoutFlip() { int currentRotation = Util.getDisplayRotation((Activity) getContext()); if ((currentRotation - mLastRotation + 360) % 360 == 180) { mLastRotation = currentRotation; flipChildren(); getParent().requestLayout(); } } @Override public void onFinishInflate() { super.onFinishInflate(); Loading @@ -98,6 +102,14 @@ public class CameraControls extends RotatableLayout { } } @Override public void onWindowVisibilityChanged(int visibility) { if (visibility == View.VISIBLE) { // Make sure when coming back from onPause, the layout is rotated correctly checkLayoutFlip(); } } @Override public void onDetachedFromWindow () { super.onDetachedFromWindow(); Loading @@ -109,6 +121,7 @@ public class CameraControls extends RotatableLayout { @Override public void onLayout(boolean changed, int l, int t, int r, int b) { mLastRotation = Util.getDisplayRotation((Activity) getContext()); int orientation = getResources().getConfiguration().orientation; int size = getResources().getDimensionPixelSize(R.dimen.camera_controls_size); int rotation = getUnifiedRotation(); Loading src/com/android/camera/ui/RotatableLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class RotatableLayout extends FrameLayout { super.onConfigurationChanged(config); int rotation = Util.getDisplayRotation((Activity) getContext()); if ((rotation - mPrevRotation + 360) % 180 == 0) { flipChildren(); mPrevRotation = rotation; return; } boolean clockwise = isClockWiseRotation(mPrevRotation, rotation); Loading Loading
src/com/android/camera/ui/CameraControls.java +19 −6 Original line number Diff line number Diff line Loading @@ -62,12 +62,7 @@ public class CameraControls extends RotatableLayout { @Override public void onDisplayChanged(int arg0) { int currentRotation = Util.getDisplayRotation((Activity) getContext()); if ((currentRotation - mLastRotation) % 180 == 0) { flipChildren(); getParent().requestLayout(); } mLastRotation = currentRotation; checkLayoutFlip(); } @Override Loading @@ -76,6 +71,15 @@ public class CameraControls extends RotatableLayout { } } private void checkLayoutFlip() { int currentRotation = Util.getDisplayRotation((Activity) getContext()); if ((currentRotation - mLastRotation + 360) % 360 == 180) { mLastRotation = currentRotation; flipChildren(); getParent().requestLayout(); } } @Override public void onFinishInflate() { super.onFinishInflate(); Loading @@ -98,6 +102,14 @@ public class CameraControls extends RotatableLayout { } } @Override public void onWindowVisibilityChanged(int visibility) { if (visibility == View.VISIBLE) { // Make sure when coming back from onPause, the layout is rotated correctly checkLayoutFlip(); } } @Override public void onDetachedFromWindow () { super.onDetachedFromWindow(); Loading @@ -109,6 +121,7 @@ public class CameraControls extends RotatableLayout { @Override public void onLayout(boolean changed, int l, int t, int r, int b) { mLastRotation = Util.getDisplayRotation((Activity) getContext()); int orientation = getResources().getConfiguration().orientation; int size = getResources().getDimensionPixelSize(R.dimen.camera_controls_size); int rotation = getUnifiedRotation(); Loading
src/com/android/camera/ui/RotatableLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class RotatableLayout extends FrameLayout { super.onConfigurationChanged(config); int rotation = Util.getDisplayRotation((Activity) getContext()); if ((rotation - mPrevRotation + 360) % 180 == 0) { flipChildren(); mPrevRotation = rotation; return; } boolean clockwise = isClockWiseRotation(mPrevRotation, rotation); Loading