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 | |
parent | 51da77ac265fc6e46403bc6f8d3cca57e57427d7 (diff) | |
download | datetimepicker-d5ec70d18c6379015acd4725b8804ab79f30bfa0.tar.gz |
Timepicker UI fixes to be more consistent with date picker.
Bug: 8616937
Change-Id: Ic16c311e74e3f0da4d266232334118b8cb428320
-rw-r--r-- | res/layout/time_header_label.xml | 12 | ||||
-rw-r--r-- | res/values-sw600dp/dimens.xml | 2 | ||||
-rw-r--r-- | res/values-v16/strings.xml | 2 | ||||
-rw-r--r-- | res/values-v17/styles.xml | 22 | ||||
-rw-r--r-- | res/values/colors.xml | 13 | ||||
-rw-r--r-- | res/values/styles.xml | 7 | ||||
-rw-r--r-- | src/com/android/datetimepicker/time/AmPmCirclesView.java | 17 | ||||
-rw-r--r-- | src/com/android/datetimepicker/time/RadialSelectorView.java | 2 |
8 files changed, 30 insertions, 47 deletions
diff --git a/res/layout/time_header_label.xml b/res/layout/time_header_label.xml index 62a2ac5..6062678 100644 --- a/res/layout/time_header_label.xml +++ b/res/layout/time_header_label.xml @@ -20,11 +20,14 @@ android:layout_gravity="center" android:background="@color/white" > <View - android:id="@+id/empty_view" + android:id="@+id/center_view" android:layout_width="1dp" android:layout_height="1dp" android:background="#00000000" - android:layout_centerInParent="true" /> + android:layout_centerInParent="true" + android:visibility="invisible" + android:importantForAccessibility="no" /> + <TextView android:id="@+id/hour_space" android:layout_width="wrap_content" @@ -53,6 +56,7 @@ android:layout_gravity="center" style="@style/time_label" /> </FrameLayout> + <TextView android:id="@+id/separator" android:layout_width="wrap_content" @@ -60,10 +64,11 @@ android:text="@string/time_separator" android:paddingLeft="@dimen/separator_padding" android:paddingRight="@dimen/separator_padding" - android:layout_alignRight="@+id/empty_view" + android:layout_alignRight="@+id/center_view" android:layout_centerVertical="true" style="@style/time_label" android:importantForAccessibility="no" /> + <TextView android:id="@+id/minutes_space" android:layout_width="wrap_content" @@ -91,6 +96,7 @@ android:text="@string/time_placeholder" android:layout_gravity="center" /> </FrameLayout> + <com.android.datetimepicker.FakeButton android:id="@+id/ampm_hitspace" android:layout_width="@dimen/ampm_label_size" diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml index db3abb4..d42e1ae 100644 --- a/res/values-sw600dp/dimens.xml +++ b/res/values-sw600dp/dimens.xml @@ -48,6 +48,6 @@ <dimen name="footer_height">60dip</dimen> <dimen name="minimum_margin_sides">48dip</dimen> <dimen name="minimum_margin_top_bottom">24dip</dimen> - <dimen name="picker_dimen">375dip</dimen> + <dimen name="picker_dimen">400dip</dimen> </resources>
\ No newline at end of file diff --git a/res/values-v16/strings.xml b/res/values-v16/strings.xml index 9c24262..fb40bf1 100644 --- a/res/values-v16/strings.xml +++ b/res/values-v16/strings.xml @@ -16,7 +16,5 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- DO NOT TRANSLATE --> - <string name="radial_numbers_typeface">sans-serif-light</string> - <!-- DO NOT TRANSLATE --> <string name="day_of_week_label_typeface">sans-serif-light</string> </resources> diff --git a/res/values-v17/styles.xml b/res/values-v17/styles.xml deleted file mode 100644 index 043fe71..0000000 --- a/res/values-v17/styles.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2013 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<resources xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- Style for dialog labels. --> - <style name="time_label_thin"> - <item name="android:fontFamily">sans-serif-thin</item> - </style> -</resources>
\ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index 01117e5..23afd47 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -17,11 +17,11 @@ <resources> <color name="white">#ffffff</color> - <color name="circle_background">#08000000</color> - <color name="line_background">#33000000</color> - <color name="ampm_text_color">#7F000000</color> - <color name="done_text_color">#99000000</color> - <color name="numbers_text_color">#CC000000</color> + <color name="circle_background">#f2f2f2</color> + <color name="line_background">#cccccc</color> + <color name="ampm_text_color">#8c8c8c</color> + <color name="done_text_color">#8c8c8c</color> + <color name="numbers_text_color">#8c8c8c</color> <color name="transparent_black">#7F000000</color> <color name="blue">#33b5e5</color> @@ -29,7 +29,6 @@ <color name="date_picker_text_normal">#FF999999</color> <color name="calendar_header">#999999</color> - <color name="date_picker_view_animator">#FFECEDEE</color> + <color name="date_picker_view_animator">#f2f2f2</color> <color name="calendar_selected_date_text">#FFD1D2D4</color> - <color name="done_button_color">#FFECEDEE</color> </resources>
\ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml index af53509..2fa8c12 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -33,11 +33,7 @@ <!-- All customizations that are NOT specific to a particular API-level can go here. --> </style> - <!-- Styles for dialog labels. --> - <style name="time_label_thin" /> - <style name="done_button_light" /> - - <style name="time_label" parent="time_label_thin"> + <style name="time_label"> <item name="android:textSize">@dimen/time_label_size</item> <item name="android:textColor">@color/numbers_text_color</item> </style> @@ -46,6 +42,7 @@ <item name="android:textSize">@dimen/ampm_label_size</item> <item name="android:textAllCaps">true</item> <item name="android:textColor">@color/ampm_text_color</item> + <item name="android:textStyle">bold</item> </style> <style name="day_of_week_label_condensed" /> 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) { |