Search in sources :

Example 1 with ReactPointerEventsView

use of com.facebook.react.uimanager.ReactPointerEventsView 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)

Aggregations

PointerEvents (com.facebook.react.uimanager.PointerEvents)1 ReactPointerEventsView (com.facebook.react.uimanager.ReactPointerEventsView)1