title: DialogFragment's width and height is wrap content, but I wrote match parent in attributes
body: <p>My DialogFragment at the moment is using in code match_parent sizes for width and height, but in emulator and in real device he is wrap_content.Used the databinding, kotlin</p>
  <p>I have addcardialog.kt:</p>
  <pre><code>package kz.jy.android.ui.custom_dialog_add_car
  
  import android.content.res.Resources
  import android.os.Bundle
  import android.view.LayoutInflater
  import android.view.View
  import android.view.ViewGroup
  import android.widget.Toast
  import androidx.databinding.DataBindingUtil
  import androidx.fragment.app.DialogFragment
  import kz.jy.android.R
  import kz.jy.android.databinding.DialogAddCarBinding
  import kz.jy.android.model.Car
  
  class AddCarDialog : DialogFragment() {
      private lateinit var carBodyTypeList: ArrayList&lt;String&gt;
      private lateinit var binding: DialogAddCarBinding
      lateinit var carList: ArrayList&lt;Car&gt;
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
  
          carBodyTypeList = ArrayList()
          carList = ArrayList()
          carBodyTypeList.add(&quot;Кроссовер&quot;)
          carBodyTypeList.add(&quot;Седан&quot;)
  
      }
  
      override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View {
          binding = DataBindingUtil.inflate(inflater, R.layout.dialog_add_car, container, false)
  
  //        val r : Resources = activity!!.resources
  //        dialog!!.window!!.setLayout(r.getDimension(R.dimen.))
  
          binding.btnAddCarToList.setOnClickListener {
              if (binding.etCarModel.equals(&quot;&quot;) || binding.etCarNumberAddCar.equals(&quot;&quot;)
                  || !binding.spinnerCarBodyType.isSelected) {
                  Toast.makeText(context!!, &quot;Заполните все ячейки.&quot;, Toast.LENGTH_SHORT).show()
              } else {
                  val car = Car(
                      binding.etCarModel.text.toString(),
                      binding.spinnerCarBodyType.selectedItem.toString(),
                      binding.etCarNumberAddCar.text.toString()
                  )
                  carList.add(car)
              }
          }
          binding.root.layoutParams = ViewGroup.LayoutParams(
              ViewGroup.LayoutParams.MATCH_PARENT,
              ViewGroup.LayoutParams.MATCH_PARENT
          )
          return binding.root
      }
  }
  </code></pre>
  <p>and dialog_add_car.xml:</p>
  <pre><code>&lt;layout&gt;
      &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_gravity=&quot;center_vertical&quot;
          android:background=&quot;@drawable/bg_white_10dp_radius&quot;
          android:orientation=&quot;vertical&quot;
          android:padding=&quot;8dp&quot;&gt;
  
          &lt;TextView
              style=&quot;@style/BasicTextView&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_gravity=&quot;center_horizontal&quot;
              android:text=&quot;@string/new_car&quot;
              android:textColor=&quot;@color/text_color_blue&quot; /&gt;
  
          &lt;TextView
              style=&quot;@style/BasicTextView.SmallText.EditTextTitle&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_gravity=&quot;start&quot;
              android:layout_marginTop=&quot;@dimen/default_margin_between_view_medium&quot;
              android:text=&quot;@string/new_car&quot;
              android:textColor=&quot;@color/text_color_on_white&quot; /&gt;
  
          &lt;EditText
              android:id=&quot;@+id/etCarModel&quot;
              style=&quot;@style/BasicEditText&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;@dimen/edit_text_default_height&quot;
              android:layout_marginTop=&quot;@dimen/default_margin_between_view_small&quot; /&gt;
  
          &lt;TextView
              style=&quot;@style/BasicTextView.SmallText.EditTextTitle&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_gravity=&quot;start&quot;
              android:layout_marginTop=&quot;@dimen/default_margin_between_view_medium&quot;
              android:text=&quot;@string/car_body_type&quot;
              android:textColor=&quot;@color/text_color_on_white&quot; /&gt;
  
          &lt;Spinner
              android:id=&quot;@+id/spinnerCarBodyType&quot;
              style=&quot;@style/BasicEditText&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;@dimen/edit_text_default_height&quot;
              android:layout_marginTop=&quot;@dimen/default_margin_between_view_small&quot; /&gt;
  
          &lt;TextView
              style=&quot;@style/BasicTextView.SmallText.EditTextTitle&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_gravity=&quot;start&quot;
              android:layout_marginTop=&quot;@dimen/default_margin_between_view_medium&quot;
              android:text=&quot;@string/car_number&quot;
              android:textColor=&quot;@color/text_color_on_white&quot; /&gt;
  
          &lt;EditText
              android:id=&quot;@+id/etCarNumberAddCar&quot;
              style=&quot;@style/BasicEditText&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;@dimen/edit_text_default_height&quot;
              android:layout_marginTop=&quot;@dimen/default_margin_between_view_small&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/btnAddCarToList&quot;
              style=&quot;@style/BasicTextView.SmallText&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;@dimen/button_default_height&quot;
              android:layout_marginTop=&quot;@dimen/default_margin_between_view&quot;
              android:background=&quot;@drawable/bg_blue_10dp_radius&quot;
              android:gravity=&quot;center&quot;
              android:text=&quot;@string/add_car_button&quot; /&gt;
      &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  <p>and in activity I call the dialog fragment with this code:</p>
  <pre><code>val addCarDialog = AddCarDialog()
  addCarDialog.show(supportFragmentManager.beginTransaction(),&quot;tag&quot;)
  </code></pre>
  <p>I guess, my problem is in dialog class</p>