Flutter Engine
FlutterTouchInterceptingView Class Reference

#import <FlutterPlatformViews_Internal.h>

Inheritance diagram for FlutterTouchInterceptingView:

Instance Methods

(instancetype) - initWithEmbeddedView:platformViewsController:gestureRecognizersBlockingPolicy:
 
(void) - releaseGesture
 
(void) - blockGesture
 

Detailed Description

Definition at line 731 of file FlutterPlatformViews.mm.

Method Documentation

◆ blockGesture()

- (void) blockGesture

Definition at line 768 of file FlutterPlatformViews.mm.

References _blockingPolicy, event, FlutterPlatformViewGestureRecognizersBlockingPolicyEager, and FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded.

768  {
769  switch (_blockingPolicy) {
771  // We block all other gesture recognizers immediately in this policy.
772  _delayingRecognizer.get().state = UIGestureRecognizerStateEnded;
773  break;
775  if (_delayingRecognizer.get().touchedEndedWithoutBlocking) {
776  // If touchesEnded of the `DelayingGesureRecognizer` has been already invoked,
777  // we want to set the state of the `DelayingGesureRecognizer` to
778  // `UIGestureRecognizerStateEnded` as soon as possible.
779  _delayingRecognizer.get().state = UIGestureRecognizerStateEnded;
780  } else {
781  // If touchesEnded of the `DelayingGesureRecognizer` has not been invoked,
782  // We will set a flag to notify the `DelayingGesureRecognizer` to set the state to
783  // `UIGestureRecognizerStateEnded` when touchesEnded is called.
784  _delayingRecognizer.get().shouldEndInNextTouchesEnded = YES;
785  }
786  break;
787  default:
788  break;
789  }
790 }
FlutterPlatformViewGestureRecognizersBlockingPolicy _blockingPolicy

◆ initWithEmbeddedView:platformViewsController:gestureRecognizersBlockingPolicy:()

- (instancetype) initWithEmbeddedView: (UIView*)  embeddedView
platformViewsController: (fml::WeakPtr<flutter::FlutterPlatformViewsController>)  platformViewsController
gestureRecognizersBlockingPolicy: (FlutterPlatformViewGestureRecognizersBlockingPolicy blockingPolicy 

Definition at line 735 of file FlutterPlatformViews.mm.

References _blockingPolicy.

735  :(UIView*)embeddedView
736  platformViewsController:
738  gestureRecognizersBlockingPolicy:
740  self = [super initWithFrame:embeddedView.frame];
741  if (self) {
742  self.multipleTouchEnabled = YES;
743  embeddedView.autoresizingMask =
744  (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
745 
746  [self addSubview:embeddedView];
747 
748  ForwardingGestureRecognizer* forwardingRecognizer = [[[ForwardingGestureRecognizer alloc]
749  initWithTarget:self
750  platformViewsController:std::move(platformViewsController)] autorelease];
751 
752  _delayingRecognizer.reset([[DelayingGestureRecognizer alloc]
753  initWithTarget:self
754  action:nil
755  forwardingRecognizer:forwardingRecognizer]);
756  _blockingPolicy = blockingPolicy;
757 
758  [self addGestureRecognizer:_delayingRecognizer.get()];
759  [self addGestureRecognizer:forwardingRecognizer];
760  }
761  return self;
762 }
FlutterPlatformViewGestureRecognizersBlockingPolicy _blockingPolicy
SemanticsAction action
FlutterPlatformViewGestureRecognizersBlockingPolicy

◆ releaseGesture()

- (void) releaseGesture

Definition at line 764 of file FlutterPlatformViews.mm.

764  {
765  _delayingRecognizer.get().state = UIGestureRecognizerStateFailed;
766 }

The documentation for this class was generated from the following files: