Fix setting layoutParams fromLayout Editor

Summary:
The function `setLayoutParams` expects the values to be set to be at array position 0+, and they were on position 1+ instead.

This effectively prevented users from setting LayoutParameters.

Reviewed By: muraziz

Differential Revision: D23538531

fbshipit-source-id: cc828363ee8d7408d1df29d98c37b09893826bb1
This commit is contained in:
Paco Estevez Garcia
2020-09-06 12:57:02 -07:00
committed by Facebook GitHub Bot
parent 842fe6df5c
commit d4d2937c80

View File

@@ -230,7 +230,10 @@ public class ViewDescriptor extends NodeDescriptor<View> {
node.setVisibility(sVisibilityMapping.get(value.asString()));
break;
case "layoutParams":
setLayoutParams(node, Arrays.copyOfRange(path, 1, path.length), value);
// path is [view, layoutParams, value] and we only want the values
if (path.length > 2) {
setLayoutParams(node, Arrays.copyOfRange(path, 2, path.length), value);
}
break;
case "layoutDirection":
node.setLayoutDirection(sLayoutDirectionMapping.get(value.asString()));