From 6a0de79a7066d4ae5cc4677f88989abd15e892ff Mon Sep 17 00:00:00 2001 From: Doris Liu Date: Tue, 26 Feb 2013 10:54:25 -0800 Subject: Flatten view hierarchy and rotate views TODO: SRI pano and Lightcycle can use a bit more flattening. I will get to them next. (Maybe in a different CL.) TODO: Need to cancel capture animation in onConfigurationChanged() Change-Id: I00fd3e098117d9fb74fde2c128407ab6275bcedf --- src/com/android/camera/ShutterButton.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/com/android/camera/ShutterButton.java') diff --git a/src/com/android/camera/ShutterButton.java b/src/com/android/camera/ShutterButton.java index a1bbb1a0d..41775a186 100755 --- a/src/com/android/camera/ShutterButton.java +++ b/src/com/android/camera/ShutterButton.java @@ -17,11 +17,14 @@ package com.android.camera; import android.content.Context; +import android.content.res.Configuration; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; +import com.android.camera.ui.RotatableLayout; + /** * A button designed to be used for the on-screen shutter button. * It's currently an {@code ImageView} that can call a delegate when the @@ -127,4 +130,10 @@ public class ShutterButton extends ImageView { } return result; } + + @Override + public void onConfigurationChanged(Configuration config) { + super.onConfigurationChanged(config); + RotatableLayout.rotate(this, config.orientation == Configuration.ORIENTATION_PORTRAIT); + } } -- cgit v1.2.3