protected override void OnEnable()
        {
            base.OnEnable();

            //Disable touch -> mouse event on mobile devices
            Input.simulateMouseWithTouches = false;

            this._displayMetrics = DisplayMetricsProvider.provider();

            if (_repaintEvent == null)
            {
                _repaintEvent = new Event {
                    type = EventType.Repaint
                };
            }

            D.assert(this._windowAdapter == null);
            this._windowAdapter = new UIWidgetWindowAdapter(this);

            this._windowAdapter.OnEnable();
            var root = new WidgetsApp(
                home: this.getWidget(),
                window: this._windowAdapter,
                routes: this.routes,
                textStyle: this.textStyle,
                pageRouteBuilder: this.pageRouteBuilder,
                onGenerateRoute: this.onGenerateRoute,
                onUnknownRoute: this.onUnknownRoute);


            this._windowAdapter.attachRootWidget(root);
            this._lastMouseMove = Input.mousePosition;
        }
Beispiel #2
0
        protected override void OnEnable()
        {
            base.OnEnable();

            //Disable the default touch -> mouse event conversion on mobile devices
            Input.simulateMouseWithTouches = false;

            this._displayMetrics = DisplayMetricsProvider.provider();
            this._displayMetrics.OnEnable();

            this._enteredPointers.Clear();

            if (_repaintEvent == null)
            {
                _repaintEvent = new Event {
                    type = EventType.Repaint
                };
            }

            D.assert(this._windowAdapter == null);
            this._windowAdapter = new UIWidgetWindowAdapter(this);

            this._windowAdapter.OnEnable();

            Widget root;

            using (this._windowAdapter.getScope()) {
                root = this.createWidget();
            }

            this._windowAdapter.attachRootWidget(root);
            this._lastMouseMove = Input.mousePosition;
        }