Ejemplo n.º 1
0
        bool _onNotification(ScrollNotification notification)
        {
            var pixels = notification.metrics.pixels;

            if (this._titleHeight == 0.0f)
            {
                this._titleHeight = headTitleKey.currentContext.size.height + 16;
            }

            if (pixels > this._titleHeight)
            {
                if (this._isHaveTitle == false)
                {
                    this._controller.forward();
                    this.setState(() => { this._isHaveTitle = true; });
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => { this._isHaveTitle = false; });
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        bool _handleScrollNotification(ScrollNotification notification)
        {
            ScrollMetrics metrics = notification.metrics;

            if (metrics.maxScrollExtent <= metrics.minScrollExtent)
            {
                return(false);
            }

            if (notification is ScrollUpdateNotification ||
                notification is OverscrollNotification)
            {
                if (_fadeoutAnimationController.status != AnimationStatus.forward)
                {
                    _fadeoutAnimationController.forward();
                }
                _fadeoutTimer?.cancel();
                _painter.update(notification.metrics, notification.metrics.axisDirection);
            }
            else if (notification is ScrollEndNotification)
            {
                if (_dragScrollbarPositionY == null)
                {
                    _startFadeoutTimer();
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
        bool _handleScrollNotification(ScrollNotification notification)
        {
            if (notification is ScrollUpdateNotification || notification is OverscrollNotification)
            {
                if (this.m_FadeoutAnimationController.status != AnimationStatus.forward)
                {
                    this.m_FadeoutAnimationController.forward();
                }

                this.m_FadeoutTimer?.cancel();
                this.m_ScrollbarPainter.update(
                    metrics: notification.metrics,
                    axisDirection: notification.metrics.axisDirection
                    );
            }
            else if (notification is ScrollEndNotification)
            {
                this.m_FadeoutTimer?.cancel();
                this.m_FadeoutTimer = UIWidgets.ui.Window.instance.run(ScrollbarTimeToFade, () =>
                {
                    this.m_FadeoutAnimationController.reverse();
                    this.m_FadeoutTimer = null;
                });
            }

            return(false);
        }
Ejemplo n.º 4
0
        bool _dispatchScrollEvent(ScrollNotification notification)
        {
            // when is scroll in the ScrollInside,nothing to do
            if (!_isPullUp(notification) && !_isPullDown(notification))
            {
                return(false);
            }

            if (notification is ScrollStartNotification)
            {
                var startNotification = (ScrollStartNotification)notification;
                return(this._handleScrollStart(startNotification));
            }

            if (notification is ScrollUpdateNotification)
            {
                var startNotification = (ScrollUpdateNotification)notification;
                //if dragDetails is null,This represents the user's finger out of the screen
                if (startNotification.dragDetails == null)
                {
                    return(this._handleScrollEnd(notification));
                }
                if (startNotification.dragDetails != null)
                {
                    return(this._handleScrollMoving(startNotification));
                }
            }

            if (notification is ScrollEndNotification)
            {
                this._handleScrollEnd(notification);
            }

            return(false);
        }
Ejemplo n.º 5
0
        bool _handleScrollNotification(ScrollNotification notification)
        {
            if (notification is ScrollUpdateNotification || notification is OverscrollNotification)
            {
                if (this._fadeoutAnimationController.status != AnimationStatus.forward)
                {
                    this._fadeoutAnimationController.forward();
                }

                this._fadeoutTimer?.cancel();
                this._scrollbarPainter.update(
                    metrics: notification.metrics,
                    axisDirection: notification.metrics.axisDirection
                    );
            }
            else if (notification is ScrollEndNotification)
            {
                this._fadeoutTimer?.cancel();
                this._fadeoutTimer = Window.instance.run(TimeSpan.FromMilliseconds(50), () => {
                    this._fadeoutAnimationController.reverse();
                    this._fadeoutTimer = null;
                });
            }
            return(false);
        }
Ejemplo n.º 6
0
        bool _onNotification(ScrollNotification notification)
        {
            var pixels = notification.metrics.pixels;

            SchedulerBinding.instance.addPostFrameCallback(_ => {
                if (pixels > 0 && pixels <= 52)
                {
                    this.titleStyle   = CTextStyle.H5;
                    this.navBarHeight = maxNavBarHeight - pixels;
                    this.setState(() => { });
                }
                else if (pixels <= 0)
                {
                    if (this.navBarHeight <= maxNavBarHeight)
                    {
                        this.titleStyle   = CTextStyle.H2;
                        this.navBarHeight = maxNavBarHeight;
                        this.setState(() => { });
                    }
                }
                else if (pixels > 52)
                {
                    if (!(this.navBarHeight <= minNavBarHeight))
                    {
                        this.titleStyle   = CTextStyle.H5;
                        this.navBarHeight = minNavBarHeight;
                        this.setState(() => { });
                    }
                }
            });
            return(true);
        }
Ejemplo n.º 7
0
        bool _handleScrollNotification(ScrollNotification notification)
        {
            if (this._warpUnderwayCount > 0)
            {
                return(false);
            }

            if (notification.depth != 0)
            {
                return(false);
            }

            this._warpUnderwayCount += 1;
            if (notification is ScrollUpdateNotification && !this._controller.indexIsChanging)
            {
                if ((this._pageController.page - this._controller.index).abs() > 1.0)
                {
                    this._controller.index = this._pageController.page.floor();
                    this._currentIndex     = this._controller.index;
                }

                this._controller.offset = (this._pageController.page - this._controller.index).clamp(-1.0f, 1.0f);
            }
            else if (notification is ScrollEndNotification)
            {
                this._controller.index = this._pageController.page.round();
                this._currentIndex     = this._controller.index;
            }

            this._warpUnderwayCount -= 1;

            return(false);
        }
Ejemplo n.º 8
0
        bool _onNotification(ScrollNotification notification)
        {
            var axisDirection = notification.metrics.axisDirection;

            if (axisDirection == AxisDirection.left || axisDirection == AxisDirection.right)
            {
                return(true);
            }

            var pixels = notification.metrics.pixels;

            if (pixels >= 3)
            {
                if (this._isHaveTitle)
                {
                    StatusBarManager.statusBarStyle(false);
                    this.setState(() => this._isHaveTitle = false);
                }
            }
            else
            {
                if (!this._isHaveTitle)
                {
                    StatusBarManager.statusBarStyle(true);
                    this.setState(() => this._isHaveTitle = true);
                }
            }

            return(true);
        }
Ejemplo n.º 9
0
        bool _handleScrollNotification(ScrollNotification notification)
        {
            ScrollMetrics metrics = notification.metrics;

            if (metrics.maxScrollExtent <= metrics.minScrollExtent)
            {
                return(false);
            }
            if (!_useCupertinoScrollbar.Value &&
                (notification is ScrollUpdateNotification ||
                 notification is OverscrollNotification))
            {
                if (_fadeoutAnimationController.status != AnimationStatus.forward)
                {
                    _fadeoutAnimationController.forward();
                }

                _materialPainter.update(
                    notification.metrics,
                    notification.metrics.axisDirection
                    );
                if (!widget.isAlwaysShown)
                {
                    _fadeoutTimer?.cancel();
                    _fadeoutTimer = Timer.create(ScrollbarUtils._kScrollbarTimeToFade, () => {
                        _fadeoutAnimationController.reverse();
                        _fadeoutTimer = null;
                    });
                }
            }
            return(false);
        }
Ejemplo n.º 10
0
        bool _onNotification(ScrollNotification notification)
        {
            var pixels = notification.metrics.pixels;

            this._showNavBarShadow = !(pixels >= 44);
            this.setState(() => { });
            return(true);
        }
Ejemplo n.º 11
0
        bool _onNotification(ScrollNotification notification)
        {
            var pixels = notification.metrics.pixels;
            var navBarBottomPosition = navBarHeight + CCommonUtils.getSafeAreaTopPadding(context: this.context);

            if (pixels >= navBarBottomPosition)
            {
                if (this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = false);
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = true);
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > imageBaseHeight - navBarHeight - 24)
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => this._isHaveTitle = true);
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => this._isHaveTitle = false);
                }
            }

            if (pixels > imageBaseHeight - navBarHeight)
            {
                if (!this._isShowTop)
                {
                    this.setState(() => this._isShowTop = true);
                }
            }
            else
            {
                if (this._isShowTop)
                {
                    this.setState(() => this._isShowTop = false);
                }
            }

            return(true);
        }
Ejemplo n.º 12
0
        bool _onNotification(BuildContext context, ScrollNotification notification)
        {
            var axisDirection = notification.metrics.axisDirection;

            if (axisDirection == AxisDirection.left || axisDirection == AxisDirection.right)
            {
                return(true);
            }

            var pixels     = notification.metrics.pixels;
            var topPadding = 44 + CCommonUtils.getSafeAreaTopPadding(context: context);

            if (this._playButtonPosition == 0.0f)
            {
                var width       = MediaQuery.of(context).size.width;
                var imageHeight = width / this._aspectRatio;
                this._playButtonPosition = imageHeight + gameBriefKey.currentContext.size.height - topPadding - 24 - 6;
                // topPadding 是顶部的高度, 24 是底部的 padding, 6 是按钮到左边图片到底部的距离
            }

            if (pixels >= 44 + topPadding)
            {
                if (this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = false; });
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = true; });
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > this._playButtonPosition)
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => { this._isHaveTitle = true; });
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => { this._isHaveTitle = false; });
                }
            }

            return(true);
        }
Ejemplo n.º 13
0
        bool _onNotification(ScrollNotification notification)
        {
            var pixels = notification.metrics.pixels;

            if (pixels >= 44 + this._topPadding)
            {
                if (this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = false);
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._hideNavBar)
                {
                    this.setState(() => this._hideNavBar = true);
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > headerHeight - 24 - (44 + this._topPadding))
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => this._isHaveTitle = true);
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => this._isHaveTitle = false);
                }
            }

            if (pixels > headerHeight - (44 + this._topPadding))
            {
                if (!this._isShowTop)
                {
                    this.setState(() => this._isShowTop = true);
                }
            }
            else
            {
                if (this._isShowTop)
                {
                    this.setState(() => this._isShowTop = false);
                }
            }

            return(true);
        }
Ejemplo n.º 14
0
        float _measure(ScrollNotification notification)
        {
            if (this.widget.up)
            {
                return((notification.metrics.minScrollExtent -
                        notification.metrics.pixels) / this.widget.triggerDistance);
            }

            return((notification.metrics.pixels -
                    notification.metrics.maxScrollExtent) / this.widget.triggerDistance);
        }
Ejemplo n.º 15
0
        bool _handleScrollNotification(ScrollNotification notification)
        {
            float elevation = notification.metrics.extentBefore() <= 0.0f ? 0.0f : 1.0f;

            if (elevation != this._appBarElevation)
            {
                this.setState(() => { this._appBarElevation = elevation; });
            }

            return(false);
        }
Ejemplo n.º 16
0
        bool _onNotification(BuildContext context, ScrollNotification notification, IEvent eventObj)
        {
            var pixels = notification.metrics.pixels;

            if (this._titleHeight == 0.0f)
            {
                var width       = MediaQuery.of(context).size.width;
                var imageHeight = 9.0f / 16.0f * width;
                if (eventObj.type.isNotEmpty() && !(eventObj.type == "bagevent" || eventObj.type == "customize"))
                {
                    this._titleHeight = imageHeight + eventTitleKey.currentContext.size.height + 16;
                }
                else
                {
                    this._titleHeight = imageHeight + eventTitleKey.currentContext.size.height + 16 - 64;
                }
            }

            if (pixels >= 44)
            {
                if (this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = false; });
                }
            }
            else
            {
                if (!this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = true; });
                }
            }

            if (pixels > this._titleHeight)
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => { this._isHaveTitle = true; });
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => { this._isHaveTitle = false; });
                }
            }

            return(true);
        }
Ejemplo n.º 17
0
        bool _handlePageNotification(ScrollNotification notification, PageController leader, PageController follower)
        {
            if (notification.depth == 0 && notification is ScrollUpdateNotification)
            {
                this.selectedIndex.value = leader.page;
                if (follower.page != leader.page)
                {
                    follower.position.jumpTo(leader.position.pixels); // ignore: deprecated_member_use
                }
            }

            return(false);
        }
Ejemplo n.º 18
0
        bool _onNotification(BuildContext context, ScrollNotification notification, EventStatus eventStatus,
                             IEvent eventObj)
        {
            if (eventStatus == EventStatus.past && eventObj.record.isEmpty())
            {
                var pixels = notification.metrics.pixels;
                if (this._titleHeight == 0.0f)
                {
                    var width       = MediaQuery.of(context).size.width;
                    var imageHeight = 9.0f / 16.0f * width;
                    this._titleHeight = imageHeight + eventTitleKey.currentContext.size.height + 16 - 64;
                }

                if (pixels >= 44)
                {
                    if (this._showNavBarShadow)
                    {
                        this.setState(() => { this._showNavBarShadow = false; });
                    }
                }
                else
                {
                    if (!this._showNavBarShadow)
                    {
                        this.setState(() => { this._showNavBarShadow = true; });
                    }
                }

                if (pixels >= this._titleHeight)
                {
                    if (!this._isHaveTitle)
                    {
                        this._titleAnimationController.forward();
                        this.setState(() => { this._isHaveTitle = true; });
                    }
                }
                else
                {
                    if (this._isHaveTitle)
                    {
                        this._titleAnimationController.reverse();
                        this.setState(() => { this._isHaveTitle = false; });
                    }
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 19
0
        bool _onNotification(ScrollNotification notification)
        {
            var axisDirection = notification.metrics.axisDirection;

            if (axisDirection == AxisDirection.left || axisDirection == AxisDirection.right)
            {
                return(true);
            }

            var pixels = notification.metrics.pixels;

            if (this._selectedIndex == 0)
            {
                this._followArticlePixels = pixels;
            }

            if (this._selectedIndex == 1)
            {
                this._recommendArticlePixels = pixels;
            }

            if (pixels <= 0)
            {
                if (this._navBarHeight != CustomAppBarUtil.appBarHeight)
                {
                    this._navBarHeight = CustomAppBarUtil.appBarHeight;
                    this.setState(() => { });
                }
            }
            else
            {
                if (pixels <= CustomAppBarUtil.appBarHeight)
                {
                    this._navBarHeight = CustomAppBarUtil.appBarHeight - pixels;
                    this.setState(() => { });
                }
                else
                {
                    if (this._navBarHeight != 0)
                    {
                        this._navBarHeight = 0;
                        this.setState(() => { });
                    }
                }
            }

            this._changeTabBarItemStatus(pixels: pixels, status: TabBarItemStatus.toHome);
            return(true);
        }
        bool _onNotification(BuildContext context, ScrollNotification notification)
        {
            var pixels     = notification.metrics.pixels;
            var topPadding = 44 + CCommonUtils.getSafeAreaTopPadding(context: context);

            if (this._titleHeight == 0.0f)
            {
                var width       = MediaQuery.of(context).size.width;
                var imageHeight = width / this._aspectRatio;
                this._titleHeight = imageHeight + eventTitleKey.currentContext.size.height - topPadding +
                                    16; // topPadding 是顶部的高度 16 是文字与图片的间隙
            }

            if (pixels >= 44 + topPadding)
            {
                if (this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = false; });
                    StatusBarManager.statusBarStyle(false);
                }
            }
            else
            {
                if (!this._showNavBarShadow)
                {
                    this.setState(() => { this._showNavBarShadow = true; });
                    StatusBarManager.statusBarStyle(true);
                }
            }

            if (pixels > this._titleHeight)
            {
                if (!this._isHaveTitle)
                {
                    this._controller.forward();
                    this.setState(() => { this._isHaveTitle = true; });
                }
            }
            else
            {
                if (this._isHaveTitle)
                {
                    this._controller.reverse();
                    this.setState(() => { this._isHaveTitle = false; });
                }
            }

            return(true);
        }
Ejemplo n.º 21
0
        bool _dispatchScrollEvent(ScrollNotification notification)
        {
            this.widget.onNotification?.Invoke(notification);

            var axisDirection   = notification.metrics.axisDirection;
            var scrollDirection = this.widget.child.scrollDirection;

            if ((axisDirection == AxisDirection.left || axisDirection == AxisDirection.right) && scrollDirection == Axis.vertical)
            {
                return(false);
            }

            if ((axisDirection == AxisDirection.up || axisDirection == AxisDirection.down) && scrollDirection == Axis.horizontal)
            {
                return(false);
            }

            // when is scroll in the ScrollInside,nothing to do
            if (!_isPullUp(notification) && !_isPullDown(notification))
            {
                return(false);
            }

            if (notification is ScrollStartNotification startNotification)
            {
                return(this._handleScrollStart(startNotification));
            }

            if (notification is ScrollUpdateNotification updateNotification)
            {
                //if dragDetails is null,This represents the user's finger out of the screen
                if (updateNotification.dragDetails == null)
                {
                    return(this._handleScrollEnd(notification));
                }

                if (updateNotification.dragDetails != null)
                {
                    return(this._handleScrollMoving(updateNotification));
                }
            }

            if (notification is ScrollEndNotification)
            {
                this._handleScrollEnd(notification);
            }

            return(false);
        }
Ejemplo n.º 22
0
        bool _handleScrollNotification(ScrollNotification notification, float midScrollOffset)
        {
            if (notification.depth == 0 && notification is ScrollUpdateNotification)
            {
                ScrollPhysics physics = this._scrollController.position.pixels >= midScrollOffset
                    ? (ScrollPhysics) new PageScrollPhysics()
                    : new NeverScrollableScrollPhysics();
                if (physics != this._headingScrollPhysics)
                {
                    this.setState(() => { this._headingScrollPhysics = physics; });
                }
            }

            return(false);
        }
Ejemplo n.º 23
0
        bool _handleScrollEnd(ScrollNotification notification)
        {
            GestureProcessor topWrap    = this._headerKey.currentState as GestureProcessor;
            GestureProcessor bottomWrap = this._footerKey.currentState as GestureProcessor;

            if (this.widget.enablePullUp)
            {
                bottomWrap.onDragEnd(notification);
            }

            if (this.widget.enablePullDown)
            {
                topWrap.onDragEnd(notification);
            }

            return(false);
        }
        bool _onNotification(ScrollNotification notification)
        {
            var enablePullUp = this.widget.viewModel.bloggerHasMore;

            if (!enablePullUp)
            {
                return(false);
            }

            if (notification.metrics.pixels >= notification.metrics.maxScrollExtent && !this._isLoading)
            {
                this.setState(() => this._isLoading = true);
                this.leaderBoardBloggerPageNumber++;
                this.widget.actionModel.fetchBlogger(arg: this.leaderBoardBloggerPageNumber)
                .Then(() => this.setState(() => this._isLoading = false))
                .Catch(_ => this.setState(() => this._isLoading = false));
            }
            return(false);
        }
Ejemplo n.º 25
0
        float _measure(ScrollNotification notification)
        {
            if (notification.metrics.minScrollExtent - notification.metrics.pixels >
                0)
            {
                return((notification.metrics.minScrollExtent -
                        notification.metrics.pixels) / this.widget.headerConfig.triggerDistance);
            }

            if (notification.metrics.pixels -
                notification.metrics.maxScrollExtent >
                0)
            {
                return((notification.metrics.pixels -
                        notification.metrics.maxScrollExtent) / this.widget.footerConfig.triggerDistance);
            }

            return(-1.0f);
        }
Ejemplo n.º 26
0
        bool _onNotification(ScrollNotification notification)
        {
            var axisDirection = notification.metrics.axisDirection;

            if (axisDirection == AxisDirection.left || axisDirection == AxisDirection.right)
            {
                return(true);
            }

            var pixels = notification.metrics.pixels;

            SchedulerBinding.instance.addPostFrameCallback(_ => {
                if (pixels > 0 && pixels <= _maxNavBarHeight - _minNavBarHeight)
                {
                    this._titleFontSize = _maxTitleFontSize
                                          - (_maxTitleFontSize - _minTitleFontSize) /
                                          (_maxNavBarHeight - _minNavBarHeight)
                                          * pixels;
                    this._navBarHeight = _maxNavBarHeight - pixels;
                    this.setState(() => { });
                }
                else if (pixels <= 0)
                {
                    if (this._navBarHeight <= _maxNavBarHeight)
                    {
                        this._titleFontSize = _maxTitleFontSize;
                        this._navBarHeight  = _maxNavBarHeight;
                        this.setState(() => { });
                    }
                }
                else if (pixels > 52)
                {
                    if (!(this._navBarHeight <= _minNavBarHeight))
                    {
                        this._titleFontSize = _minTitleFontSize;
                        this._navBarHeight  = _minNavBarHeight;
                        this.setState(() => { });
                    }
                }
            });
            return(true);
        }
        bool _onNotification(ScrollNotification notification)
        {
            var enablePullUp = this.widget.viewModel.collectionHasMore;

            if (!enablePullUp)
            {
                return(false);
            }

            if (notification.metrics.pixels >= notification.metrics.maxScrollExtent && !this._isLoading)
            {
                this.setState(() => this._isLoading = true);
                var pageNumber = this.widget.viewModel.collectionPageNumber + 1;
                this.widget.actionModel.fetchCollection(arg: pageNumber)
                .Then(() => this.setState(() => this._isLoading = false))
                .Catch(_ => this.setState(() => this._isLoading = false));
            }

            return(false);
        }
Ejemplo n.º 28
0
        bool _handleScrollNotification(ScrollNotification notification)
        {
            if (notification is ScrollUpdateNotification || notification is OverscrollNotification)
            {
                if (this._fadeoutAnimationController.status != AnimationStatus.forward)
                {
                    this._fadeoutAnimationController.forward();
                }

                this._materialPainter.update(notification.metrics, notification.metrics.axisDirection);
                this._fadeoutTimer?.cancel();

                this._fadeoutTimer = Window.instance.run(ScrollbarUtils._kScrollbarTimeToFade, () => {
                    this._fadeoutAnimationController.reverse();
                    this._fadeoutTimer = null;
                });
            }

            return(false);
        }
Ejemplo n.º 29
0
            bool _onNotification(ScrollNotification notification, BuildContext context)
            {
                float pixels = notification.metrics.pixels;

                if (pixels >= 0.0)
                {
                    if (pixels <= headerHeight)
                    {
                        this.setState(() => { this._offsetY = pixels / 2.0f; });
                    }
                }
                else
                {
                    if (this._offsetY != 0.0)
                    {
                        this.setState(() => { this._offsetY = 0.0f; });
                    }
                }

                return(true);
            }
Ejemplo n.º 30
0
        public bool _isScrollToOutSide(ScrollNotification notification)
        {
            if (this.up)
            {
                if (notification.metrics.minScrollExtent - notification.metrics.pixels >
                    0)
                {
                    return(true);
                }
            }
            else
            {
                if (notification.metrics.pixels - notification.metrics.maxScrollExtent >
                    0)
                {
                    return(true);
                }
            }

            return(false);
        }