Ported numpad

This commit is contained in:
Phillip Hsu
2016-06-02 20:16:37 -07:00
parent 680fd28782
commit 881b4dcf83
15 changed files with 927 additions and 4 deletions
@@ -74,7 +74,7 @@
android:layout_centerVertical="true"/>
<!-- TODO: Find out how to get a touch ripple; foreground attr didn't work -->
<EditText
<com.philliphsu.clock2.editalarm.AlarmEditText
android:id="@+id/input_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -191,4 +191,14 @@
</ScrollView>
<com.philliphsu.clock2.editalarm.AlarmNumpad
android:id="@+id/numpad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:elevation="4dp"
android:layout_alignParentBottom="true"
android:visibility="gone"/>
</RelativeLayout>
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<!--
~ The children of a TableLayout cannot specify the layout_width attribute.
~ Width is always MATCH_PARENT. However, the layout_height attribute can be
~ defined by a child; default value is WRAP_CONTENT. If the child is a
~ TableRow, then the height is always WRAP_CONTENT.
-->
<TableRow>
<Button style="@style/NumberButton"
android:id="@+id/one"
android:text="@string/one"/>
<Button style="@style/NumberButton"
android:id="@+id/two"
android:text="@string/two"/>
<Button style="@style/NumberButton"
android:id="@+id/three"
android:text="@string/three"/>
</TableRow>
<TableRow>
<Button style="@style/NumberButton"
android:id="@+id/four"
android:text="@string/four"/>
<Button style="@style/NumberButton"
android:id="@+id/five"
android:text="@string/five"/>
<Button style="@style/NumberButton"
android:id="@+id/six"
android:text="@string/six"/>
</TableRow>
<TableRow>
<Button style="@style/NumberButton"
android:id="@+id/seven"
android:text="@string/seven"/>
<Button style="@style/NumberButton"
android:id="@+id/eight"
android:text="@string/eight"/>
<Button style="@style/NumberButton"
android:id="@+id/nine"
android:text="@string/nine"/>
</TableRow>
<TableRow>
<Space android:layout_weight="1"
android:layout_height="match_parent"/>
<Button style="@style/NumberButton"
android:id="@+id/zero"
android:text="@string/zero"/>
<Space android:layout_weight="1"
android:layout_height="match_parent"/>
</TableRow>
</merge>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Button style="@style/NumberButton"/>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/NumberButton"
android:src="@drawable/ic_backspace_24dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:id="@+id/backspace"/>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/NumberButton"
android:padding="0dp"
android:background="@android:color/transparent">
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_done_24dp"
android:layout_gravity="center"
android:clickable="true"/>
</FrameLayout>