Commit d5ec70d1 authored by Sam Blitzstein's avatar Sam Blitzstein
Browse files

Timepicker UI fixes to be more consistent with date picker.

Bug: 8616937
Change-Id: Ic16c311e74e3f0da4d266232334118b8cb428320
parent 51da77ac
......@@ -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"
......
......@@ -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
......@@ -15,8 +15,6 @@
-->
<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>
<?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
......@@ -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
......@@ -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" />
......
......@@ -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.
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment