This is an alert dialog. I don't want to show the grey coloured portion (at top), which is background of the parent layout; instead that portion should be clear and the previous activity should be shown there as being shown outside the dialog. Also the border of the circular image view be tight with the image. How do I do that? Thanks in advance.
Mylayout.xml
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#727272">
<RelativeLayout
android:id="@+id/card_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardBackgroundColor="#ffffff"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="0dp"
card_view:cardUseCompatPadding="false">
<RelativeLayout
android:id="@+id/rl_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<android.support.design.widget.TextInputLayout
android:id="@+id/til_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60dp">
<TextView
android:id="@+id/tv_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/textView_DoB"
android:paddingTop="10dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:hint="@string/dd_mm_yyyy"
android:textColor="@android:color/black"
android:textAlignment="viewStart"
android:textSize="25sp"
android:background="@drawable/border_date"/>
</android.support.design.widget.TextInputLayout>
<ImageButton
android:id="@+id/ib_DoB_in_dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/til_date"
android:layout_marginTop="63dp"
android:layout_marginEnd="5dp"
android:background="@mipmap/calendar"
android:contentDescription="@string/calendar_image" />
<TextView
android:id="@+id/textView_DoB_weekday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/til_date"
android:layout_marginTop="20dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:textColor="@android:color/black"
android:textAlignment="viewStart"
android:textSize="20sp"
/>
<android.support.design.widget.TextInputLayout
android:id="@+id/til_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/til_date"
android:layout_marginTop="10dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/et_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name"
android:inputType="textCapWords" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/til_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/til_name"
android:layout_marginTop="10dp">
<Spinner
android:id="@+id/sp_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/Category">
</Spinner>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/til_mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/til_category"
android:layout_marginTop="10dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/et_mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/mobile_number_optional"
android:inputType="number"
android:maxLength="13"/>
</android.support.design.widget.TextInputLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/til_mobile"
android:layout_marginTop="10dp">
<TableRow>
<Button
android:id="@+id/btn_discard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_weight="1"
android:text="@string/discard" />
<Button
android:id="@+id/btn_save_data"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="1"
android:text="@string/save" />
</TableRow>
</TableLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/civ_profile_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@mipmap/ic_person_image"
card_view:civ_border_width="2dp"
card_view:civ_border_color="#ffffff"/>
</RelativeLayout>