diff --git a/app/src/main/java/com/philliphsu/clock2/editalarm/NumberGridTimePickerDialog.java b/app/src/main/java/com/philliphsu/clock2/editalarm/NumberGridTimePickerDialog.java index 4dddafa..da5e33d 100644 --- a/app/src/main/java/com/philliphsu/clock2/editalarm/NumberGridTimePickerDialog.java +++ b/app/src/main/java/com/philliphsu/clock2/editalarm/NumberGridTimePickerDialog.java @@ -161,9 +161,8 @@ public class NumberGridTimePickerDialog extends BaseTimePickerDialog implements // } else if (currentHalfDay == HALF_DAY_2) { // currentHalfDay = HALF_DAY_1; // } - updateAmPmDisplay(halfDay); + updateHalfDay(halfDay); mTimePicker.setAmOrPm(halfDay); - updateHalfDayTogglesState(halfDay); } } @@ -396,7 +395,6 @@ public class NumberGridTimePickerDialog extends BaseTimePickerDialog implements separatorView.setLayoutParams(paramsSeparator); } else { mAmPmTextView.setVisibility(View.VISIBLE); - updateAmPmDisplay(mInitialHourOfDay < 12? AM : PM); mAmPmHitspace.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -407,7 +405,7 @@ public class NumberGridTimePickerDialog extends BaseTimePickerDialog implements } else if (amOrPm == PM){ amOrPm = AM; } - updateAmPmDisplay(amOrPm); + updateHalfDay(amOrPm); mTimePicker.setAmOrPm(amOrPm); } }); @@ -491,7 +489,9 @@ public class NumberGridTimePickerDialog extends BaseTimePickerDialog implements // mThemeDark? android.R.attr.textColorPrimaryInverse : android.R.attr.textColorPrimary); mHalfDayToggleUnselectedColor = ContextCompat.getColor(getContext(), mThemeDark? R.color.text_color_primary_dark : R.color.text_color_primary_light); - updateHalfDayTogglesState(mTimePicker.getIsCurrentlyAmOrPm()); + + // Update the half day at the end when the state colors have been initialized + updateHalfDay(mInitialHourOfDay < 12? AM : PM); return view; } @@ -511,6 +511,11 @@ public class NumberGridTimePickerDialog extends BaseTimePickerDialog implements // mHapticFeedbackController.tryVibrate(); } + private void updateHalfDay(int halfDay) { + updateAmPmDisplay(halfDay); + updateHalfDayTogglesState(halfDay); + } + private void updateAmPmDisplay(int amOrPm) { if (amOrPm == AM) { mAmPmTextView.setText(mAmText); @@ -579,8 +584,7 @@ public class NumberGridTimePickerDialog extends BaseTimePickerDialog implements setMinute(newValue); mTimePicker.setContentDescription(mMinutePickerDescription + ": " + newValue); } else if (pickerIndex == AMPM_INDEX) { - updateAmPmDisplay(newValue); - updateHalfDayTogglesState(newValue); + updateHalfDay(newValue); } else if (pickerIndex == ENABLE_PICKER_INDEX) { if (!isTypedTimeFullyLegal()) { mTypedTimes.clear(); diff --git a/app/src/main/res/layout-land/dialog_time_picker_number_grid.xml b/app/src/main/res/layout-land/dialog_time_picker_number_grid.xml new file mode 100644 index 0000000..3e2c68a --- /dev/null +++ b/app/src/main/res/layout-land/dialog_time_picker_number_grid.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/dialog_time_picker_numpad.xml b/app/src/main/res/layout-land/dialog_time_picker_numpad.xml new file mode 100644 index 0000000..48b45ea --- /dev/null +++ b/app/src/main/res/layout-land/dialog_time_picker_numpad.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_time_picker_number_grid.xml b/app/src/main/res/layout/dialog_time_picker_number_grid.xml index d1629ac..bb5062c 100644 --- a/app/src/main/res/layout/dialog_time_picker_number_grid.xml +++ b/app/src/main/res/layout/dialog_time_picker_number_grid.xml @@ -3,13 +3,12 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="wrap_content"> - - + android:layout_height="wrap_content" + android:orientation="vertical"> + style="@style/Divider.Horizontal"/> - + diff --git a/app/src/main/res/values-land/aosp_datetimepicker_dimens.xml b/app/src/main/res/values-land/aosp_datetimepicker_dimens.xml new file mode 100644 index 0000000..5d0f23c --- /dev/null +++ b/app/src/main/res/values-land/aosp_datetimepicker_dimens.xml @@ -0,0 +1,23 @@ + + + + + 252dp + 250dip + + \ No newline at end of file diff --git a/app/src/main/res/values-land/dimens.xml b/app/src/main/res/values-land/dimens.xml new file mode 100644 index 0000000..4974863 --- /dev/null +++ b/app/src/main/res/values-land/dimens.xml @@ -0,0 +1,22 @@ + + 24sp + + + 300dp + 64dp + 80dp + 344dp + 88dp + 0dp + + + + 220dp + 55dp + 44dp + + 64dp + 30sp + 20sp + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 430df77..1c2b210 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -12,9 +12,8 @@ 180dp 16dp - 28sp + 34sp 40dp - 17sp 300dp @@ -26,7 +25,7 @@ 308dp - 70dp + 70dp 56dp 48dp 30sp diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c119598..0e7ad0b 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -43,7 +43,7 @@