From 3e0ae4cf60e8735049aa9a276bc3c4b911537471 Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Tue, 14 Dec 2010 19:10:07 +0800 Subject: Ring lights up around preview frame to indicate time lapse mode. bug:3278551 Change-Id: Ib2acf5266f256a47bd1b5eb29c9d96c518b0a0bc --- res/drawable-hdpi/border_preview_time_lapse.9.png | Bin 0 -> 447 bytes res/drawable-mdpi/border_preview_time_lapse.9.png | Bin 0 -> 447 bytes src/com/android/camera/VideoCamera.java | 19 ++++++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 res/drawable-hdpi/border_preview_time_lapse.9.png create mode 100644 res/drawable-mdpi/border_preview_time_lapse.9.png diff --git a/res/drawable-hdpi/border_preview_time_lapse.9.png b/res/drawable-hdpi/border_preview_time_lapse.9.png new file mode 100644 index 0000000..495a986 Binary files /dev/null and b/res/drawable-hdpi/border_preview_time_lapse.9.png differ diff --git a/res/drawable-mdpi/border_preview_time_lapse.9.png b/res/drawable-mdpi/border_preview_time_lapse.9.png new file mode 100644 index 0000000..495a986 Binary files /dev/null and b/res/drawable-mdpi/border_preview_time_lapse.9.png differ diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 725f133..62984dc 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -183,6 +183,7 @@ public class VideoCamera extends NoSearchActivity // Default 0. If it is larger than 0, the camcorder is in time lapse mode. private int mTimeBetweenTimeLapseFrameCaptureMs = 0; private View mTimeLapseLabel; + private View mPreviewBorder; private int mDesiredPreviewWidth; private int mDesiredPreviewHeight; @@ -381,6 +382,7 @@ public class VideoCamera extends NoSearchActivity mRecordingTimeView = (TextView) findViewById(R.id.recording_time); mOrientationListener = new MyOrientationEventListener(VideoCamera.this); mTimeLapseLabel = findViewById(R.id.time_lapse_label); + mPreviewBorder = findViewById(R.id.preview_border); // Make sure preview is started. try { @@ -393,7 +395,7 @@ public class VideoCamera extends NoSearchActivity // ignore } - showTimeLapseLabel(mCaptureTimeLapse); + showTimeLapseUI(mCaptureTimeLapse); resizeForPreviewAspectRatio(); mBackCameraId = CameraHolder.instance().getBackCameraId(); @@ -1852,13 +1854,20 @@ public class VideoCamera extends NoSearchActivity setCameraParameters(); } } - showTimeLapseLabel(mCaptureTimeLapse); + showTimeLapseUI(mCaptureTimeLapse); } } - private void showTimeLapseLabel(boolean enable) { - if (mTimeLapseLabel == null) return; - mTimeLapseLabel.setVisibility(enable ? View.VISIBLE : View.INVISIBLE); + private void showTimeLapseUI(boolean enable) { + if (mTimeLapseLabel != null) { + mTimeLapseLabel.setVisibility(enable ? View.VISIBLE : View.INVISIBLE); + } + if (mPreviewBorder != null) { + mPreviewBorder.setBackgroundResource(enable + ? R.drawable.border_preview_time_lapse + : R.drawable.border_preview); + } + } private class MyControlPanelListener implements ControlPanel.Listener { -- cgit v1.1