You can specify an offset
value on the FormAttachment
to specify the number of pixels to offset the attachment, so:
data.left = new FormAttachment(0, 50);
data.right = new FormAttachment(100, -50);
positions at the left and right with a fixed 50 pixel offset.