aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sabo <danysabo@gmail.com>2016-05-13 08:34:17 +0200
committerDaniel Sabo <danysabo@gmail.com>2016-05-13 08:34:17 +0200
commit7e9b51ecc543500b854eefc1f193e7e639faccec (patch)
treea6bc08aacc68d910cd7ad254bbe7b9ed509823a9
parent5610af9c27658e7c03715c2fc68583c1a9d7418a (diff)
downloadandroid_external_ahbottomnavigation-7e9b51ecc543500b854eefc1f193e7e639faccec.tar.gz
android_external_ahbottomnavigation-7e9b51ecc543500b854eefc1f193e7e639faccec.tar.bz2
android_external_ahbottomnavigation-7e9b51ecc543500b854eefc1f193e7e639faccec.zip
Prevent double manually offset.
-rw-r--r--ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java b/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java
index 1d869ad..43d6d39 100644
--- a/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java
+++ b/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigationBehavior.java
@@ -225,7 +225,10 @@ public class AHBottomNavigationBehavior<V extends View> extends VerticalScrollin
* @param offset
*/
public void hideView(V view, int offset, boolean withAnimation) {
- animateOffset(view, offset, true, withAnimation);
+ if (!hidden) {
+ hidden = true;
+ animateOffset(view, offset, true, withAnimation);
+ }
}
/**
@@ -233,7 +236,10 @@ public class AHBottomNavigationBehavior<V extends View> extends VerticalScrollin
* @param view
*/
public void resetOffset(V view, boolean withAnimation) {
- animateOffset(view, 0, true, withAnimation);
+ if (hidden) {
+ hidden = false;
+ animateOffset(view, 0, true, withAnimation);
+ }
}
/**