mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-30 14:02:44 +08:00
Add GuardedRunnable in more places
Summary: Depends on D4537287 Use new GuardedRunnable abstraction Reviewed By: achen1 Differential Revision: D4537370 fbshipit-source-id: ad56eaa23c21624008d8ed48837a2d1020cfd2d9
This commit is contained in:
committed by
Facebook Github Bot
parent
08db896321
commit
a99f6f51a9
@@ -21,6 +21,7 @@ import android.content.res.Configuration;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.react.animation.Animation;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
import com.facebook.react.bridge.GuardedRunnable;
|
||||
import com.facebook.react.bridge.LifecycleEventListener;
|
||||
import com.facebook.react.bridge.NativeModuleLogger;
|
||||
import com.facebook.react.bridge.OnBatchCompleteListener;
|
||||
@@ -202,8 +203,9 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
height = rootView.getHeight();
|
||||
}
|
||||
|
||||
final ReactApplicationContext reactApplicationContext = getReactApplicationContext();
|
||||
final ThemedReactContext themedRootContext =
|
||||
new ThemedReactContext(getReactApplicationContext(), rootView.getContext());
|
||||
new ThemedReactContext(reactApplicationContext, rootView.getContext());
|
||||
|
||||
mUIImplementation.registerRootView(rootView, tag, width, height, themedRootContext);
|
||||
|
||||
@@ -211,10 +213,10 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
new SizeMonitoringFrameLayout.OnSizeChangedListener() {
|
||||
@Override
|
||||
public void onSizeChanged(final int width, final int height, int oldW, int oldH) {
|
||||
getReactApplicationContext().runOnNativeModulesQueueThread(
|
||||
new Runnable() {
|
||||
reactApplicationContext.runOnNativeModulesQueueThread(
|
||||
new GuardedRunnable(reactApplicationContext) {
|
||||
@Override
|
||||
public void run() {
|
||||
public void runGuarded() {
|
||||
updateNodeSize(tag, width, height);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user