Implemented stopwatch page

This commit is contained in:
Phillip Hsu
2016-08-12 20:58:01 -07:00
parent 3e542f585e
commit 7dfda796f3
24 changed files with 1458 additions and 34 deletions
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/top_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:padding="16dp">
<com.philliphsu.clock2.stopwatch.ChronometerWithMillis
android:id="@+id/chronometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="45sp"
style="@style/TextAppearance.AppCompat.Inverse"
android:layout_marginBottom="16dp"/>
<ImageButton
android:id="@+id/new_lap"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="?selectableItemBackground"
android:layout_below="@id/chronometer"
android:layout_alignParentStart="true"
android:src="@drawable/ic_half_day_1_black_24dp"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/chronometer"
android:layout_centerInParent="true"/>
<ImageButton
android:id="@+id/stop"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="?selectableItemBackground"
android:layout_below="@id/chronometer"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_half_day_1_black_24dp"/>
</RelativeLayout>
<!-- RecyclerView -->
<include layout="@layout/fragment_recycler_view"/>
</LinearLayout>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_anchor="@id/top_panel"
app:layout_anchorGravity="bottom"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"/>
</android.support.design.widget.CoordinatorLayout>
+1 -1
View File
@@ -42,7 +42,7 @@
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_dialog_email"/>
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/top_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/colorPrimary"
android:padding="16dp">
<com.philliphsu.clock2.stopwatch.ChronometerWithMillis
android:id="@+id/chronometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="45sp"
style="@style/TextAppearance.AppCompat.Inverse"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/new_lap"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="?selectableItemBackground"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_half_day_1_black_24dp"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
<ImageButton
android:id="@+id/stop"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="?selectableItemBackground"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_half_day_1_black_24dp"/>
</RelativeLayout>
</LinearLayout>
<!-- RecyclerView -->
<include layout="@layout/fragment_recycler_view"/>
</LinearLayout>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_anchor="@id/top_panel"
app:layout_anchorGravity="bottom"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"/>
</android.support.design.widget.CoordinatorLayout>
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/lap_number"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
style="@style/TextAppearance.AppCompat"/>
<com.philliphsu.clock2.stopwatch.ChronometerWithMillis
android:id="@+id/elapsed_time"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"/>
<TextView
android:id="@+id/total_time"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
style="@style/TextAppearance.AppCompat"/>
</LinearLayout>