Create new time picker dialog each time as needed

This commit is contained in:
Phillip Hsu
2016-07-15 17:12:25 -07:00
parent 0f32215145
commit c3b018f59e
4 changed files with 126 additions and 23 deletions
@@ -5,24 +5,29 @@
<ImageButton
android:id="@+id/backspace"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_width="@dimen/header_height"
android:layout_height="@dimen/header_height"
android:src="@drawable/ic_backspace_24dp"
android:background="?selectableItemBackground"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"/>
<!-- TODO: Consider changing to TextView if you don't
want the cursor after all. A reason you may want to do
so is the cursor is getting cut off, most likely because
of the text size being larger than the view bounds. You can
probably solve this by adding some padding. Another reason is
the cursor looks ugly with it blinking. -->
<EditText
android:id="@+id/input"
android:layout_width="wrap_content"
android:layout_height="72dp"
android:layout_height="@dimen/header_height"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:background="@android:color/transparent"
android:textSize="40sp"
android:textSize="@dimen/time_input_text_size"
android:focusable="false"
android:focusableInTouchMode="false"
android:cursorVisible="true"/>
android:focusableInTouchMode="false"/>
<View
android:id="@+id/divider"
@@ -31,13 +36,10 @@
android:background="?android:listDivider"
android:layout_below="@id/input"/>
<!-- TODO: Your height attr is being ignored because
you constrained this below and above the header and
footer views -->
<com.philliphsu.clock2.editalarm.NumpadTimePicker
android:id="@+id/number_grid"
android:layout_width="match_parent"
android:layout_height="270dp"
android:layout_height="@dimen/numpad_height"
android:layout_below="@id/divider"/>
<LinearLayout
+5
View File
@@ -11,4 +11,9 @@
<dimen name="alarm_time_text_size">48sp</dimen>
<dimen name="app_bar_height">180dp</dimen>
<dimen name="text_margin">16dp</dimen>
<!-- NumpadTimePickerDialog -->
<dimen name="header_height">72dp</dimen>
<dimen name="numpad_height">270dp</dimen>
<dimen name="time_input_text_size">40sp</dimen>
</resources>