JASidePanels icon indicating copy to clipboard operation
JASidePanels copied to clipboard

Fix unintentional wait if bounce is disabled

Open bm-i opened this issue 11 years ago • 0 comments

  • Summary: If bounceOnCenterPanelChange is disabled and the center panel is still performing animations, the change of the center panel is not immediate, but waits until animations are completed.
  • Steps to Reproduce:
    • Create center panel with scroll view
    • Run application and flick scroll view in center panel
    • Call setCenterPanel while scroll view is still scrolling
  • Actual Results: Center panel is changed after (unrelated) animations are finished, e.g., scroll view is still animating the scroll
  • Expected Results: Center panel should be changed immediately
  • Cause: setCenterPanel is using UIView.animateWithDuration, but the animations block performs no changes if bounceOnCenterPanelChange is false. The animations block is thus empty and the completion block fires after unrelated animations are comleted.
  • Fix: Don't use UIView.animateWithDuration if bounceOnCenterPanelChange is false, perform actions of completion block immediately.

bm-i avatar Jun 10 '13 12:06 bm-i