Search in sources :

Example 1 with GestureStateListener

use of org.chromium.content_public.browser.GestureStateListener in project AndroidChromium by JackyAndroid.

the class Tab method createGestureStateListener.

private GestureStateListener createGestureStateListener() {
    return new GestureStateListener() {

        @Override
        public void onFlingStartGesture(int scrollOffsetY, int scrollExtentY) {
            onScrollingStateChanged();
        }

        @Override
        public void onFlingEndGesture(int scrollOffsetY, int scrollExtentY) {
            onScrollingStateChanged();
        }

        @Override
        public void onScrollStarted(int scrollOffsetY, int scrollExtentY) {
            onScrollingStateChanged();
        }

        @Override
        public void onScrollEnded(int scrollOffsetY, int scrollExtentY) {
            onScrollingStateChanged();
        }

        private void onScrollingStateChanged() {
            FullscreenManager fullscreenManager = getFullscreenManager();
            if (fullscreenManager == null)
                return;
            fullscreenManager.onContentViewScrollingStateChanged(getContentViewCore() != null && getContentViewCore().isScrollInProgress());
        }
    };
}
Also used : GestureStateListener(org.chromium.content_public.browser.GestureStateListener) FullscreenManager(org.chromium.chrome.browser.fullscreen.FullscreenManager)

Aggregations

FullscreenManager (org.chromium.chrome.browser.fullscreen.FullscreenManager)1 GestureStateListener (org.chromium.content_public.browser.GestureStateListener)1