diff options
author | Chih-yu Huang <akahuang@google.com> | 2011-08-30 17:28:52 +0800 |
---|---|---|
committer | Chih-yu Huang <akahuang@google.com> | 2011-09-02 10:09:40 +0800 |
commit | ea136afa2f4d38428ad486df5fb0a24db8314a3d (patch) | |
tree | 74d6e8aa7db6ad2db3d0e03274ce8eda31e17b99 /src | |
parent | a130350e7481d07b42fbce522196b3350be3be0f (diff) | |
download | packages_apps_LegacyCamera-ea136afa2f4d38428ad486df5fb0a24db8314a3d.zip packages_apps_LegacyCamera-ea136afa2f4d38428ad486df5fb0a24db8314a3d.tar.gz packages_apps_LegacyCamera-ea136afa2f4d38428ad486df5fb0a24db8314a3d.tar.bz2 |
Move review control out of preview.
bug:5141555
Change-Id: I04e4ca0d0e1a40ccfe39e5276fda66ffd02ae1b5
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/Camera.java | 38 | ||||
-rw-r--r-- | src/com/android/camera/Util.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 58 |
3 files changed, 30 insertions, 75 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index c9fe858..1cc45fd 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -955,10 +955,10 @@ public class Camera extends ActivityBase implements FocusManager.Listener, super.onCreate(icicle); mIsImageCaptureIntent = isImageCaptureIntent(); + setContentView(R.layout.camera); if (mIsImageCaptureIntent) { - setContentView(R.layout.camera_attach); + findViewById(R.id.btn_cancel).setVisibility(View.VISIBLE); } else { - setContentView(R.layout.camera); mThumbnailView = (RotateImageView) findViewById(R.id.thumbnail); mThumbnailView.setVisibility(View.VISIBLE); } @@ -1014,7 +1014,6 @@ public class Camera extends ActivityBase implements FocusManager.Listener, if (mIsImageCaptureIntent) { setupCaptureParams(); - findViewById(R.id.review_control).setVisibility(View.VISIBLE); } else { mModePicker = (ModePicker) findViewById(R.id.mode_picker); mModePicker.setVisibility(View.VISIBLE); @@ -1954,42 +1953,27 @@ public class Camera extends ActivityBase implements FocusManager.Listener, private void showPostCaptureAlert() { if (mIsImageCaptureIntent) { - if (Util.isTabletUI()) { - mShutterButton.setEnabled(false); - } else { - mShutterButton.setVisibility(View.GONE); - } + mShutterButton.setVisibility(View.GONE); + mIndicatorControlContainer.setVisibility(View.GONE); + int[] pickIds = {R.id.btn_retake, R.id.btn_done}; for (int id : pickIds) { - View button = findViewById(id); - ((View) button.getParent()).setVisibility(View.VISIBLE); + Util.fadeIn(findViewById(id)); } - - // Remove the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) ((Button) view).setText(""); } } private void hidePostCaptureAlert() { if (mIsImageCaptureIntent) { - if (Util.isTabletUI()) { - mShutterButton.setEnabled(true); - } else { - mShutterButton.setVisibility(View.VISIBLE); - } + enableCameraControls(true); + int[] pickIds = {R.id.btn_retake, R.id.btn_done}; for (int id : pickIds) { - View button = findViewById(id); - ((View) button.getParent()).setVisibility(View.GONE); + (findViewById(id)).setVisibility(View.GONE); } - enableCameraControls(true); - // Restore the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) { - ((Button) view).setText(R.string.review_cancel); - } + Util.fadeIn(mShutterButton); + Util.fadeIn(mIndicatorControlContainer); } } diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index 900764b..a4aac7d 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -40,6 +40,8 @@ import android.view.Display; import android.view.Surface; import android.view.View; import android.view.WindowManager; +import android.view.animation.AlphaAnimation; +import android.view.animation.Animation; import java.io.Closeable; import java.io.IOException; @@ -510,4 +512,11 @@ public class Util { // Keep compatibility context.sendBroadcast(new Intent("com.android.camera.NEW_PICTURE", uri)); } + + public static void fadeIn(View view) { + view.setVisibility(View.VISIBLE); + Animation animation = new AlphaAnimation(0F, 1F); + animation.setDuration(500); + view.startAnimation(animation); + } } diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 132e48b..da25f9d 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -63,8 +63,6 @@ import android.view.SurfaceView; import android.view.View; import android.view.Window; import android.view.WindowManager; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; @@ -378,21 +376,10 @@ public class VideoCamera extends ActivityBase requestWindowFeature(Window.FEATURE_PROGRESS); mIsVideoCaptureIntent = isVideoCaptureIntent(); + setContentView(R.layout.video_camera); if (mIsVideoCaptureIntent) { - setContentView(R.layout.video_camera_attach); - - mReviewControl = findViewById(R.id.review_control); - mReviewControl.setVisibility(View.VISIBLE); - View retake = findViewById(R.id.btn_retake); - if (retake instanceof ImageView) { - ((ImageView) retake).setImageResource(R.drawable.btn_ic_review_retake_video); - } else { - ((Button) retake).setCompoundDrawablesWithIntrinsicBounds( - R.drawable.ic_switch_video_holo_dark, 0, 0, 0); - } + findViewById(R.id.btn_cancel).setVisibility(View.VISIBLE); } else { - setContentView(R.layout.video_camera); - initThumbnailButton(); mModePicker = (ModePicker) findViewById(R.id.mode_picker); mModePicker.setVisibility(View.VISIBLE); @@ -1421,9 +1408,6 @@ public class VideoCamera extends ActivityBase } private void showAlert() { - if (!Util.isTabletUI()) { - fadeOut(findViewById(R.id.shutter_button)); - } if (mCurrentVideoFilename != null) { Bitmap bitmap = Thumbnail.createVideoThumbnail(mCurrentVideoFilename, mPreviewFrameLayout.getWidth()); @@ -1440,54 +1424,32 @@ public class VideoCamera extends ActivityBase mReviewImage.setVisibility(View.VISIBLE); } } + + mShutterButton.setVisibility(View.GONE); + mIndicatorControlContainer.setVisibility(View.GONE); int[] pickIds = {R.id.btn_retake, R.id.btn_done, R.id.btn_play}; for (int id : pickIds) { - View button = findViewById(id); - fadeIn(((View) button.getParent())); + Util.fadeIn(findViewById(id)); } - - // Remove the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) ((Button) view).setText(""); - showTimeLapseUI(false); } private void hideAlert() { mReviewImage.setVisibility(View.INVISIBLE); - fadeIn(findViewById(R.id.shutter_button)); mShutterButton.setEnabled(true); enableCameraControls(true); - // Restore the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) { - ((Button) view).setText(R.string.review_cancel); - } - int[] pickIds = {R.id.btn_retake, R.id.btn_done, R.id.btn_play}; for (int id : pickIds) { - View button = findViewById(id); - ((View) button.getParent()).setVisibility(View.GONE); + (findViewById(id)).setVisibility(View.GONE); } + Util.fadeIn(mShutterButton); + Util.fadeIn(mIndicatorControlContainer); + if (mCaptureTimeLapse) { showTimeLapseUI(true); } } - private static void fadeIn(View view) { - view.setVisibility(View.VISIBLE); - Animation animation = new AlphaAnimation(0F, 1F); - animation.setDuration(500); - view.startAnimation(animation); - } - - private static void fadeOut(View view) { - view.setVisibility(View.INVISIBLE); - Animation animation = new AlphaAnimation(1F, 0F); - animation.setDuration(500); - view.startAnimation(animation); - } - private boolean isAlertVisible() { return this.mReviewImage.getVisibility() == View.VISIBLE; } |