By "breaking an edge" I am referring to the Google design guidelines. A FAB "breaks an edge" when it is positioned between two adjacent elements.
I want my FAB to be positioned between my toolbar and my content view. But right now it is appearing fully on top of the content view:
My FAB is anchored to the toolbar. Here is the code:
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:layout_anchor="@id/toolbar"
app:layout_anchorGravity="bottom|right|end"
android:src="@android:drawable/ic_dialog_email" />
In examples I have seen here this is how its supposed to be done. You anchor the FAB to the toolbar and then set the anchor gravity to bottom|right|end
What am i doing wrong??