From fbc5751416caa3a0d065ae15f56d1fb0253552c5 Mon Sep 17 00:00:00 2001 From: Angus Kong Date: Sat, 13 Aug 2011 20:04:19 +0800 Subject: Show "Too Fast" when panning speed is too fast. bug:5141497 Change-Id: Iaff5b7bd05c9b232091f0133a756a5513e5956b3 --- res/layout/pano_capture.xml | 4 ++++ res/values/strings.xml | 3 +++ src/com/android/camera/panorama/CaptureView.java | 6 ------ src/com/android/camera/panorama/PanoramaActivity.java | 11 +++++++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/res/layout/pano_capture.xml b/res/layout/pano_capture.xml index 475e29e..377d7e1 100644 --- a/res/layout/pano_capture.xml +++ b/res/layout/pano_capture.xml @@ -58,4 +58,8 @@ + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 2dc18bd..a2fee59 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -271,6 +271,9 @@ Start + + Too Fast + Tap to focus diff --git a/src/com/android/camera/panorama/CaptureView.java b/src/com/android/camera/panorama/CaptureView.java index eea3043..3b1dd29 100644 --- a/src/com/android/camera/panorama/CaptureView.java +++ b/src/com/android/camera/panorama/CaptureView.java @@ -29,7 +29,6 @@ import android.view.View; class CaptureView extends View { private static final String TAG = "CaptureView"; - private String mStatusText = ""; private int mStartAngle = 0; private int mSweepAngle = 0; private int mWidth; @@ -58,10 +57,6 @@ class CaptureView extends View { mSweepAngle = angle; } - public void setStatusText(String text) { - mStatusText = text; - } - @Override protected void onDraw(Canvas canvas) { mWidth = getWidth(); @@ -69,7 +64,6 @@ class CaptureView extends View { RectF rect = new RectF(mWidth / 2 - 100, 3 * mHeight / 4, mWidth / 2 + 100, 3 * mHeight / 4 + 200); - canvas.drawText(mStatusText, mWidth / 2, mHeight / 2, mPaint); canvas.drawArc(rect, -90 + mStartAngle, mSweepAngle, true, mPaint); canvas.drawArc(rect, -90 - mStartAngle, mSweepAngle > 0 ? 2 : 0, true, mPaint); } diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java index f383b4d..4cefd71 100644 --- a/src/com/android/camera/panorama/PanoramaActivity.java +++ b/src/com/android/camera/panorama/PanoramaActivity.java @@ -49,6 +49,7 @@ import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.ImageView; +import android.widget.TextView; import java.io.ByteArrayOutputStream; import java.util.List; @@ -85,6 +86,7 @@ public class PanoramaActivity extends Activity implements private ImageView mReview; private CaptureView mCaptureView; private MosaicRendererSurfaceView mRealTimeMosaicView; + private TextView mTooFastPrompt; private int mPreviewWidth; private int mPreviewHeight; @@ -298,6 +300,7 @@ public class PanoramaActivity extends Activity implements // Reset values so we can do this again. mTimeTaken = System.currentTimeMillis(); mCaptureState = CAPTURE_MOSAIC; + mTooFastPrompt.setVisibility(View.GONE); mMosaicFrameProcessor.setProgressListener(new MosaicFrameProcessor.ProgressListener() { @Override @@ -351,13 +354,12 @@ public class PanoramaActivity extends Activity implements mRealTimeMosaicView.requestRender(); if (translationRate > 150) { - // TODO: remove the text and draw implications according to the UI - // spec. - mCaptureView.setStatusText("S L O W D O W N"); + // TODO: draw speed indication according to the UI spec. + mTooFastPrompt.setVisibility(View.VISIBLE); mCaptureView.setSweepAngle(Math.max(traversedAngleX, traversedAngleY) + 1); mCaptureView.invalidate(); } else { - mCaptureView.setStatusText(""); + mTooFastPrompt.setVisibility(View.GONE); mCaptureView.setSweepAngle(Math.max(traversedAngleX, traversedAngleY) + 1); mCaptureView.invalidate(); } @@ -374,6 +376,7 @@ public class PanoramaActivity extends Activity implements mCaptureView = (CaptureView) findViewById(R.id.pano_capture_view); mCaptureView.setStartAngle(-DEFAULT_SWEEP_ANGLE / 2); mStopCaptureButton = (Button) findViewById(R.id.pano_capture_stop_button); + mTooFastPrompt = (TextView) findViewById(R.id.pano_capture_too_fast_textview); mReviewLayout = (View) findViewById(R.id.pano_review_layout); mReview = (ImageView) findViewById(R.id.pano_reviewarea); -- cgit v1.1