diff options
author | Sam Blitzstein <sblitz@google.com> | 2013-04-15 13:07:47 -0700 |
---|---|---|
committer | Sam Blitzstein <sblitz@google.com> | 2013-04-15 15:54:34 -0700 |
commit | d5ec70d18c6379015acd4725b8804ab79f30bfa0 (patch) | |
tree | 53bee1bd5a4b8a3ed54b411da656e01caa817b6f /src/com | |
parent | 51da77ac265fc6e46403bc6f8d3cca57e57427d7 (diff) | |
download | datetimepicker-d5ec70d18c6379015acd4725b8804ab79f30bfa0.tar.gz |
Timepicker UI fixes to be more consistent with date picker.
Bug: 8616937
Change-Id: Ic16c311e74e3f0da4d266232334118b8cb428320
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/datetimepicker/time/AmPmCirclesView.java | 17 | ||||
-rw-r--r-- | src/com/android/datetimepicker/time/RadialSelectorView.java | 2 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/datetimepicker/time/AmPmCirclesView.java b/src/com/android/datetimepicker/time/AmPmCirclesView.java index 6890bb6..8221365 100644 --- a/src/com/android/datetimepicker/time/AmPmCirclesView.java +++ b/src/com/android/datetimepicker/time/AmPmCirclesView.java @@ -35,6 +35,11 @@ import java.text.DateFormatSymbols; public class AmPmCirclesView extends View { private static final String TAG = "AmPmCirclesView"; + // Alpha level of blue color for selected circle. + private static final int SELECTED_ALPHA = 51; + // Alpha level of blue color for pressed circle. + private static final int PRESSED_ALPHA = 175; + private final Paint mPaint = new Paint(); private int mWhite; private int mAmPmTextColor; @@ -138,7 +143,7 @@ public class AmPmCirclesView extends View { int circleRadius = (int) (Math.min(layoutXCenter, layoutYCenter) * mCircleRadiusMultiplier); mAmPmCircleRadius = (int) (circleRadius * mAmPmCircleRadiusMultiplier); - int textSize = mAmPmCircleRadius * 2 / 3; + int textSize = mAmPmCircleRadius * 3 / 4; mPaint.setTextSize(textSize); // Line up the vertical center of the AM/PM circles with the bottom of the main circle. @@ -151,7 +156,7 @@ public class AmPmCirclesView extends View { mDrawValuesReady = true; } - // We'll need to draw either a ligther blue (for selection), a darker blue (for touching) + // We'll need to draw either a lighter blue (for selection), a darker blue (for touching) // or white (for not selected). int amColor = mWhite; int amAlpha = 255; @@ -159,17 +164,17 @@ public class AmPmCirclesView extends View { int pmAlpha = 255; if (mAmOrPm == AM) { amColor = mBlue; - amAlpha = 60; + amAlpha = SELECTED_ALPHA; } else if (mAmOrPm == PM) { pmColor = mBlue; - pmAlpha = 60; + pmAlpha = SELECTED_ALPHA; } if (mAmOrPmPressed == AM) { amColor = mBlue; - amAlpha = 175; + amAlpha = PRESSED_ALPHA; } else if (mAmOrPmPressed == PM) { pmColor = mBlue; - pmAlpha = 175; + pmAlpha = PRESSED_ALPHA; } // Draw the two circles. diff --git a/src/com/android/datetimepicker/time/RadialSelectorView.java b/src/com/android/datetimepicker/time/RadialSelectorView.java index 8fee657..d987e7b 100644 --- a/src/com/android/datetimepicker/time/RadialSelectorView.java +++ b/src/com/android/datetimepicker/time/RadialSelectorView.java @@ -277,7 +277,7 @@ public class RadialSelectorView extends View { int pointY = mYCenter - (int) (mLineLength * Math.cos(mSelectionRadians)); // Draw the selection circle. - mPaint.setAlpha(60); + mPaint.setAlpha(51); canvas.drawCircle(pointX, pointY, mSelectionRadius, mPaint); if (mForceDrawDot | mSelectionDegrees % 30 != 0) { |