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:
committed by
Facebook GitHub Bot
parent
842fe6df5c
commit
d4d2937c80
@@ -230,7 +230,10 @@ public class ViewDescriptor extends NodeDescriptor<View> {
|
|||||||
node.setVisibility(sVisibilityMapping.get(value.asString()));
|
node.setVisibility(sVisibilityMapping.get(value.asString()));
|
||||||
break;
|
break;
|
||||||
case "layoutParams":
|
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;
|
break;
|
||||||
case "layoutDirection":
|
case "layoutDirection":
|
||||||
node.setLayoutDirection(sLayoutDirectionMapping.get(value.asString()));
|
node.setLayoutDirection(sLayoutDirectionMapping.get(value.asString()));
|
||||||
|
|||||||
Reference in New Issue
Block a user