diff options
author | Chih-yu Huang <akahuang@google.com> | 2011-10-07 16:15:53 +0800 |
---|---|---|
committer | Chih-yu Huang <akahuang@google.com> | 2011-10-07 18:25:24 +0800 |
commit | 94ca8baae7e6e3885d895c095890eabf30d922e2 (patch) | |
tree | eb8cc5fac5473512bda66e92db7c55ca463f4fd4 /src/com/android/camera/ui | |
parent | fc52f4a9bf815633739125883807bfe965cf6009 (diff) | |
download | LegacyCamera-94ca8baae7e6e3885d895c095890eabf30d922e2.zip LegacyCamera-94ca8baae7e6e3885d895c095890eabf30d922e2.tar.gz LegacyCamera-94ca8baae7e6e3885d895c095890eabf30d922e2.tar.bz2 |
Let review icons rotatable.
bug:5244256
Change-Id: Ieed6119f22598a34eeb1672d07f55a876dced791
Diffstat (limited to 'src/com/android/camera/ui')
-rw-r--r-- | src/com/android/camera/ui/Rotatable.java | 21 | ||||
-rw-r--r-- | src/com/android/camera/ui/RotateImageView.java | 8 | ||||
-rw-r--r-- | src/com/android/camera/ui/RotateLayout.java | 4 |
3 files changed, 31 insertions, 2 deletions
diff --git a/src/com/android/camera/ui/Rotatable.java b/src/com/android/camera/ui/Rotatable.java new file mode 100644 index 0000000..e9192c4 --- /dev/null +++ b/src/com/android/camera/ui/Rotatable.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera.ui; + +public interface Rotatable { + public void setOrientation(int orientation); +} diff --git a/src/com/android/camera/ui/RotateImageView.java b/src/com/android/camera/ui/RotateImageView.java index 81faaec..390d705 100644 --- a/src/com/android/camera/ui/RotateImageView.java +++ b/src/com/android/camera/ui/RotateImageView.java @@ -16,6 +16,8 @@ package com.android.camera.ui; +import com.android.camera.ui.Rotatable; + import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; @@ -32,7 +34,7 @@ import android.widget.ImageView; /** * A @{code ImageView} which can rotate it's content. */ -public class RotateImageView extends ColorFilterImageView { +public class RotateImageView extends ColorFilterImageView implements Rotatable { @SuppressWarnings("unused") private static final String TAG = "RotateImageView"; @@ -64,6 +66,10 @@ public class RotateImageView extends ColorFilterImageView { return mTargetDegree; } + public void setOrientation(int orientation) { + setDegree(orientation); + } + // Rotate the view counter-clockwise public void setDegree(int degree) { // make sure in the range of [0, 359] diff --git a/src/com/android/camera/ui/RotateLayout.java b/src/com/android/camera/ui/RotateLayout.java index 1dfeae9..24815f8 100644 --- a/src/com/android/camera/ui/RotateLayout.java +++ b/src/com/android/camera/ui/RotateLayout.java @@ -16,6 +16,8 @@ package com.android.camera.ui; +import com.android.camera.ui.Rotatable; + import android.content.Context; import android.util.AttributeSet; import android.view.View; @@ -23,7 +25,7 @@ import android.view.ViewGroup; // A RotateLayout is designed to display a single item and provides the // capabilities to rotate the item. -public class RotateLayout extends ViewGroup { +public class RotateLayout extends ViewGroup implements Rotatable { private static final String TAG = "RotateLayout"; private int mOrientation; private View mChild; |