mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
9e026ec358
commit
aeccbd6906
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user