orhanobut / dialogplus

Advanced dialog solution for android
Apache License 2.0
5k stars 793 forks source link

Dialog not wrapping content? #163

Open AhmedX6 opened 6 years ago

AhmedX6 commented 6 years ago

Hello,

I have a custom view on my dialog and the height of the dialog not wrapping my content. why ?

Here is my code :

this.dialogPlusChoices_ = DialogPlus.newDialog(this)
                    .setContentHolder(new ViewHolder(R.layout.dialog_choice_uploader))
                    .setGravity(Gravity.CENTER)
                    .setContentBackgroundResource(R.color.white_30)
                    .setCancelable(true)
                    .setExpanded(true)
                    .create();

And my xml :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Space
        android:id="@+id/spacer"
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <ImageButton
        android:id="@+id/folder_intent"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_centerVertical="true"
        android:layout_toStartOf="@+id/spacer"
        android:layout_marginEnd="20dp"
        android:background="@android:color/transparent"
        android:contentDescription="@null"
        android:scaleType="centerCrop"
        app:srcCompat="@drawable/folder" />

    <ImageButton
        android:id="@+id/picture_intent"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_marginStart="20dp"
        android:layout_alignStart="@+id/spacer"
        android:layout_centerVertical="true"
        android:background="@android:color/transparent"
        android:contentDescription="@null"
        android:scaleType="centerCrop"
        app:srcCompat="@drawable/photo_camera" />
</RelativeLayout>