示例#1
0
文件: switch.cs 项目: JC-ut0/CubeGame
 void _handleTapUp(TapUpDetails details)
 {
     if (this.isInteractive)
     {
         this._reactionController.reverse();
     }
 }
示例#2
0
 public void _onTapUp(TapUpDetails details)
 {
     if (_openController.isAnimating && _openController.value < 0.5f)
     {
         _openController.reverse();
     }
 }
示例#3
0
 protected virtual void onSingleTapUp(TapUpDetails details)
 {
     if (_delegate.selectionEnabled)
     {
         renderEditable.selectWordEdge(cause: SelectionChangedCause.tap);
     }
 }
示例#4
0
 void _handleTapUp(TapUpDetails details)
 {
     _downPosition = null;
     if (isInteractive)
     {
         _reactionController.reverse();
     }
 }
示例#5
0
 void _handleTapUp(TapUpDetails evt)
 {
     if (_buttonHeldDown)
     {
         _buttonHeldDown = false;
         _animate();
     }
 }
示例#6
0
 private void OnTapUp(TapUpDetails details)
 {
     if (details.device == InputUtils.MouseLeftKeyDevice &&
         details.kind == PointerDeviceKind.mouse)
     {
         Launch($"https://connect.unity.com/u/{widget.user.id}");
     }
 }
示例#7
0
 void _handleTapUp(TapUpDetails details)
 {
     if (isInteractive)
     {
         needsPositionAnimation = false;
         _reactionController.reverse();
     }
 }
 void _handleTapUp(TapUpDetails evt)
 {
     if (this._buttonHeldDown)
     {
         this._buttonHeldDown = false;
         this._animate();
     }
 }
示例#9
0
 void _checkPosition(TapUpDetails tapUpDetails)
 {
     setState(() =>
     {
         _globalPostion = tapUpDetails.globalPosition;
         _localPostion  = tapUpDetails.localPosition;
     });
 }
示例#10
0
        void _handleSingleTapUp(TapUpDetails details)
        {
            if (this.widget.enableInteractiveSelection == true)
            {
                this._renderEditable.handleTap();
            }

            this._requestKeyboard();
            this._confirmCurrentSplash();
            if (this.widget.onTap != null)
            {
                this.widget.onTap();
            }
        }
示例#11
0
        protected override void onSingleTapUp(TapUpDetails details)
        {
            editableText.hideToolbar();
            if (_delegate.selectionEnabled)
            {
                //use android by default
                renderEditable.selectPosition(cause: SelectionChangedCause.tap);
            }

            _state._requestKeyboard();
            if (_state.widget.onTap != null)
            {
                _state.widget.onTap();
            }
        }
示例#12
0
        void _handleTapUp(TapUpDetails details)
        {
            if (!this._isDoubleTap)
            {
                if (this.widget.onSingleTapUp != null)
                {
                    this.widget.onSingleTapUp(details);
                }

                this._lastTapOffset  = details.globalPosition;
                this._doubleTapTimer = Window.instance.run(Constants.kDoubleTapTimeout, this._doubleTapTimeout);
            }

            this._isDoubleTap = false;
        }
示例#13
0
    void _handleTapUp(TapUpDetails details)
    {
        if (!_isDoubleTap)
        {
            if (widget.onSingleTapUp != null)
            {
                widget.onSingleTapUp(details);
            }

            _lastTapOffset  = details.globalPosition;
            _doubleTapTimer = Timer.create(Constants.kDoubleTapTimeout, _doubleTapTimeout);
        }

        _isDoubleTap = false;
    }
示例#14
0
 protected override void onSingleTapUp(TapUpDetails details)
 {
     if (_state._clearGlobalKey.currentContext != null)
     {
         RenderBox renderBox   = _state._clearGlobalKey.currentContext.findRenderObject() as RenderBox;
         Offset    localOffset = renderBox.globalToLocal(details.globalPosition);
         if (renderBox.hitTest(new BoxHitTestResult(), position: localOffset))
         {
             return;
         }
     }
     base.onSingleTapUp(details);
     _state._requestKeyboard();
     if (_state.widget.onTap != null)
     {
         _state.widget.onTap();
     }
 }
示例#15
0
        protected override void onSingleTapUp(TapUpDetails details)
        {
            editableText.hideToolbar();
            if (_delegate.selectionEnabled)
            {
                switch (Theme.of(_state.context).platform)
                {
                case RuntimePlatform.IPhonePlayer:
                case RuntimePlatform.OSXEditor:
                case RuntimePlatform.OSXPlayer:
                    renderEditable.selectWordEdge(cause: SelectionChangedCause.tap);
                    break;

                default:
                    renderEditable.selectPosition(cause: SelectionChangedCause.tap);
                    break;
                }
            }
            if (_state.widget.onTap != null)
            {
                _state.widget.onTap();
            }
        }
示例#16
0
 void _onTapUp(TapUpDetails evt)
 {
     this.setState(() => { this._backgroundColor = CupertinoColors.white; });
 }
 void _onTapUp(TapUpDetails details)
 {
     highlightedIndex = indexFromLocation(details.localPosition);
     state.didChangeSelectedViaGesture();
 }
示例#18
0
 void _handleTapUp(TapUpDetails details)
 {
     _endInteraction();
 }
 void _onTapUp(TapUpDetails evt)
 {
     setState(() => { isBeingPressed = false; });
 }
示例#20
0
 void _handleSingleTapUp(TapUpDetails details)
 {
     this._renderEditable.selectWordEdge(cause: SelectionChangedCause.tap);
     this._requestKeyboard();
 }
示例#21
0
 void _handleSingleTapUp(TapUpDetails details)
 {
 }
示例#22
0
 void _handleSingleTapUp(TapUpDetails details)
 {
     this.widget.onTapUp?.Invoke(details);
 }
示例#23
0
 void onTapUp(TapUpDetails details)
 {
     setState(() => {
         _isPressed = false;
     });
 }
示例#24
0
        private void OnTapUp(TapUpDetails details)
        {
            if (_rightClickFocus.hasFocus)
            {
                _rightClickEntry?.remove();
                _rightClickEntry = null;
            }

            FocusScope.of(context).requestFocus(new FocusNode());

            if (details.device == InputUtils.MouseLeftKeyDevice &&
                details.kind == PointerDeviceKind.mouse &&
                widget.Msg.attachments.Count > 0 &&
                !widget.Msg.attachments.first().local&&
                !_fetchingUrl)
            {
                _fetchingUrl = true;
                setState();
                var attachment = widget.Msg.attachments.first();
                Get <Attachment>(
                    url: $"/api/cdn-signed/message-attachments/{widget.Msg.id}/{attachment.id}"
                    ).Then(atch =>
                {
                    _fetchingUrl = false;
                    setState();
                    Launch(atch.signedUrl);
                });
            }
            else if (details.device == InputUtils.MouseRightKeyDevice &&
                     details.kind == PointerDeviceKind.mouse)
            {
                var children = new List <Widget>();
                if (widget.Msg.content.isNotEmpty() &&
                    widget.Msg.id.isNotEmpty())
                {
                    children.Add(
                        new GestureDetector(
                            onTap: () =>
                    {
                        Clipboard.setData(
                            new ClipboardData(text: ParseMessageToString(widget.Msg.content, widget.Users)));
                        FocusScope.of(context).requestFocus(new FocusNode());
                    },
                            child: new Container(
                                height: 40,
                                color: new Color(0x00000000),
                                alignment: Alignment.center,
                                child: new Text(
                                    "复制",
                                    style: new TextStyle(
                                        fontSize: 16,
                                        color: new Color(0xff000000),
                                        fontFamily: "PingFang"
                                        )
                                    )
                                )
                            )
                        );
                    children.Add(
                        new Container(
                            height: 1,
                            color: new Color(0xffd8d8d8)
                            )
                        );
                    children.Add(
                        new GestureDetector(
                            onTap: () =>
                    {
                        Sender.currentState.AppendString(
                            $"「{widget.Msg.author.fullName}: {ParseMessageToString(widget.Msg.content, widget.Users)}」\n- - - - - - - - - - - - - - -\n"
                            );
                        SchedulerBinding.instance.addPostFrameCallback(value =>
                                                                       FocusScope.of(context).requestFocus(Sender.currentState.widget.focusNode));
                    },
                            child: new Container(
                                height: 40,
                                color: new Color(0x00000000),
                                alignment: Alignment.center,
                                child: new Text(
                                    "引用",
                                    style: new TextStyle(
                                        fontSize: 16,
                                        color: new Color(0xff000000),
                                        fontFamily: "PingFang"
                                        )
                                    )
                                )
                            )
                        );
                }

                if (widget.Msg.author.id == Window.currentUserId &&
                    widget.Msg.id.isNotEmpty() &&
                    (widget.Msg.attachments.isEmpty() || !widget.Msg.attachments.first().local))
                {
                    if (children.isNotEmpty())
                    {
                        children.Add(
                            new Container(
                                height: 1,
                                color: new Color(0xffd8d8d8)
                                )
                            );
                    }

                    children.Add(
                        new GestureDetector(
                            onTap: () =>
                    {
                        FocusScope.of(context).requestFocus(new FocusNode());
                        Confirm(
                            context,
                            "删除消息",
                            "确认删除此条消息?",
                            () =>
                        {
                            Post <Models.Message>(
                                $"/api/connectapp/v1/messages/{widget.Msg.id}/delete",
                                null
                                ).Then(m => { });
                        },
                            () => { }
                            );
                    },
                            child: new Container(
                                height: 40,
                                color: new Color(0x00000000),
                                alignment: Alignment.center,
                                child: new Text(
                                    "删除",
                                    style: new TextStyle(
                                        fontSize: 16,
                                        color: new Color(0xff000000),
                                        fontFamily: "PingFang"
                                        )
                                    )
                                )
                            )
                        );
                }

                if (children.Count == 0)
                {
                    return;
                }

                var focusScopeNode = FocusScope.of(context);
                _rightClickEntry = new OverlayEntry(buildContext =>
                {
                    return(new GestureDetector(
                               onTap: () => { focusScopeNode.requestFocus(new FocusNode()); },
                               child: new Container(
                                   color: new Color(0x00000000),
                                   child: new Stack(
                                       children: new List <Widget>
                    {
                        new Positioned(
                            left: details.globalPosition.dx,
                            top: details.globalPosition.dy,
                            child: new Container(
                                width: 80,
                                decoration: new BoxDecoration(
                                    borderRadius: BorderRadius.all(6),
                                    boxShadow: new List <BoxShadow>
                        {
                            new BoxShadow(
                                blurRadius: 16,
                                color: new Color(0x33000000)
                                )
                        },
                                    color: new Color(0xffffffff)
                                    ),
                                child: new Column(
                                    children: children
                                    )
                                )
                            )
                    }
                                       )
                                   )
                               ));
                });
                FocusScope.of(context).requestFocus(_rightClickFocus);
                Overlay.of(context).insert(_rightClickEntry);
            }
        }