This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onStopNestedScroll( | |
CoordinatorLayout coordinatorLayout, T abl, View target, int type) { | |
// onStartNestedScroll for a fling will happen before onStopNestedScroll for the scroll. This | |
// isn't necessarily guaranteed yet, but it should be in the future. We use this to our | |
// advantage to check if a fling (ViewCompat.TYPE_NON_TOUCH) will start after the touch scroll | |
// (ViewCompat.TYPE_TOUCH) ends | |
if (lastStartedType == ViewCompat.TYPE_TOUCH || type == ViewCompat.TYPE_NON_TOUCH) { | |
// If we haven't been flung, or a fling is ending | |
snapToChildIfNeeded(coordinatorLayout, abl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.google.android.material.floatingactionbutton.FloatingActionButton | |
android:id="@+id/fab" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="top" | |
android:src="@drawable/ic_add_black_24dp" | |
app:fabSize="normal" | |
app:layout_anchor="@id/navigation" | |
app:layout_anchorGravity="top|end" | |
app:useCompatPadding="true"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.design.widget.FloatingActionButton | |
android:id="@+id/fab" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="top" | |
android:src="@drawable/ic_add_black_24dp" | |
app:fabSize="normal" | |
app:layout_anchor="@id/navigation" | |
app:layout_anchorGravity="top|end" | |
app:layout_behavior="com.mypackage.BottomNavigationFABBehavior" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.google.android.material.bottomnavigation.BottomNavigationView | |
android:id="@+id/navigation" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_gravity="bottom" | |
app:layout_behavior="com.mypackage.BottomNavigationBehavior" | |
app:menu="@menu/my_menu"/> |
NewerOlder