Ported numpad
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/colorAccent" android:state_enabled="true"/>
|
||||
<item android:color="@android:color/darker_gray" android:state_enabled="false"/>
|
||||
<item android:color="@android:color/darker_gray"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M22,3H7c-0.69,0 -1.23,0.35 -1.59,0.88L0,12l5.41,8.11c0.36,0.53 0.9,0.89 1.59,0.89h15c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2zm-3,12.59L17.59,17 14,13.41 10.41,17 9,15.59 12.59,12 9,8.41 10.41,7 14,10.59 17.59,7 19,8.41 15.41,12 19,15.59z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
</vector>
|
||||
@@ -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"/>
|
||||
@@ -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>
|
||||
@@ -26,6 +26,22 @@
|
||||
<string name="fri">Fri</string>
|
||||
<string name="sat">Sat</string>
|
||||
<string name="every_day">Every day</string>
|
||||
|
||||
<string name="zero">0</string>
|
||||
<string name="one">1</string>
|
||||
<string name="two">2</string>
|
||||
<string name="three">3</string>
|
||||
<string name="four">4</string>
|
||||
<string name="five">5</string>
|
||||
<string name="six">6</string>
|
||||
<string name="seven">7</string>
|
||||
<string name="eight">8</string>
|
||||
<string name="nine">9</string>
|
||||
<string name="left_alt_24hr">:00</string>
|
||||
<string name="right_alt_24hr">:30</string>
|
||||
<string name="am">AM</string>
|
||||
<string name="pm">PM</string>
|
||||
|
||||
<string name="large_text">
|
||||
"Material is the metaphor.\n\n"
|
||||
|
||||
|
||||
@@ -17,4 +17,13 @@
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
|
||||
|
||||
<style name="NumberButton">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:padding">12dp</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:textSize">28sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user