diff options
author | Chih-yu Huang <akahuang@google.com> | 2011-10-07 04:01:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-07 04:01:47 -0700 |
commit | d534023dbdb0470163f79aa40beb1f00b28fe378 (patch) | |
tree | 72d577cbeea607b270693847de1577101f15f4b8 /src | |
parent | c5bc067250fad1a246ea22604260d01aab627ba4 (diff) | |
parent | 94ca8baae7e6e3885d895c095890eabf30d922e2 (diff) | |
download | LegacyCamera-d534023dbdb0470163f79aa40beb1f00b28fe378.zip LegacyCamera-d534023dbdb0470163f79aa40beb1f00b28fe378.tar.gz LegacyCamera-d534023dbdb0470163f79aa40beb1f00b28fe378.tar.bz2 |
Merge "Let review icons rotatable."
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/Camera.java | 13 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 18 | ||||
-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 |
5 files changed, 55 insertions, 9 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index d35bb4a..760fe28 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -19,6 +19,7 @@ package com.android.camera; import com.android.camera.ui.CameraPicker; import com.android.camera.ui.FaceView; import com.android.camera.ui.IndicatorControlContainer; +import com.android.camera.ui.Rotatable; import com.android.camera.ui.RotateImageView; import com.android.camera.ui.RotateLayout; import com.android.camera.ui.SharePopup; @@ -154,6 +155,8 @@ public class Camera extends ActivityBase implements FocusManager.Listener, private ModePicker mModePicker; private FaceView mFaceView; private RotateLayout mFocusIndicator; + private Rotatable mReviewCancelButton; + private Rotatable mReviewDoneButton; // mCropValue and mSaveUri are used only if isImageCaptureIntent() is true. private String mCropValue; @@ -981,6 +984,8 @@ public class Camera extends ActivityBase implements FocusManager.Listener, mIsImageCaptureIntent = isImageCaptureIntent(); setContentView(R.layout.camera); if (mIsImageCaptureIntent) { + mReviewDoneButton = (Rotatable) findViewById(R.id.btn_done); + mReviewCancelButton = (Rotatable) findViewById(R.id.btn_cancel); findViewById(R.id.btn_cancel).setVisibility(View.VISIBLE); } else { mThumbnailView = (RotateImageView) findViewById(R.id.thumbnail); @@ -1181,6 +1186,8 @@ public class Camera extends ActivityBase implements FocusManager.Listener, if (mZoomControl != null) mZoomControl.setDegree(degree); if (mFocusIndicator != null) mFocusIndicator.setOrientation(degree); if (mFaceView != null) mFaceView.setOrientation(degree); + if (mReviewCancelButton != null) mReviewCancelButton.setOrientation(degree); + if (mReviewDoneButton != null) mReviewDoneButton.setOrientation(degree); } @Override @@ -1208,18 +1215,18 @@ public class Camera extends ActivityBase implements FocusManager.Listener, } @OnClickAttr - public void onRetakeButtonClicked(View v) { + public void onReviewRetakeClicked(View v) { hidePostCaptureAlert(); startPreview(); } @OnClickAttr - public void onDoneButtonClicked(View v) { + public void onReviewDoneClicked(View v) { doAttach(); } @OnClickAttr - public void onCancelButtonClicked(View v) { + public void onReviewCancelClicked(View v) { doCancel(); } diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index aa90f55..a880a01 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -19,6 +19,7 @@ package com.android.camera; import com.android.camera.ui.CameraPicker; import com.android.camera.ui.IndicatorControlContainer; import com.android.camera.ui.IndicatorControlWheelContainer; +import com.android.camera.ui.Rotatable; import com.android.camera.ui.RotateImageView; import com.android.camera.ui.RotateLayout; import com.android.camera.ui.SharePopup; @@ -158,6 +159,9 @@ public class VideoCamera extends ActivityBase private Thumbnail mThumbnail; // An imageview showing showing the last captured picture thumbnail. private RotateImageView mThumbnailView; + private Rotatable mReviewCancelButton; + private Rotatable mReviewDoneButton; + private Rotatable mReviewPlayButton; private ModePicker mModePicker; private ShutterButton mShutterButton; private TextView mRecordingTimeView; @@ -376,6 +380,9 @@ public class VideoCamera extends ActivityBase mIsVideoCaptureIntent = isVideoCaptureIntent(); setContentView(R.layout.video_camera); if (mIsVideoCaptureIntent) { + mReviewDoneButton = (Rotatable) findViewById(R.id.btn_done); + mReviewPlayButton = (Rotatable) findViewById(R.id.btn_play); + mReviewCancelButton = (Rotatable) findViewById(R.id.btn_cancel); findViewById(R.id.btn_cancel).setVisibility(View.VISIBLE); } else { initThumbnailButton(); @@ -534,6 +541,9 @@ public class VideoCamera extends ActivityBase if (mModePicker != null) mModePicker.setDegree(degree); if (mSharePopup != null) mSharePopup.setOrientation(degree); if (mIndicatorControlContainer != null) mIndicatorControlContainer.setDegree(degree); + if (mReviewDoneButton != null) mReviewDoneButton.setOrientation(degree); + if (mReviewPlayButton != null) mReviewPlayButton.setOrientation(degree); + if (mReviewCancelButton!= null) mReviewCancelButton.setOrientation(degree); // We change the orientation of the linearlayout only for phone UI because when in portrait // the width is not enough. if (mLabelsLinearLayout != null) { @@ -563,23 +573,23 @@ public class VideoCamera extends ActivityBase } @OnClickAttr - public void onRetakeButtonClicked(View v) { + public void onReviewRetakeClicked(View v) { deleteCurrentVideo(); hideAlert(); } @OnClickAttr - public void onPlayButtonClicked(View v) { + public void onReviewPlayClicked(View v) { startPlayVideoActivity(); } @OnClickAttr - public void onDoneButtonClicked(View v) { + public void onReviewDoneClicked(View v) { doReturnToCaller(true); } @OnClickAttr - public void onCancelButtonClicked(View v) { + public void onReviewCancelClicked(View v) { stopVideoRecording(); doReturnToCaller(false); } 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; |