title: Set margin on a custom toast
body: <p>I'm displaying a custom toast and need to apply a left and right margin on it. So far this is what I've tried:</p>
  
  <p><strong>JAVA</strong></p>
  
  <pre><code>public void showCustomToast() {
      Toast toast = new Toast(context);
      toast.setGravity(Gravity.TOP|Gravity.FILL_HORIZONTAL, 0, 100);
      toast.setView(view);
      toast.setDuration(Toast.LENGTH_LONG);
      if (toast != null) toast.show();
  }
  </code></pre>
  
  <p><code>Gravity.FILL_HORIZONTAL</code> makes the toast fill the whole layout_width.</p>
  
  <p><strong>XML</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="80dp"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:padding="10dp"
  android:layout_marginStart="200dp"
  android:layout_marginEnd="20dp"&gt;
  
  &lt;ImageView
      android:id="@+id/imgTest"
      android:layout_width="40dp"
      android:layout_height="40dp"
      android:layout_marginBottom="8dp"
      android:layout_marginStart="8dp"
      android:layout_marginTop="8dp"
      android:contentDescription="@string/test"
      android:rotation="-50"
      android:src="@drawable/test"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent" /&gt;
  
  &lt;TextView
      android:id="@+id/tvTest"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:letterSpacing=".1"
      android:text="@string/test"
      android:textAppearance="@style/TextAppearance.AppCompat.Medium"
      android:textColor="@android:color/black"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintBottom_toBottomOf="parent"/&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>Specifying a definite layout_width, such as 100dp also has no effect since I'm using <code>FILL_HORIZONTAL</code> property. How can achieve the margins on the custom layout?</p>