setLayoutMarginHorizontal

fun View.setLayoutMarginHorizontal(margin: Int?)

Sets the ViewGroup.MarginLayoutParams.leftMargin and ViewGroup.MarginLayoutParams.rightMargin of the View to the given margin. If margin is null, the left and right margins are set to 0.