From 808bc73d3cb6f954eec9798c555373bd8c3bca93 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(+) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 3e5e9bfb9..8a0533a1d 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -381,6 +381,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 b00db1434..3a9a2c13c 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -157,6 +157,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