Create empty view for RecyclerViewFragment

This commit is contained in:
Phillip Hsu
2016-09-05 23:31:01 -07:00
parent 34930fa2b3
commit edf33240e6
7 changed files with 107 additions and 20 deletions
@@ -0,0 +1,4 @@
<vector android:height="96dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="96dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M14.59,8L12,10.59 9.41,8 8,9.41 10.59,12 8,14.59 9.41,16 12,13.41 14.59,16 16,14.59 13.41,12 16,9.41 14.59,8zM12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</vector>
@@ -1,21 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- clipToPadding specifies whether padding should cut into the
- view bounds, and hence into the children. To us, setting
- this to false has the effect of padding the bottom with
- extra space so the FAB isn't covering the last item
- when we scroll to it.
-
- An outsideOverlay scrollbarStyle means the scrollbar is drawn
- outside of the clipping boundary due to padding, and is laid over
- the RecyclerView, rather than being inside of its container (which
- mandates it being inset and adding to the view's padding).
-->
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:scrollbarStyle="outsideOverlay"
android:clipToPadding="false"
android:paddingBottom="@dimen/fab_total_height"/>
android:layout_height="match_parent">
<!-- clipToPadding specifies whether padding should cut into the
- view bounds, and hence into the children. To us, setting
- this to false has the effect of padding the bottom with
- extra space so the FAB isn't covering the last item
- when we scroll to it.
-
- An outsideOverlay scrollbarStyle means the scrollbar is drawn
- outside of the clipping boundary due to padding, and is laid over
- the RecyclerView, rather than being inside of its container (which
- mandates it being inset and adding to the view's padding).
-->
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:scrollbarStyle="outsideOverlay"
android:clipToPadding="false"
android:paddingBottom="@dimen/fab_total_height"/>
<TextView
android:id="@+id/empty_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textSize="@dimen/text_size_headline"
android:drawablePadding="@dimen/text_compound_drawable_padding"
android:visibility="gone"/>
</FrameLayout>
+3
View File
@@ -200,4 +200,7 @@
<string name="pause">Pause</string>
<string name="resume">Resume</string>
<string name="empty_alarms_container">No alarms added</string>
<string name="empty_timers_container">No timers added</string>
</resources>