Permalink
Browse files

Fix scrolling events for RN.

Reviewed By: bvaughn

Differential Revision: D6020664

fbshipit-source-id: c9fb9069e9dcde298901ba2c03bacc8b646844d0
  • Loading branch information...
Dmitry Zakharov authored and facebook-github-bot committed Oct 10, 2017
1 parent e50464d commit ca834f96afcb99a7f1f4eec0a864f4f5b33a632b
Showing with 18 additions and 15 deletions.
  1. +18 −15 ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstants.java
@@ -9,17 +9,12 @@
package com.facebook.react.uimanager;
import java.util.HashMap;
import java.util.Map;
import android.util.DisplayMetrics;
import android.view.accessibility.AccessibilityEvent;
import android.widget.ImageView;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.MapBuilder;
import com.facebook.react.uimanager.events.TouchEventType;
import java.util.Map;
/**
* Constants exposed to JS from {@link UIManagerModule}.
@@ -81,19 +76,27 @@
}
/* package */ static Map getDirectEventTypeConstants() {
final String rn = "registrationName";
return MapBuilder.builder()
.put("topContentSizeChange", MapBuilder.of("registrationName", "onContentSizeChange"))
.put("topLayout", MapBuilder.of("registrationName", "onLayout"))
.put("topLoadingError", MapBuilder.of("registrationName", "onLoadingError"))
.put("topLoadingFinish", MapBuilder.of("registrationName", "onLoadingFinish"))
.put("topLoadingStart", MapBuilder.of("registrationName", "onLoadingStart"))
.put("topSelectionChange", MapBuilder.of("registrationName", "onSelectionChange"))
.put("topMessage", MapBuilder.of("registrationName", "onMessage"))
.put("topContentSizeChange", MapBuilder.of(rn, "onContentSizeChange"))
.put("topLayout", MapBuilder.of(rn, "onLayout"))
.put("topLoadingError", MapBuilder.of(rn, "onLoadingError"))
.put("topLoadingFinish", MapBuilder.of(rn, "onLoadingFinish"))
.put("topLoadingStart", MapBuilder.of(rn, "onLoadingStart"))
.put("topSelectionChange", MapBuilder.of(rn, "onSelectionChange"))
.put("topMessage", MapBuilder.of(rn, "onMessage"))
// Scroll events are added as per task T22348735.
// Subject for further improvement.
.put("topScrollBeginDrag", MapBuilder.of(rn, "onScrollBeginDrag"))
.put("topScrollEndDrag", MapBuilder.of(rn, "onScrollEndDrag"))
.put("topScroll", MapBuilder.of(rn, "onScroll"))
.put("topMomentumScrollBegin", MapBuilder.of(rn, "onMomentumScrollBegin"))
.put("topMomentumScrollEnd", MapBuilder.of(rn, "onMomentumScrollEnd"))
.build();
}
public static Map<String, Object> getConstants() {
HashMap<String, Object> constants = new HashMap<String, Object>();
Map<String, Object> constants = MapBuilder.newHashMap();
constants.put(
"UIView",
MapBuilder.of(

0 comments on commit ca834f9

Please sign in to comment.