summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2017-01-09 09:09:00 +0100
committerDanny Baumann <dannybaumann@web.de>2017-01-12 20:15:12 +0000
commit69b66d262465a1551d06f5d0c320370fbd98f411 (patch)
treeac60641814dd65ff9e2bbfe379e44bbf52d1c43b
parent2876bc5fbc507da70605543d7af03f70797c61fd (diff)
downloadandroid_packages_apps_Snap-69b66d262465a1551d06f5d0c320370fbd98f411.zip
android_packages_apps_Snap-69b66d262465a1551d06f5d0c320370fbd98f411.tar.gz
android_packages_apps_Snap-69b66d262465a1551d06f5d0c320370fbd98f411.tar.bz2
Fix camera controls rotation.
Change-Id: I949b30becc8b69268ff30a0dca57e234fd078204
-rw-r--r--src/com/android/camera/ui/CameraControls.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index 674cb03..f06c14d 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -199,14 +199,8 @@ public class CameraControls extends RotatableLayout {
}
synchronized (mViews) {
- for (int i = 0; i < mTopBar.getChildCount(); i++) {
- mViews.add(mTopBar.getChildAt(i));
- }
-
- for (int i = 0; i < mBottomBar.getChildCount(); i++) {
- mViews.add(mBottomBar.getChildAt(i));
- }
-
+ addChildViewsRecursivelyLocked(mTopBar);
+ addChildViewsRecursivelyLocked(mBottomBar);
mViews.add(mAutoHdrNotice);
mViews.add(mHistogramView);
}
@@ -252,6 +246,17 @@ public class CameraControls extends RotatableLayout {
}
}
+ private void addChildViewsRecursivelyLocked(View view) {
+ if (view instanceof ViewGroup) {
+ final ViewGroup group = (ViewGroup) view;
+ for (int i = 0; i < group.getChildCount(); i++) {
+ addChildViewsRecursivelyLocked(group.getChildAt(i));
+ }
+ } else {
+ mViews.add(view);
+ }
+ }
+
private ShutterButton.OnShutterButtonListener mShutterListener = new ShutterButton.OnShutterButtonListener() {
@Override
public void onShutterButtonFocus(boolean pressed) {