• C
    [platform_views] Fix duplicated touch event pass down to flutter view from platform view. (#8026) · 36ca5740
    Chris Yang 提交于
    Fix for flutter/flutter#27700 and flutter/flutter#24207
    
    There are 2 fixes included in this PR.
    
    The intercepting views sometime pass up the touches events to flutter view, even after the forward gesture recognizer pass the event to the flutter view. We only want the event to be passed to the flutter view once. So we let the intercepting view 'consumes' the event in this PR to fix the problem.
    
    When a touch sequence has multiple touch points participated(e.g. Pinch gesture), the touchesBegan and touchesEnded can be triggered multiple times if the touches do not happen simultaneously. One example would be: when performing a pinch gesture with 2 fingers, I put down one finger, keep the finger on the screen, then put down another finger, perform pinch, lift up both finger at the same time. In this sequence, touchesBegan is called twice with each touch in one of the calls and touchesEnded is called once and has 2 touches in the callback. To handle this issue, we added a count to count the touches in one touch sequence. We only set the state to fail when the count reaches 0(That is all the touches has began in the current sequence is ended).
    36ca5740
FlutterPlatformViews.mm 18.1 KB