Skip to content

Instantly share code, notes, and snippets.

@bakialmaci
Last active July 3, 2020 15:00
Show Gist options
  • Save bakialmaci/f87f656b7044b6ea35d87689d734be41 to your computer and use it in GitHub Desktop.
Save bakialmaci/f87f656b7044b6ea35d87689d734be41 to your computer and use it in GitHub Desktop.
package com.gesturehandler;
import com.facebook.react.ReactActivity;
+ import com.facebook.react.ReactActivityDelegate;
+ import com.facebook.react.ReactRootView;
+ import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "gestureHandler";
}
+ @Override
+ protected ReactActivityDelegate createReactActivityDelegate() {
+ return new ReactActivityDelegate(this, getMainComponentName()) {
+ @Override
+ protected ReactRootView createRootView() {
+ return new RNGestureHandlerEnabledRootView(MainActivity.this);
+ }
+ };
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment