mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-02 14:54:58 +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
@@ -27,6 +27,7 @@ import android.widget.FrameLayout;
|
||||
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.R;
|
||||
import com.facebook.react.bridge.GuardedRunnable;
|
||||
import com.facebook.react.bridge.LifecycleEventListener;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
@@ -303,10 +304,11 @@ public class ReactModalHostView extends ViewGroup implements LifecycleEventListe
|
||||
protected void onSizeChanged(final int w, final int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
if (getChildCount() > 0) {
|
||||
((ReactContext) getContext()).runOnNativeModulesQueueThread(
|
||||
new Runnable() {
|
||||
ReactContext reactContext = (ReactContext) getContext();
|
||||
reactContext.runOnNativeModulesQueueThread(
|
||||
new GuardedRunnable(reactContext) {
|
||||
@Override
|
||||
public void run() {
|
||||
public void runGuarded() {
|
||||
((ReactContext) getContext()).getNativeModule(UIManagerModule.class)
|
||||
.updateNodeSize(getChildAt(0).getId(), w, h);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user