• Roberto Moura's avatar
    Fix Transition Layout bug when oscillating around Peeked state. · 4f332060
    Roberto Moura authored
    When the currentState is Peeked and a transition starts, if the user
    switched direction (from Revealed to Hidden and from Hidden to Revealed
    again), the layout switcher's collection view would start a new
    transition when one already existed:
    `'NSInternalInconsistencyException', reason: 'the collection is already
    in the middle of an interactive transition'`
    
    Create a bool property |layoutBeingInteractedWith|, which is YES when
    the user is scrubbing a layout transition. The layout transition
    progress is only updated if this property is YES.
    
    Create a bool property |gesturesEnabled|, which is set to NO when a pan
    gesture ends and set to YES when a gesture begins and
    |layoutInTransition| is NO. This is to prevent a gesture from being
    recognised if it starts while the layout is already transitioning but
    changes or ends after the layout transition is over. If that were to
    happen, the viewRevealngVerticalPanHandler would fail to notify the
    animatees that a view reveal would take place.
    
    Bug: 1130037, 1127604
    Change-Id: Ifc5eb40843673ab3ce663ed23a3b2f8cf18d9564
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421741Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
    Commit-Queue: Roberto Moura <mouraroberto@google.com>
    Cr-Commit-Position: refs/heads/master@{#812189}
    4f332060
layout_switcher.h 1.5 KB