summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2011-09-15 08:16:16 +0800
committerAngus Kong <shkong@google.com>2011-09-15 08:47:53 +0800
commitfa959aede9b1fe9d510108e883a2f16cf28c9033 (patch)
tree29c00a6311e47d40c631a578853a2f43bbeef154 /src
parent48ccad73c132753904a08651ce04cdb27377ef28 (diff)
downloadLegacyCamera-fa959aede9b1fe9d510108e883a2f16cf28c9033.zip
LegacyCamera-fa959aede9b1fe9d510108e883a2f16cf28c9033.tar.gz
LegacyCamera-fa959aede9b1fe9d510108e883a2f16cf28c9033.tar.bz2
The panning indicator turns red when too fast.
bug:5244268 Change-Id: I095c5aec9583885e86960d0e446328ca86e3dcb9
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/panorama/PanoProgressBar.java14
-rw-r--r--src/com/android/camera/panorama/PanoramaActivity.java9
2 files changed, 18 insertions, 5 deletions
diff --git a/src/com/android/camera/panorama/PanoProgressBar.java b/src/com/android/camera/panorama/PanoProgressBar.java
index a8a3b68..e575b75 100644
--- a/src/com/android/camera/panorama/PanoProgressBar.java
+++ b/src/com/android/camera/panorama/PanoProgressBar.java
@@ -66,10 +66,12 @@ class PanoProgressBar extends ImageView {
}
private void setDirection(int direction) {
- int prev = mDirection;
- mDirection = direction;
- if (prev != mDirection && mListener != null) {
- mListener.onDirectionChange(mDirection);
+ if (mDirection != direction) {
+ mDirection = direction;
+ if (mListener != null) {
+ mListener.onDirectionChange(mDirection);
+ }
+ invalidate();
}
}
@@ -79,14 +81,17 @@ class PanoProgressBar extends ImageView {
public void setBackgroundColor(int color) {
mBackgroundPaint.setColor(color);
+ invalidate();
}
public void setDoneColor(int color) {
mDoneAreaPaint.setColor(color);
+ invalidate();
}
public void setIndicatorColor(int color) {
mIndicatorPaint.setColor(color);
+ invalidate();
}
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
@@ -101,6 +106,7 @@ class PanoProgressBar extends ImageView {
public void setIndicatorWidth(float w) {
mIndicatorWidth = w;
+ invalidate();
}
public void setRightIncreasing(boolean rightIncreasing) {
diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java
index 53f3e15..00613c7 100644
--- a/src/com/android/camera/panorama/PanoramaActivity.java
+++ b/src/com/android/camera/panorama/PanoramaActivity.java
@@ -121,6 +121,9 @@ public class PanoramaActivity extends Activity implements
private String mDialogTitle;
private String mDialogOk;
+ private int mIndicatorColor;
+ private int mIndicatorColorFast;
+
private float mCompassValueX;
private float mCompassValueY;
private float mCompassValueXStart;
@@ -560,6 +563,7 @@ public class PanoramaActivity extends Activity implements
private void showTooFastIndication() {
mTooFastPrompt.setVisibility(View.VISIBLE);
mFastIndicationBorder.setVisibility(View.VISIBLE);
+ mPanoProgressBar.setIndicatorColor(mIndicatorColorFast);
mLeftIndicator.setEnabled(true);
mRightIndicator.setEnabled(true);
}
@@ -567,6 +571,7 @@ public class PanoramaActivity extends Activity implements
private void hideTooFastIndication() {
mTooFastPrompt.setVisibility(View.GONE);
mFastIndicationBorder.setVisibility(View.GONE);
+ mPanoProgressBar.setIndicatorColor(mIndicatorColor);
mLeftIndicator.setEnabled(false);
mRightIndicator.setEnabled(false);
}
@@ -596,7 +601,9 @@ public class PanoramaActivity extends Activity implements
mPanoProgressBar = (PanoProgressBar) findViewById(R.id.pano_pan_progress_bar);
mPanoProgressBar.setBackgroundColor(appRes.getColor(R.color.pano_progress_empty));
mPanoProgressBar.setDoneColor(appRes.getColor(R.color.pano_progress_done));
- mPanoProgressBar.setIndicatorColor(appRes.getColor(R.color.pano_progress_indication));
+ mIndicatorColor = appRes.getColor(R.color.pano_progress_indication);
+ mIndicatorColorFast = appRes.getColor(R.color.pano_progress_indication_fast);
+ mPanoProgressBar.setIndicatorColor(mIndicatorColor);
mPanoProgressBar.setOnDirectionChangeListener(
new PanoProgressBar.OnDirectionChangeListener () {
@Override