Translate FAB when scrolling between stopwatch page
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
<?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>
|
||||
@@ -43,7 +43,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@android:drawable/ic_dialog_email"/>
|
||||
android:src="@android:drawable/ic_dialog_email"
|
||||
android:layout_margin="@dimen/fab_margin"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -9,54 +9,16 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_panel"
|
||||
|
||||
<com.philliphsu.clock2.stopwatch.ChronometerWithMillis
|
||||
android:id="@+id/chronometer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
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>
|
||||
android:gravity="center_horizontal"
|
||||
android:textSize="@dimen/text_size_display_3"
|
||||
style="@style/TextAppearance.AppCompat.Inverse"/>
|
||||
|
||||
<!-- RecyclerView -->
|
||||
<include layout="@layout/fragment_recycler_view"/>
|
||||
@@ -67,8 +29,39 @@
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_anchor="@id/top_panel"
|
||||
app:layout_anchor="@id/chronometer"
|
||||
app:layout_anchorGravity="bottom"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"/>
|
||||
|
||||
<!-- TODO: dimen resource for height -->
|
||||
<android.support.v7.widget.GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="88dp"
|
||||
android:layout_gravity="bottom"
|
||||
app:columnCount="2">
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/new_lap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_half_day_1_black_24dp"
|
||||
android:tint="@android:color/darker_gray"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="center"
|
||||
app:fabSize="mini"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/stop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_half_day_1_black_24dp"
|
||||
android:tint="@android:color/darker_gray"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="center"
|
||||
app:fabSize="mini"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
</android.support.v7.widget.GridLayout>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
Reference in New Issue
Block a user