mirror of
https://github.com/status-im/react-native-mapbox-gl.git
synced 2026-08-30 12:31:11 +00:00
Make progress notifications throttle configurable
This commit is contained in:
+11
-1
@@ -34,6 +34,7 @@ import com.facebook.react.bridge.WritableArray;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.bridge.WritableNativeArray;
|
||||
import com.facebook.react.modules.core.RCTNativeAppEventEmitter;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
import com.mapbox.mapboxsdk.MapboxAccountManager;
|
||||
import com.mapbox.mapboxsdk.constants.MyLocationTracking;
|
||||
import com.mapbox.mapboxsdk.constants.MyBearingTracking;
|
||||
@@ -57,6 +58,8 @@ public class ReactNativeMapboxGLModule extends ReactContextBaseJavaModule {
|
||||
private ReactApplicationContext context;
|
||||
private ReactNativeMapboxGLPackage aPackage;
|
||||
Handler mainHandler;
|
||||
private int throttleInterval = 300;
|
||||
|
||||
private static boolean initialized = false;
|
||||
|
||||
public ReactNativeMapboxGLModule(ReactApplicationContext reactContext, ReactNativeMapboxGLPackage thePackage) {
|
||||
@@ -198,7 +201,7 @@ public class ReactNativeMapboxGLModule extends ReactContextBaseJavaModule {
|
||||
fireUpdateEvent();
|
||||
}
|
||||
}
|
||||
}, 100);
|
||||
}, throttleInterval);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -519,4 +522,11 @@ public class ReactNativeMapboxGLModule extends ReactContextBaseJavaModule {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Offline throttle control
|
||||
|
||||
@ReactMethod
|
||||
public void setOfflinePackProgressThrottleInterval(int milis) {
|
||||
throttleInterval = milis;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user