summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2011-10-31 18:50:52 +0800
committerChih-Chung Chang <chihchung@google.com>2011-11-03 15:23:03 +0800
commitda705aa1c8cbaaba105d9bc7799aef95c416a459 (patch)
treebc01f30294462780bfd4b4437b862881b295ece3 /src/com
parent1f56f129d65729705326f4d6852d760e6a5cacf5 (diff)
downloadLegacyCamera-da705aa1c8cbaaba105d9bc7799aef95c416a459.zip
LegacyCamera-da705aa1c8cbaaba105d9bc7799aef95c416a459.tar.gz
LegacyCamera-da705aa1c8cbaaba105d9bc7799aef95c416a459.tar.bz2
Fix 5521540: UI Tweaks.
- draw fan-shaped semi-transparent area on the indicator wheel. - change selected indicator color - remove video mode black border - set activity background to black - update assets - don't gray out unselected modes in mode picker (tablet) - set ok/cancel icons to 32dp, font to 12sp bold Change-Id: Iedc43dca29d1943965caf2d36cce176d8e509547
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/ModePicker.java9
-rw-r--r--src/com/android/camera/PreviewFrameLayout.java7
-rw-r--r--src/com/android/camera/ui/IndicatorControlWheel.java35
3 files changed, 38 insertions, 13 deletions
diff --git a/src/com/android/camera/ModePicker.java b/src/com/android/camera/ModePicker.java
index ccde71d..b79baa5 100644
--- a/src/com/android/camera/ModePicker.java
+++ b/src/com/android/camera/ModePicker.java
@@ -223,10 +223,13 @@ public class ModePicker extends RelativeLayout implements View.OnClickListener,
}
private void updateModeState() {
- // Grey-out the unselected icons.
- for (int i = 0; i < MODE_NUM; ++i) {
- highlightView(mModeSelectionIcon[i], (i == mCurrentMode));
+ // Grey-out the unselected icons for Phone UI.
+ if (mCurrentModeFrame != null) {
+ for (int i = 0; i < MODE_NUM; ++i) {
+ highlightView(mModeSelectionIcon[i], (i == mCurrentMode));
+ }
}
+
// Update the current mode icons on the Phone UI. The selected mode
// should be in the center of the current mode icon bar.
if (mCurrentModeFrame != null) {
diff --git a/src/com/android/camera/PreviewFrameLayout.java b/src/com/android/camera/PreviewFrameLayout.java
index 8429259..c16961a 100644
--- a/src/com/android/camera/PreviewFrameLayout.java
+++ b/src/com/android/camera/PreviewFrameLayout.java
@@ -16,9 +16,12 @@
package com.android.camera;
+import com.android.camera.R;
+
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
+import android.view.View;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
/**
@@ -52,10 +55,10 @@ public class PreviewFrameLayout extends RelativeLayout {
}
public void showBorder(boolean enabled) {
- setActivated(enabled);
+ findViewById(R.id.preview_border).setVisibility(
+ enabled ? View.VISIBLE : View.INVISIBLE);
}
-
@Override
protected void onMeasure(int widthSpec, int heightSpec) {
int previewWidth = MeasureSpec.getSize(widthSpec);
diff --git a/src/com/android/camera/ui/IndicatorControlWheel.java b/src/com/android/camera/ui/IndicatorControlWheel.java
index 5f3d82a..24451a9 100644
--- a/src/com/android/camera/ui/IndicatorControlWheel.java
+++ b/src/com/android/camera/ui/IndicatorControlWheel.java
@@ -24,6 +24,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
+import android.graphics.Path;
import android.graphics.RectF;
import android.os.Handler;
import android.os.SystemClock;
@@ -65,6 +66,7 @@ public class IndicatorControlWheel extends IndicatorControl implements
private static final int TIME_LAPSE_ARC_WIDTH = 6;
private final int HIGHLIGHT_COLOR;
+ private final int HIGHLIGHT_FAN_COLOR;
private final int TIME_LAPSE_ARC_COLOR;
// The center of the shutter button.
@@ -115,6 +117,7 @@ public class IndicatorControlWheel extends IndicatorControl implements
super(context, attrs);
Resources resources = context.getResources();
HIGHLIGHT_COLOR = resources.getColor(R.color.review_control_pressed_color);
+ HIGHLIGHT_FAN_COLOR = resources.getColor(R.color.review_control_pressed_fan_color);
TIME_LAPSE_ARC_COLOR = resources.getColor(R.color.time_lapse_arc);
setWillNotDraw(false);
@@ -420,19 +423,35 @@ public class IndicatorControlWheel extends IndicatorControl implements
@Override
protected void onDraw(Canvas canvas) {
- // Draw highlight.
- float delta = mStrokeWidth * 0.5f;
- float radius = (float) (mWheelRadius + mStrokeWidth * 0.5 + EDGE_STROKE_WIDTH);
- mBackgroundRect.set(mCenterX - radius, mCenterY - radius, mCenterX + radius,
- mCenterY + radius);
-
int selectedIndex = getSelectedIndicatorIndex();
// Draw the highlight arc if an indicator is selected or being pressed.
- if (selectedIndex >= 0) {
+ if (selectedIndex >= 0) {
int degree = (int) Math.toDegrees(mChildRadians[selectedIndex]);
+ float innerR = (float) mShutterButtonRadius;
+ float outerR = (float) (mShutterButtonRadius + mStrokeWidth +
+ EDGE_STROKE_WIDTH * 0.5);
+
+ // Construct the path of the fan-shaped semi-transparent area.
+ Path fanPath = new Path();
+ mBackgroundRect.set(mCenterX - innerR, mCenterY - innerR,
+ mCenterX + innerR, mCenterY + innerR);
+ fanPath.arcTo(mBackgroundRect, -degree + HIGHLIGHT_DEGREES / 2,
+ -HIGHLIGHT_DEGREES);
+ mBackgroundRect.set(mCenterX - outerR, mCenterY - outerR,
+ mCenterX + outerR, mCenterY + outerR);
+ fanPath.arcTo(mBackgroundRect, -degree - HIGHLIGHT_DEGREES / 2,
+ HIGHLIGHT_DEGREES);
+ fanPath.close();
+
mBackgroundPaint.setStrokeWidth(HIGHLIGHT_WIDTH);
- mBackgroundPaint.setStrokeCap(Paint.Cap.ROUND);
+ mBackgroundPaint.setStrokeCap(Paint.Cap.SQUARE);
+ mBackgroundPaint.setStyle(Paint.Style.FILL_AND_STROKE);
+ mBackgroundPaint.setColor(HIGHLIGHT_FAN_COLOR);
+ canvas.drawPath(fanPath, mBackgroundPaint);
+
+ // Draw the highlight edge
+ mBackgroundPaint.setStyle(Paint.Style.STROKE);
mBackgroundPaint.setColor(HIGHLIGHT_COLOR);
canvas.drawArc(mBackgroundRect, -degree - HIGHLIGHT_DEGREES / 2,
HIGHLIGHT_DEGREES, false, mBackgroundPaint);