mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-22 21:57:11 +00:00
Fix fab handling when scrolled away
This commit is contained in:
parent
03fa516207
commit
9e74288f2d
4 changed files with 15 additions and 14 deletions
|
|
@ -1,4 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate android:fromYDelta="100%" android:toYDelta="0%"/>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="200">
|
||||
<translate
|
||||
android:fromYDelta="100%"
|
||||
android:toYDelta="0%"/>
|
||||
</set>
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate android:fromYDelta="0%" android:toYDelta="100%"/>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="200">
|
||||
<translate android:fromYDelta="0%"
|
||||
android:toYDelta="100%"
|
||||
/>
|
||||
</set>
|
||||
|
|
@ -18,7 +18,9 @@
|
|||
fab:menu_animationDelayPerItem="50"
|
||||
fab:menu_icon="@drawable/fab_add"
|
||||
fab:menu_buttonSpacing="2dp"
|
||||
fab:menu_labels_margin="4dp">
|
||||
fab:menu_labels_margin="4dp"
|
||||
fab:menu_fab_show_animation="@anim/fab_slide_in"
|
||||
fab:menu_fab_hide_animation="@anim/fab_slide_out">
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/fab.new.habit"
|
||||
|
|
|
|||
|
|
@ -138,17 +138,10 @@ public class FloatingActionMenuBehavior extends CoordinatorLayout.Behavior {
|
|||
}
|
||||
|
||||
private void slideFabOffScreen(FloatingActionMenu view) {
|
||||
Animation slideOff = AnimationUtils.loadAnimation(context, R.anim.fab_slide_out);
|
||||
slideOff.setDuration(FAB_ANIMATION_DURATION);
|
||||
slideOff.setFillAfter(true);
|
||||
view.startAnimation(slideOff);
|
||||
view.hideMenu(true);
|
||||
}
|
||||
|
||||
private void slideFabOnScreen(FloatingActionMenu view) {
|
||||
Animation slideIn = AnimationUtils.loadAnimation(context, R.anim.fab_slide_in);
|
||||
slideIn.setDuration(FAB_ANIMATION_DURATION);
|
||||
slideIn.setFillAfter(true);
|
||||
view.startAnimation(slideIn);
|
||||
view.showMenu(false);
|
||||
view.showMenu(true);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue