From 89df2359ca8003a9c2cd7b3c9ba3dfaf9f9b763b Mon Sep 17 00:00:00 2001 From: jahirfiquitiva Date: Wed, 7 Feb 2018 00:08:51 -0500 Subject: [PATCH] More friendly setAnimationDuration method --- .../java/jahirfiquitiva/libs/fabsmenu/FABsMenu.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/jahirfiquitiva/libs/fabsmenu/FABsMenu.java b/library/src/main/java/jahirfiquitiva/libs/fabsmenu/FABsMenu.java index fe2da10..d53ca75 100644 --- a/library/src/main/java/jahirfiquitiva/libs/fabsmenu/FABsMenu.java +++ b/library/src/main/java/jahirfiquitiva/libs/fabsmenu/FABsMenu.java @@ -1006,9 +1006,15 @@ public int getAnimationDuration() { } public void setAnimationDuration(int animationDuration) { - final ViewParent parent = getParent(); - if (parent != null && parent instanceof FABsMenuLayout) { - ((FABsMenuLayout) parent).setAnimationDuration(animationDuration); + setAnimationDuration(animationDuration, true); + } + + public void setAnimationDuration(int animationDuration, boolean applyToOverlay) { + if (applyToOverlay) { + final ViewParent parent = getParent(); + if (parent != null && parent instanceof FABsMenuLayout) { + ((FABsMenuLayout) parent).setAnimationDuration(animationDuration); + } } this.animationDuration = animationDuration; }