Example usage for com.facebook.react.views.scroll ScrollEventType SCROLL

List of usage examples for com.facebook.react.views.scroll ScrollEventType SCROLL

Introduction

In this page you can find the example usage for com.facebook.react.views.scroll ScrollEventType SCROLL.

Prototype

ScrollEventType SCROLL

To view the source code for com.facebook.react.views.scroll ScrollEventType SCROLL.

Click Source Link

Usage

From source file:com.bottomsheetbehavior.ReactNestedScrollViewHelper.java

License:Open Source License

/**
 * Shared by {@link ReactScrollView} and {@link ReactHorizontalScrollView}.
 *///  ww  w  .  ja v  a 2  s.  com
public static void emitScrollEvent(ViewGroup scrollView) {
    emitScrollEvent(scrollView, ScrollEventType.SCROLL);
}

From source file:com.bottomsheetbehavior.ReactNestedScrollViewManager.java

License:Open Source License

public static Map createExportedCustomDirectEventTypeConstants() {
    return MapBuilder.builder()
            .put(ScrollEventType.SCROLL.getJSEventName(), MapBuilder.of("registrationName", "onScroll"))
            .put(ScrollEventType.BEGIN_DRAG.getJSEventName(),
                    MapBuilder.of("registrationName", "onScrollBeginDrag"))
            .put(ScrollEventType.END_DRAG.getJSEventName(),
                    MapBuilder.of("registrationName", "onScrollEndDrag"))
            .put(ScrollEventType.ANIMATION_END.getJSEventName(),
                    MapBuilder.of("registrationName", "onScrollAnimationEnd"))
            .put(ScrollEventType.MOMENTUM_BEGIN.getJSEventName(),
                    MapBuilder.of("registrationName", "onMomentumScrollBegin"))
            .put(ScrollEventType.MOMENTUM_END.getJSEventName(),
                    MapBuilder.of("registrationName", "onMomentumScrollEnd"))
            .build();/*from  w w  w  .  j ava2s . co m*/
}

From source file:com.reactnativeandroiddesignsupport.ReactNestedScrollViewHelper.java

License:Open Source License

/**
 * Shared by {@link ReactScrollView} and {@link ReactHorizontalScrollView}.
 *//*from  www .  ja v  a  2 s. c  om*/
public static void emitScrollEvent(ViewGroup scrollView, int scrollX, int scrollY) {
    View contentView = scrollView.getChildAt(0);
    ReactContext reactContext = (ReactContext) scrollView.getContext();
    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()
            .dispatchEvent(ScrollEvent.obtain(scrollView.getId(), SystemClock.uptimeMillis(),
                    ScrollEventType.SCROLL, scrollX, scrollY, contentView.getWidth(), contentView.getHeight(),
                    scrollView.getWidth(), scrollView.getHeight()));
}

From source file:com.rnnestedscrollview.ReactNestedScrollViewManager.java

License:MIT License

public static Map<String, Object> createExportedCustomDirectEventTypeConstants() {
    return MapBuilder.<String, Object>builder()
            .put(ScrollEventType.getJSEventName(ScrollEventType.SCROLL),
                    MapBuilder.of("registrationName", "onScroll"))
            .put(ScrollEventType.getJSEventName(ScrollEventType.BEGIN_DRAG),
                    MapBuilder.of("registrationName", "onScrollBeginDrag"))
            .put(ScrollEventType.getJSEventName(ScrollEventType.END_DRAG),
                    MapBuilder.of("registrationName", "onScrollEndDrag"))
            .put(ScrollEventType.getJSEventName(ScrollEventType.MOMENTUM_BEGIN),
                    MapBuilder.of("registrationName", "onMomentumScrollBegin"))
            .put(ScrollEventType.getJSEventName(ScrollEventType.MOMENTUM_END),
                    MapBuilder.of("registrationName", "onMomentumScrollEnd"))
            .build();//from   w  w w  .  j  a va  2s.com
}

From source file:com.zulipmobile.AnchorScrollEvent.java

License:Open Source License

@Override
public boolean canCoalesce() {
    // Only SCROLL events can be coalesced, all others can not be
    if (mScrollEventType == ScrollEventType.SCROLL) {
        return true;
    }/*from www .j  a  v a  2  s  .  com*/
    return false;
}

From source file:com.zulipmobile.AnchorScrollViewHelper.java

License:Open Source License

/**
 * Used by {@link AnchorScrollView}//w  ww .  j a va  2s.  c o  m
 */
public static void emitScrollEvent(ViewGroup scrollView, @Nullable ArrayList<String> visibleIds,
        @Nullable boolean humanInteraction) {
    emitScrollEvent(scrollView, ScrollEventType.SCROLL, visibleIds, humanInteraction);
}