From 9359b531db2dfed49c4cda43ba4c6d6864b7bca5 Mon Sep 17 00:00:00 2001 From: Camera Software Integration Date: Wed, 21 Oct 2015 15:32:48 -0700 Subject: SnapdragonCamera: Updating preview size again On layout change, need to call preview size change again as it's not guaranteed it's called first always. Change-Id: I8a687fbf162924f36f2ff7be2a3ba1c6304b27f6 CRs-Fixed: 893423 --- src/com/android/camera/PhotoModule.java | 5 +++++ src/com/android/camera/PhotoUI.java | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index f72c75e7a..9491a87a7 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -408,6 +408,11 @@ public class PhotoModule } } + public Parameters getParameters() + { + return mParameters; + } + /** * This Handler is used to post message back onto the main thread of the * application diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 6e321c535..21c73510d 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -168,6 +168,12 @@ public class PhotoUI implements PieListener, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { if (mMenu != null) mMenu.tryToCloseSubList(); + + Camera.Parameters parameters = ((PhotoModule)mController).getParameters(); + if(parameters != null) { + Camera.Size size = parameters.getPreviewSize(); + setAspectRatio((float) size.width / size.height); + } } }; -- cgit v1.2.3