Created NumberGrid time picker
This commit is contained in:
@@ -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="#8c8c8c"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/>
|
||||
</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="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/>
|
||||
</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="#8c8c8c"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13L7,13v-2h10v2z"/>
|
||||
</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="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13L7,13v-2h10v2z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- TODO: Define another style with LWW and LHW -->
|
||||
<!-- TODO: Use a fixed height so the circular indicator doesn't stretch into an oval. -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="1"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="2"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="3"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="4"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="5"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="6"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="7"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="8"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="9"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="10"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="11"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
app:layout_gravity="center"
|
||||
android:text="12"/>
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- TODO: Define a grid item style with the first 3 attrs-->
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="00"
|
||||
app:secondaryText="12"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="01"
|
||||
app:secondaryText="13"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="02"
|
||||
app:secondaryText="14"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="03"
|
||||
app:secondaryText="15"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="04"
|
||||
app:secondaryText="16"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="05"
|
||||
app:secondaryText="17"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="06"
|
||||
app:secondaryText="18"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="07"
|
||||
app:secondaryText="19"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="08"
|
||||
app:secondaryText="20"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="09"
|
||||
app:secondaryText="21"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="10"
|
||||
app:secondaryText="22"/>
|
||||
<com.philliphsu.clock2.editalarm.TwentyFourHourGridItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_gravity="center"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
app:primaryText="11"
|
||||
app:secondaryText="23"/>
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
<include layout="@layout/element_number_grid"/>
|
||||
|
||||
<!-- TODO: Use fixed width and height -->
|
||||
<ImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
android:src="@drawable/ic_minus_circle_24dp"
|
||||
app:layout_column="1"/>
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadElement"
|
||||
android:src="@drawable/ic_add_circle_24dp"
|
||||
app:layout_column="2"/>
|
||||
</merge>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.philliphsu.clock2.editalarm.NumberGrid
|
||||
android:id="@+id/grid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/numpad_height"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_below="@id/grid">
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="AM"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="PM"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="@dimen/grid_element_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/secondary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/GridLayoutNumpadButton"
|
||||
android:text="1"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"/>
|
||||
@@ -9,4 +9,9 @@
|
||||
<attr name="metaButtonBarButtonStyle" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TwentyFourHourGridItem">
|
||||
<attr name="primaryText" format="string"/>
|
||||
<attr name="secondaryText" format="string"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<item name="android:textSize">@dimen/grid_element_text_size</item>
|
||||
</style>
|
||||
|
||||
<!-- TODO: Rename to GridLayoutElement -->
|
||||
<style name="GridLayoutNumpadElement">
|
||||
<!-- http://stackoverflow.com/a/6868308/5055032
|
||||
Leave off the namespace to reference a custom attribute.
|
||||
@@ -35,6 +36,7 @@
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
</style>
|
||||
|
||||
<!-- TODO: Rename to GridLayout[Text/Button/TextView]? -->
|
||||
<style name="GridLayoutNumpadButton" parent="GridLayoutNumpadElement">
|
||||
<item name="android:textSize">@dimen/grid_element_text_size</item>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user