Search in sources :

Example 1 with PointerEvents

use of com.facebook.react.uimanager.PointerEvents in project react-native-gesture-handler by kmagiera.

the class RNViewConfigurationHelper method getPointerEventsConfigForView.

@Override
public PointerEventsConfig getPointerEventsConfigForView(View view) {
    PointerEvents pointerEvents;
    pointerEvents = view instanceof ReactPointerEventsView ? ((ReactPointerEventsView) view).getPointerEvents() : PointerEvents.AUTO;
    // be valid targets.
    if (!view.isEnabled()) {
        if (pointerEvents == PointerEvents.AUTO) {
            return PointerEventsConfig.BOX_NONE;
        } else if (pointerEvents == PointerEvents.BOX_ONLY) {
            return PointerEventsConfig.NONE;
        }
    }
    switch(pointerEvents) {
        case BOX_ONLY:
            return PointerEventsConfig.BOX_ONLY;
        case BOX_NONE:
            return PointerEventsConfig.BOX_NONE;
        case NONE:
            return PointerEventsConfig.NONE;
    }
    return PointerEventsConfig.AUTO;
}
Also used : PointerEvents(com.facebook.react.uimanager.PointerEvents) ReactPointerEventsView(com.facebook.react.uimanager.ReactPointerEventsView)

Example 2 with PointerEvents

use of com.facebook.react.uimanager.PointerEvents in project gl-react-native by ProjectSeptemberInc.

the class GLCanvasManager method setPointerEvents.

@ReactProp(name = "pointerEvents")
public void setPointerEvents(GLCanvas view, @Nullable String pointerEventsStr) {
    if (pointerEventsStr != null) {
        PointerEvents pointerEvents = PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_"));
        view.setPointerEvents(pointerEvents);
    }
}
Also used : PointerEvents(com.facebook.react.uimanager.PointerEvents) ReactProp(com.facebook.react.uimanager.annotations.ReactProp)

Aggregations

PointerEvents (com.facebook.react.uimanager.PointerEvents)2 ReactPointerEventsView (com.facebook.react.uimanager.ReactPointerEventsView)1 ReactProp (com.facebook.react.uimanager.annotations.ReactProp)1