Created landscape layout for numeric keypad picker

This commit is contained in:
Phillip Hsu 2016-08-24 03:34:59 -07:00
parent 2d4d661d7f
commit 841a54e3f5
4 changed files with 23 additions and 20 deletions

View File

@ -2,15 +2,16 @@
<!-- TOneverDO: Use LinearLayout as root container when the <!-- TOneverDO: Use LinearLayout as root container when the
dialog is a DialogFragment (or a subclass of), or else LWM dialog is a DialogFragment (or a subclass of), or else LWM
doesn't work. --> doesn't work. -->
<RelativeLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView <TextView
android:id="@+id/input_time" android:id="@+id/input_time"
android:layout_width="match_parent" android:layout_width="@dimen/left_side_width"
android:layout_height="@dimen/numeric_keypad_output_box_height" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:textSize="@dimen/text_size_display_3" android:textSize="@dimen/text_size_display_3"
android:fontFamily="sans-serif" android:fontFamily="sans-serif"
@ -21,11 +22,11 @@ doesn't work. -->
<com.philliphsu.clock2.editalarm.NumpadTimePicker <com.philliphsu.clock2.editalarm.NumpadTimePicker
android:id="@+id/number_grid" android:id="@+id/number_grid"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="@dimen/numeric_keypad_height" android:layout_height="match_parent"
android:layout_below="@id/input_time" android:layout_weight="1"
android:layout_marginTop="@dimen/bottom_sheet_vertical_space" android:layout_marginTop="@dimen/bottom_sheet_vertical_space"
android:layout_marginStart="@dimen/bottom_sheet_edge_margin" android:layout_marginStart="@dimen/bottom_sheet_edge_margin"
android:layout_marginEnd="@dimen/bottom_sheet_edge_margin"/> android:layout_marginEnd="@dimen/bottom_sheet_edge_margin"/>
</RelativeLayout> </LinearLayout>

View File

@ -2,10 +2,11 @@
<!-- TOneverDO: Use LinearLayout as root container when the <!-- TOneverDO: Use LinearLayout as root container when the
dialog is a DialogFragment (or a subclass of), or else LWM dialog is a DialogFragment (or a subclass of), or else LWM
doesn't work. --> doesn't work. -->
<RelativeLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/input_time" android:id="@+id/input_time"
@ -28,4 +29,4 @@ doesn't work. -->
android:layout_marginStart="@dimen/bottom_sheet_edge_margin" android:layout_marginStart="@dimen/bottom_sheet_edge_margin"
android:layout_marginEnd="@dimen/bottom_sheet_edge_margin"/> android:layout_marginEnd="@dimen/bottom_sheet_edge_margin"/>
</RelativeLayout> </LinearLayout>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="numeric_keypad_cell_height">50dp</dimen>
</resources>

View File

@ -2,20 +2,17 @@
<dimen name="grid_element_text_size">24sp</dimen> <dimen name="grid_element_text_size">24sp</dimen>
<!-- NumpadTimePickerDialog --> <!-- NumpadTimePickerDialog -->
<dimen name="numpad_height">300dp</dimen> <!-- TODO: Deprecated --> <dimen name="numeric_keypad_cell_height">42dp</dimen>
<dimen name="numeric_keypad_cell_height">64dp</dimen> <!--<dimen name="numeric_keypad_height">344dp</dimen> &lt;!&ndash; 4 * (numeric_keypad_cell_height) + 88dp pre-21 FAB height &ndash;&gt;-->
<dimen name="numeric_keypad_output_box_height">80dp</dimen> <!--<dimen name="numeric_keypad_backspace_height">88dp</dimen> &lt;!&ndash; Same as pre-21 FAB height &ndash;&gt;-->
<dimen name="numeric_keypad_height">344dp</dimen> <!-- 4 * (numeric_keypad_cell_height) + 88dp pre-21 FAB height --> <!--<dimen name="numeric_keypad_fab_bottom_margin">0dp</dimen> &lt;!&ndash; 88dp height already big enough &ndash;&gt;-->
<dimen name="numeric_keypad_backspace_height">88dp</dimen> <!-- Same as pre-21 FAB height -->
<dimen name="numeric_keypad_fab_bottom_margin">0dp</dimen> <!-- 88dp height already big enough -->
<!-- NumberGridTimePickerDialog --> <!-- NumberGridTimePickerDialog -->
<!--TODO: We don't actually use this. --> <!--<dimen name="number_grid_height">220dp</dimen> &lt;!&ndash; 5 * (number_grid_minute_cell_height) &ndash;&gt;-->
<dimen name="number_grid_height">220dp</dimen> <!-- 5 * (number_grid_minute_cell_height) -->
<dimen name="number_grid_hour_cell_height">55dp</dimen> <!-- 4 * 55 == 5 * (number_grid_minute_cell_height) --> <dimen name="number_grid_hour_cell_height">55dp</dimen> <!-- 4 * 55 == 5 * (number_grid_minute_cell_height) -->
<dimen name="number_grid_minute_cell_height">44dp</dimen> <dimen name="number_grid_minute_cell_height">44dp</dimen>
<!--TODO: Change the height suffix to size or dimen, because this is used as a width in landscape and a height in portrait. --> <!--TODO: Change the height suffix to size or dimen, because this is used as a width in landscape and a height in portrait. -->
<dimen name="half_day_button_bar_height">64dp</dimen> <dimen name="half_day_button_bar_height">72dp</dimen>
<dimen name="number_grid_24_hour_item_primary_text_size">26sp</dimen> <dimen name="number_grid_24_hour_item_primary_text_size">26sp</dimen>
<dimen name="number_grid_minute_text_size">20sp</dimen> <dimen name="number_grid_minute_text_size">20sp</dimen>