diff options
Diffstat (limited to 'ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java')
-rw-r--r-- | ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java b/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java index 43d6d39..5e5b900 100644 --- a/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java +++ b/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java @@ -94,8 +94,15 @@ public class AHBottomNavigationBehavior<V extends View> extends VerticalScrollin handleDirection(child, scrollDirection); } - + /** + * Handle scroll direction + * @param child + * @param scrollDirection + */ private void handleDirection(V child, int scrollDirection) { + if (!behaviorTranslationEnabled) { + return; + } if (scrollDirection == ScrollDirection.SCROLL_DIRECTION_DOWN && hidden) { hidden = false; animateOffset(child, 0, false, true); @@ -220,6 +227,14 @@ public class AHBottomNavigationBehavior<V extends View> extends VerticalScrollin } /** + * Enable or not the behavior translation + * @param behaviorTranslationEnabled + */ + public void setBehaviorTranslationEnabled(boolean behaviorTranslationEnabled) { + this.behaviorTranslationEnabled = behaviorTranslationEnabled; + } + + /** * Hide AHBottomNavigation with animation * @param view * @param offset |