What is the right way to add margin to this views?

Solution for What is the right way to add margin to this views?
is Given Below:

I have a problem.
I want to add background to a group of buttons and text views. the thing is that I want the background to have a margin over the inputs so it doesn’t look bad.
I can’t make the views inside a container layout and then add background to him because I need the views in the same layout as all the other views. So, I did a View with a background and constrained it to the desired views.
How can I add margin to this background over the views? without adding margin manually to each of the views.
Maybe there is another option other than creating a View with a background?

how it looks like
enter image description here

how I want it
enter image description here

thanks in advance

Edit:
Forgot to add the code. Here it is:

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp">

<View
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:background="@drawable/edit_add_card_group_shape"
    app:layout_constraintStart_toStartOf="@id/tvContact"
    app:layout_constraintEnd_toEndOf="@id/etPhoneNumber"
    app:layout_constraintTop_toTopOf="@id/btAreaCode"
    app:layout_constraintBottom_toBottomOf="@id/btAddPhone" />

<com.google.android.material.textfield.TextInputEditText
    android:id="@+id/etPhoneNumber"
    style="@style/Widget.App.EditText.TextSize"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:autofillHints=""
    android:hint="@string/phone_number"
    android:inputType="phone"
    android:layout_marginEnd="10dp"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.5"
    app:layout_constraintStart_toStartOf="@+id/guideline3"
    app:layout_constraintTop_toBottomOf="@id/tvContact" />

<com.google.android.material.button.MaterialButton
    android:id="@+id/btAreaCode"
    style="@style/Widget.App.Button.TextButton.RegularColor"
    android:layout_width="0dp"
    android:layout_marginStart="10dp"
    android:layout_marginTop="10dp"
    android:layout_height="wrap_content"
    android:drawableEnd="@drawable/ic_baseline_arrow_forward_ios_24"
    android:text="@string/phone"
    android:textAlignment="textStart"
    app:layout_constraintBottom_toBottomOf="@id/etPhoneNumber"
    app:layout_constraintEnd_toStartOf="@+id/etPhoneNumber"
    app:layout_constraintHorizontal_bias="0.5"
    app:layout_constraintStart_toEndOf="@+id/tvContact"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="@id/etPhoneNumber" />

<com.google.android.material.button.MaterialButton
    android:id="@+id/btAddPhone"
    style="@style/Widget.App.Button.TextButton"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/add_phone_number"
    android:textAlignment="textStart"
    app:layout_constraintEnd_toEndOf="parent"
    android:layout_marginBottom="10dp"
    android:layout_marginStart="10dp"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@id/etPhoneNumber2" />

</androidx.constraintlayout.widget.ConstraintLayout>

Use android:padding in your ConstraintLayout

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:padding="12dp">

</androidx.constraintlayout.widget.ConstraintLayout>