Render top back and back button on search results

Differential Revision: D3238568

fb-gh-sync-id: d28eee4cefb88a4b43fd3c16357de3443aec6bc5
fbshipit-source-id: d28eee4cefb88a4b43fd3c16357de3443aec6bc5
This commit is contained in:
Igor Avramovic 2016-04-29 17:58:42 -07:00 committed by Facebook Github Bot 0
parent 0c590b325d
commit 850ce649d4
1 changed files with 9 additions and 0 deletions

View File

@ -57,6 +57,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
private @Nullable String mJSModuleName;
private @Nullable Bundle mLaunchOptions;
private @Nullable KeyboardListener mKeyboardListener;
private @Nullable OnGenericMotionListener mOnGenericMotionListener;
private boolean mWasMeasured = false;
private boolean mAttachScheduled = false;
private boolean mIsAttachedToWindow = false;
@ -121,6 +122,10 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class)
.getEventDispatcher();
mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher);
// Hook for containers or fragments to get informed of the on touch events to perform actions.
if (mOnGenericMotionListener != null) {
mOnGenericMotionListener.onGenericMotion(this, androidEvent);
}
}
@Override
@ -138,6 +143,10 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
return true;
}
public void setOnGenericMotionListener(OnGenericMotionListener listener) {
mOnGenericMotionListener = listener;
}
private void dispatchJSTouchEvent(MotionEvent event) {
if (mReactInstanceManager == null || !mIsAttachedToInstance ||
mReactInstanceManager.getCurrentReactContext() == null) {