From c5b7e37cd5412925aabd7485c33f9437ddaf16f3 Mon Sep 17 00:00:00 2001 From: Simon Tretter Date: Fri, 12 Feb 2016 23:28:13 +0100 Subject: [PATCH] fast clicks in a sequence bug fix in a sequence (only tested ContinueMethod.OverlayListener) fast clicks didn't remove the overlay correctly. therefore the UI was not useable anymore. this fixes "very" fast click throughs. in case one animation starts before the last one has finished it removes the "old" overlay. --- .../main/java/tourguide/tourguide/FrameLayoutWithHole.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java index 0fffe71..28b0532 100644 --- a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java +++ b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java @@ -141,7 +141,7 @@ private void init(AttributeSet attrs, int defStyle) { private boolean mCleanUpLock = false; protected void cleanUp(){ if (getParent() != null) { - if (mOverlay!=null && mOverlay.mExitAnimation!=null) { + if (mOverlay!=null && mOverlay.mExitAnimation!=null && !mCleanUpLock) { performOverlayExitAnimation(); } else { ((ViewGroup) this.getParent()).removeView(this); @@ -158,7 +158,7 @@ private void performOverlayExitAnimation(){ @Override public void onAnimationRepeat(Animation animation) {} @Override public void onAnimationEnd(Animation animation) { - ((ViewGroup) _pointerToFrameLayout.getParent()).removeView(_pointerToFrameLayout); + if((_pointerToFrameLayout.getParent())!=null) ((ViewGroup) _pointerToFrameLayout.getParent()).removeView(_pointerToFrameLayout); } }); this.startAnimation(mOverlay.mExitAnimation);