I'm trying to have a AppCompatDialogFragment with a root layout as a ConstraintLayout.
The root layout have a layout_width set to wrap_content. But when I execute the code, the dialog is shrink have a fixed width even if the content change.
Here's the layout code generated
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tempus tristique ornare. Aenean ut magna in diam aliquet accumsan. "
android:textSize="36sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
Here's how i inflate the layout:
View view = inflater.inflate(R.layout.weather_dialog, container, false);
We can see that with a long text the dialog hit some sort of "max width" (even without the attribute).
How can i have a dialog that wrap its content in width without this "limit" ?