diff options
author | John Reck <jreck@google.com> | 2012-12-10 13:25:49 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-12-10 13:25:49 -0800 |
commit | 695e1aa059cbc2cb2988f6beb0fee8ff7952b229 (patch) | |
tree | fb63573f6287679c750a07f2aa71ae2399124e69 /src | |
parent | db99a10b6ac9296d612db8ba51e37f141fee4170 (diff) | |
download | android_packages_apps_Gallery2-695e1aa059cbc2cb2988f6beb0fee8ff7952b229.tar.gz android_packages_apps_Gallery2-695e1aa059cbc2cb2988f6beb0fee8ff7952b229.tar.bz2 android_packages_apps_Gallery2-695e1aa059cbc2cb2988f6beb0fee8ff7952b229.zip |
Force a layout pass if the display rotation changes
Bug: 7687209
DisplayRotation is used to map camera orientation to the display and is
updated in layoutContentPane(). However, in the case of a 180 rotate
framework doesn't send an onConfigurationChanged nor does the layout
dimensions change, thus layoutContentPane doesn't fire and we don't
update mDisplayRotation, resulting in an upside-down preview. To handle
this, check each draw whether or not the display rotation has changed
and if it has force a layout pass.
Change-Id: I610ea235d1bf7de2743f4cdb8e42ba1ddcb41404
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/ui/GLRootView.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/ui/GLRootView.java b/src/com/android/gallery3d/ui/GLRootView.java index ea457f7fa..b7c48bf2e 100644 --- a/src/com/android/gallery3d/ui/GLRootView.java +++ b/src/com/android/gallery3d/ui/GLRootView.java @@ -392,7 +392,11 @@ public class GLRootView extends GLSurfaceView mRenderRequested = false; - if ((mFlags & FLAG_NEED_LAYOUT) != 0) layoutContentPane(); + if ((mOrientationSource != null + && mDisplayRotation != mOrientationSource.getDisplayRotation()) + || (mFlags & FLAG_NEED_LAYOUT) != 0) { + layoutContentPane(); + } mCanvas.save(GLCanvas.SAVE_FLAG_ALL); rotateCanvas(-mCompensation); |