Ejemplo n.º 1
0
        void _startSplash(TapDownDetails details = null, BuildContext context = null)
        {
            D.assert(details != null || context != null);

            Offset globalPosition;

            if (context != null)
            {
                RenderBox referenceBox = context.findRenderObject() as RenderBox;
                D.assert(referenceBox.hasSize, () => "InkResponse must be done with layout before starting a splash.");
                globalPosition = referenceBox.localToGlobal(referenceBox.paintBounds.center);
            }
            else
            {
                globalPosition = details.globalPosition;
            }

            InteractiveInkFeature splash = _createInkFeature(globalPosition);

            _splashes = _splashes ?? new HashSet <InteractiveInkFeature>();
            _splashes.Add(splash);
            _currentSplash = splash;
            updateKeepAlive();
            updateHighlight(_HighlightType.pressed, value: true);
        }
Ejemplo n.º 2
0
 void _handleTapDown(TapDownDetails details)
 {
     if (this.isInteractive)
     {
         this._reactionController.forward();
     }
 }
Ejemplo n.º 3
0
        public void _onTapDown(TapDownDetails details)
        {
            setState(() => {
                _childHidden = true;
            });
            Rect childRect = CupertinoContextMenuUtils._getRect(_childGlobalKey);

            _decoyChildEndRect = CupertinoContextMenuUtils.fromCenter(
                center: childRect.center,
                width: childRect.width * CupertinoContextMenuUtils._kOpenScale,
                height: childRect.height * CupertinoContextMenuUtils._kOpenScale
                );
            _lastOverlayEntry = new OverlayEntry(
                opaque: false,
                builder: (BuildContext context) => {
                return(new _DecoyChild(
                           beginRect: childRect,
                           child: widget.child,
                           controller: _openController,
                           endRect: _decoyChildEndRect
                           ));
            }
                );
            Overlay.of(context).insert(_lastOverlayEntry);
            _openController.forward();
        }
Ejemplo n.º 4
0
 void _handleTapDown(TapDownDetails evt)
 {
     if (!_buttonHeldDown)
     {
         _buttonHeldDown = true;
         _animate();
     }
 }
Ejemplo n.º 5
0
 void _handleTapDown(TapDownDetails details)
 {
     _startSplash(details: details);
     if (widget.onTapDown != null)
     {
         widget.onTapDown(details);
     }
 }
Ejemplo n.º 6
0
 void _checkPosition(TapDownDetails tapUpDetails)
 {
     setState(() =>
     {
         _globalPostion = tapUpDetails.globalPosition;
         _localPostion  = tapUpDetails.localPosition;
     });
 }
Ejemplo n.º 7
0
 void _handleDoubleTapDown(TapDownDetails details)
 {
     if (this.widget.selectionEnabled)
     {
         this._renderEditable.selectWord(cause: SelectionChangedCause.doubleTap);
         this._editableTextKey.currentState.showToolbar();
     }
 }
Ejemplo n.º 8
0
 void handleTapDown(TapDownDetails details)
 {
     this._lastTapDownPosition = details.globalPosition + -this._paintOffset;
     if (!Application.isMobilePlatform)
     {
         this.selectPosition(SelectionChangedCause.tap);
     }
 }
Ejemplo n.º 9
0
 void _handleTapDown(TapDownDetails details)
 {
     if (this.isInteractive)
     {
         this._downPosition = this.globalToLocal(details.globalPosition);
         this._reactionController.forward();
     }
 }
Ejemplo n.º 10
0
 public void handleTapDown(TapDownDetails details)
 {
     this._lastTapDownPosition = details.globalPosition - this._paintOffset;
     if (!Application.isMobilePlatform)
     {
         this._selectForTap(this._lastTapDownPosition);
     }
 }
Ejemplo n.º 11
0
 void _handleTapDown(TapDownDetails evt)
 {
     if (!this._buttonHeldDown)
     {
         this._buttonHeldDown = true;
         this._animate();
     }
 }
Ejemplo n.º 12
0
 void _handleTapDown(TapDownDetails details)
 {
     if (isInteractive)
     {
         needsPositionAnimation = false;
     }
     _reactionController.forward();
 }
Ejemplo n.º 13
0
        protected void onTapDown(TapDownDetails details)
        {
            renderEditable.handleTapDown(details);
            PointerDeviceKind?kind = details.kind;

            _shouldShowSelectionToolbar = kind == null ||
                                          kind == PointerDeviceKind.touch ||
                                          kind == PointerDeviceKind.stylus;
        }
Ejemplo n.º 14
0
        void _startSplash(TapDownDetails details)
        {
            if (this._effectiveFocusNode.hasFocus)
            {
                return;
            }

            InteractiveInkFeature splash = this._createInkFeature(details);

            this._splashes = this._splashes ?? new HashSet <InteractiveInkFeature>();
            this._splashes.Add(splash);
            this._currentSplash = splash;
            this.updateKeepAlive();
        }
Ejemplo n.º 15
0
        void _handleTapDown(TapDownDetails details)
        {
            InteractiveInkFeature splash = this._createInkFeature(details);

            this._splashes = this._splashes ?? new HashSet <InteractiveInkFeature>();
            this._splashes.Add(splash);
            this._currentSplash = splash;
            if (this.widget.onTapDown != null)
            {
                this.widget.onTapDown(details);
            }

            this.updateKeepAlive();
            this.updateHighlight(true);
        }
Ejemplo n.º 16
0
        void _handleTapDown(TapDownDetails details)
        {
            if (this.widget.onTapDown != null)
            {
                this.widget.onTapDown(details);
            }

            if (this._doubleTapTimer != null &&
                this._isWithinDoubleTapTolerance(details.globalPosition))
            {
                if (this.widget.onDoubleTapDown != null)
                {
                    this.widget.onDoubleTapDown(details);
                }

                this._doubleTapTimer.cancel();
                this._doubleTapTimeout();
                this._isDoubleTap = true;
            }
        }
Ejemplo n.º 17
0
        InteractiveInkFeature _createInkFeature(TapDownDetails details)
        {
            MaterialInkController inkController = Material.of(this.context);
            RenderBox             referenceBox  = (RenderBox)this.context.findRenderObject();
            Offset       position     = referenceBox.globalToLocal(details.globalPosition);
            Color        color        = this.widget.splashColor ?? Theme.of(this.context).splashColor;
            RectCallback rectCallback = this.widget.containedInkWell ? this.widget.getRectCallback(referenceBox) : null;
            BorderRadius borderRadius = this.widget.borderRadius;
            ShapeBorder  customBorder = this.widget.customBorder;

            InteractiveInkFeature splash = null;

            void OnRemoved()
            {
                if (this._splashes != null)
                {
                    D.assert(this._splashes.Contains(splash));
                    this._splashes.Remove(splash);
                    if (this._currentSplash == splash)
                    {
                        this._currentSplash = null;
                    }

                    this.updateKeepAlive();
                }
            }

            splash = (this.widget.splashFactory ?? Theme.of(this.context).splashFactory).create(
                controller: inkController,
                referenceBox: referenceBox,
                position: position,
                color: color,
                containedInkWell: this.widget.containedInkWell,
                rectCallback: rectCallback,
                radius: this.widget.radius,
                borderRadius: borderRadius,
                customBorder: customBorder,
                onRemoved: OnRemoved);

            return(splash);
        }
Ejemplo n.º 18
0
        InteractiveInkFeature _createInkFeature(TapDownDetails details)
        {
            MaterialInkController inkController   = Material.of(this.context);
            BuildContext          editableContext = this._editableTextKey.currentContext;
            RenderBox             referenceBox    =
                (RenderBox)(InputDecorator.containerOf(editableContext) ?? editableContext.findRenderObject());
            Offset position = referenceBox.globalToLocal(details.globalPosition);
            Color  color    = Theme.of(this.context).splashColor;

            InteractiveInkFeature splash = null;

            void handleRemoved()
            {
                if (this._splashes != null)
                {
                    D.assert(this._splashes.Contains(splash));
                    this._splashes.Remove(splash);
                    if (this._currentSplash == splash)
                    {
                        this._currentSplash = null;
                    }
                    this.updateKeepAlive();
                } // else we're probably in deactivate()
            }

            splash = Theme.of(this.context).splashFactory.create(
                controller: inkController,
                referenceBox: referenceBox,
                position: position,
                color: color,
                containedInkWell: true,
                borderRadius: BorderRadius.zero,
                onRemoved: handleRemoved
                );

            return(splash);
        }
Ejemplo n.º 19
0
 void _handleTapDown(TapDownDetails details)
 {
     this._renderEditable.handleTapDown(details);
 }
Ejemplo n.º 20
0
 void _handleTapDown(TapDownDetails details)
 {
     _startInteraction(details.globalPosition);
 }
Ejemplo n.º 21
0
 void _onTapDown(TapDownDetails evt)
 {
     this.setState(() => { this._backgroundColor = CupertinoActionSheetUtils._kCancelButtonPressedColor; });
 }
Ejemplo n.º 22
0
 void _handleTapDown(TapDownDetails details)
 {
     this._renderEditable.handleTapDown(details);
     this._startSplash(details);
 }
Ejemplo n.º 23
0
 void _onTapDown(TapDownDetails evt)
 {
     setState(() => { isBeingPressed = true; });
 }
Ejemplo n.º 24
0
 void _handleTapDown(TapDownDetails details)
 {
     D.assert(!this.ignorePointer);
     this.handleTapDown(details);
 }
Ejemplo n.º 25
0
 void onTapDown(TapDownDetails details)
 {
     setState(() => {
         _isPressed = true;
     });
 }
Ejemplo n.º 26
0
 void _handleTapDown(TapDownDetails details)
 {
     this.widget.onTapDown?.Invoke(details);
 }
Ejemplo n.º 27
0
 public void handleTapDown(TapDownDetails details)
 {
     this._lastTapDownPosition = details.globalPosition - this._paintOffset;
 }
Ejemplo n.º 28
0
 void _handleTapDown(TapDownDetails details)
 {
 }
Ejemplo n.º 29
0
 void _handleDoubleTapDown(TapDownDetails details)
 {
     this._renderEditable.selectWord(cause: SelectionChangedCause.doubleTap);
 }