Skip to content

Commit

Permalink
Force setConstraints to run in the JS Thread
Browse files Browse the repository at this point in the history
Summary: This diff forces the method: scheduler.constraintSurfaceLayout to run on the JS thread.

Reviewed By: JoshuaGross

Differential Revision: D15845768

fbshipit-source-id: de2aa69f301770aaf6cb7c3f5670548a3b6110df
  • Loading branch information
mdvacca authored and facebook-github-bot committed Jun 18, 2019
1 parent 5d18e9a commit f43039d
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,17 @@ public void setBinding(Binding binding) {
public void updateRootLayoutSpecs(
final int rootTag, final int widthMeasureSpec, final int heightMeasureSpec) {

mBinding.setConstraints(
rootTag,
getMinSize(widthMeasureSpec),
getMaxSize(widthMeasureSpec),
getMinSize(heightMeasureSpec),
getMaxSize(heightMeasureSpec));
mReactApplicationContext.runOnJSQueueThread(new Runnable() {
@Override
public void run() {
mBinding.setConstraints(
rootTag,
getMinSize(widthMeasureSpec),
getMaxSize(widthMeasureSpec),
getMinSize(heightMeasureSpec),
getMaxSize(heightMeasureSpec));
}
});
}

public void receiveEvent(int reactTag, String eventName, @Nullable WritableMap params) {
Expand Down

0 comments on commit f43039d

Please sign in to comment.