aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Hubert <aurel.hubert@gmail.com>2016-05-18 10:18:53 +0200
committerAurelien Hubert <aurel.hubert@gmail.com>2016-05-18 10:18:53 +0200
commitb167406436c162ec5021793089851ce29308f7fc (patch)
treea6bc08aacc68d910cd7ad254bbe7b9ed509823a9
parent5610af9c27658e7c03715c2fc68583c1a9d7418a (diff)
parent7e9b51ecc543500b854eefc1f193e7e639faccec (diff)
downloadandroid_external_ahbottomnavigation-b167406436c162ec5021793089851ce29308f7fc.tar.gz
android_external_ahbottomnavigation-b167406436c162ec5021793089851ce29308f7fc.tar.bz2
android_external_ahbottomnavigation-b167406436c162ec5021793089851ce29308f7fc.zip
Merge pull request #71 from danisabo/master
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);
+ }
}
/**