Updating shake handling for Android in ShakeDetector and DevSupportManagerImpl

Summary: If you use a ShakeDetector, you can specify the minimum number of shakes required to trigger a shake handler.  Otherwise, the minimum number of required shakes is set to 1 by default.

Reviewed By: achen1

Differential Revision: D5155604

fbshipit-source-id: 5073fa37d4c223eb18e85b5e850b95d37136e3d2
This commit is contained in:
Summer Kitahara
2017-06-05 21:35:33 -07:00
committed by Facebook Github Bot
parent 9e026ec358
commit aeccbd6906
5 changed files with 92 additions and 39 deletions
@@ -44,6 +44,7 @@ public class ReactInstanceManagerBuilder {
protected boolean mLazyViewManagersEnabled;
protected boolean mSetupReactContextInBackground;
protected boolean mUseSeparateUIBackgroundThread;
protected int mMinNumShakes = 1;
/* package protected */ ReactInstanceManagerBuilder() {
}
@@ -200,6 +201,11 @@ public class ReactInstanceManagerBuilder {
return this;
}
public ReactInstanceManagerBuilder setMinNumShakes(int minNumShakes) {
mMinNumShakes = minNumShakes;
return this;
}
/**
* Instantiates a new {@link ReactInstanceManager}.
* Before calling {@code build}, the following must be called:
@@ -247,6 +253,7 @@ public class ReactInstanceManagerBuilder {
mLazyNativeModulesEnabled,
mLazyViewManagersEnabled,
mSetupReactContextInBackground,
mUseSeparateUIBackgroundThread);
mUseSeparateUIBackgroundThread,
mMinNumShakes);
}
}