Implemented done button and half day toggles in dialog

This commit is contained in:
Phillip Hsu
2016-07-23 19:56:19 -07:00
parent 454851e2bf
commit 1162e9177c
8 changed files with 239 additions and 66 deletions
@@ -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="M20,15.31L23.31,12 20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69zM12,18V6c3.31,0 6,2.69 6,6s-2.69,6 -6,6z"/>
</vector>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- http://stackoverflow.com/a/8716798/5055032 -->
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="180"
android:toDegrees="180"
android:pivotX="50%"
android:pivotY="50%"
android:drawable="@drawable/ic_half_day_1_black_24dp">
</rotate>
@@ -1,46 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/time_display_background"
<!-- TOneverDO: Use vertical LinearLayout as long as
GridLayout has no fixed width -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white" >
<include
layout="@layout/time_header_label"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/time_display_background"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
android:layout_gravity="center" />
</FrameLayout>
android:layout_height="wrap_content"
android:background="@android:color/white" >
<include
layout="@layout/time_header_label"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
android:layout_gravity="center" />
</FrameLayout>
<android.support.v7.widget.GridLayout
android:id="@+id/grid_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_height"
android:layout_below="@id/time_display_background"
app:columnCount="3"/>
<android.support.v7.widget.GridLayout
android:id="@+id/grid_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_height"
android:layout_below="@id/time_display_background"
app:columnCount="3"
android:layout_marginBottom="28dp"/>
<LinearLayout
android:layout_width="match_parent"
<View
android:id="@+id/divider"
style="@style/Divider.Horizontal"
android:layout_below="@id/grid_layout"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_below="@id/divider"
android:orientation="horizontal">
<FrameLayout
android:id="@+id/half_day_toggle_1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:gravity="center"
android:layout_gravity="center"
style="@style/TextAppearance.AppCompat.Button"
android:textSize="@dimen/half_day_text_size"/>
</FrameLayout>
<FrameLayout
android:id="@+id/half_day_toggle_2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:gravity="center"
android:layout_gravity="center"
style="@style/TextAppearance.AppCompat.Button"
android:textSize="@dimen/half_day_text_size"/>
</FrameLayout>
</LinearLayout>
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/grid_layout">
android:src="@drawable/ic_done_24dp"
app:layout_anchor="@id/divider"
app:layout_anchorGravity="center_horizontal"/>
<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>
</android.support.design.widget.CoordinatorLayout>
@@ -23,7 +23,7 @@
<View style="@style/FocusGrabber"
android:id="@+id/focus_grabber"/>
<View style="@style/Divider"
<View style="@style/Divider.Horizontal"
android:id="@+id/header_divider"
android:layout_below="@id/input_time"/>
@@ -38,7 +38,7 @@
android:layout_marginEnd="20dp"
android:layout_marginBottom="28dp"/>
<View style="@style/Divider"
<View style="@style/Divider.Horizontal"
android:id="@+id/footer_divider"
android:layout_below="@id/number_grid"/>
+1 -1
View File
@@ -77,7 +77,7 @@
</RelativeLayout>
<View style="@style/Divider"
<View style="@style/Divider.Horizontal"
android:layout_marginTop="@dimen/item_margin_between_elements"/>
</LinearLayout>
+1
View File
@@ -14,6 +14,7 @@
<dimen name="grid_element_text_size">28sp</dimen>
<dimen name="grid_element_touch_target">40dp</dimen>
<dimen name="half_day_text_size">17sp</dimen>
<!-- NumpadTimePickerDialog -->
<dimen name="numpad_height">300dp</dimen>
+10 -1
View File
@@ -41,6 +41,7 @@
<item name="android:textSize">@dimen/grid_element_text_size</item>
</style>
<!-- TODO: Replace and Delete -->
<style name="hybrid_time_picker_grid_element">
<item name="android:layout_width">@dimen/grid_element_touch_target</item>
<item name="android:layout_height">@dimen/grid_element_touch_target</item>
@@ -55,9 +56,17 @@
</style>
<style name="Divider">
<item name="android:background">?android:attr/listDivider</item>
</style>
<style name="Divider.Horizontal">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:background">?android:attr/listDivider</item>
</style>
<style name="Divider.Vertical">
<item name="android:layout_width">1dp</item>
<item name="android:layout_height">match_parent</item>
</style>
<style name="FocusGrabber">