diff options
| author | Angus Kong <shkong@google.com> | 2011-08-13 20:04:19 +0800 |
|---|---|---|
| committer | Angus Kong <shkong@google.com> | 2011-08-19 12:01:39 +0800 |
| commit | fbc5751416caa3a0d065ae15f56d1fb0253552c5 (patch) | |
| tree | 4352b0cf72a7d79fb5e0fb5fdf8fb7abed94adb0 | |
| parent | 1e762b1f935c9d4a06af6dd56121590ca81d48b1 (diff) | |
| download | LegacyCamera-fbc5751416caa3a0d065ae15f56d1fb0253552c5.zip LegacyCamera-fbc5751416caa3a0d065ae15f56d1fb0253552c5.tar.gz LegacyCamera-fbc5751416caa3a0d065ae15f56d1fb0253552c5.tar.bz2 | |
Show "Too Fast" when panning speed is too fast.
bug:5141497
Change-Id: Iaff5b7bd05c9b232091f0133a756a5513e5956b3
| -rw-r--r-- | res/layout/pano_capture.xml | 4 | ||||
| -rw-r--r-- | res/values/strings.xml | 3 | ||||
| -rw-r--r-- | src/com/android/camera/panorama/CaptureView.java | 6 | ||||
| -rw-r--r-- | 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 @@ </LinearLayout> <include layout="@layout/pano_control" android:id="@+id/pano_control_layout" /> + + <TextView android:id="@+id/pano_capture_too_fast_textview" + android:text="@string/pano_too_fast_prompt" + android:layout_centerInParent="true" /> </RelativeLayout> 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 @@ <!-- The text shown on the button for starting panorama capturing [CHAR LIMIT=10] --> <string name="pano_capture_start">Start</string> + <!-- The text shown when the panorama panning speed is to fast [CHAR LIMIT=12] --> + <string name="pano_too_fast_prompt">Too Fast</string> + <!-- Toast telling users tapping on the viewfinder will trigger autofocus [CHAR LIMIT=24] --> <string name="tap_to_focus">Tap to focus</string> </resources> 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); |
