I have the following layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:background="@color/md_white_1000"
android:layout_gravity="center_horizontal"
android:paddingBottom="16dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/bg_kids_popup"
android:scaleType="fitXY"
/>
<ImageView
android:layout_marginTop="16dp"
android:id="@+id/dialog_kids_image"
android:src="@drawable/pic_baby_crown"
android:layout_gravity="center_horizontal"
android:layout_width="120dp"
android:layout_height="120dp" />
</FrameLayout>
<TextView
android:layout_marginTop="24dp"
android:id="@+id/dialog_kids_hi"
android:text="Oii,\nApresente seus pequenos pra gente!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="24sp"
android:textColor="@color/dinda_color_dark"
android:gravity="center"
android:textStyle="bold"
/>
<TextView
android:id="@+id/dialog_kids_custom_offers"
android:layout_marginTop="10dp"
android:text="Cadastre as crianças para quem você compra na Dinda e recebe ofertas personalizadas ;)"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textSize="13sp"
/>
<Button
android:id="@+id/dialog_kids_go_kids"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:background="@drawable/shape_oval_kids_button"
android:layout_marginLeft="28dp"
android:layout_marginRight="28dp"
android:text="@string/kids_register_now"
android:textAllCaps="true"
android:textAppearance="@style/Widget.AppTheme.Button.TextAppearance"
android:textColor="@color/md_white_1000"
android:textSize="14sp" />
</LinearLayout>
Looking the image below, the grey area is not fulfilling the entire dialog. I tried setting the FrameLayout
to match_parent
but doing this, the dialog gets stretched in the screen, without the paddings at left and right.
How should I proceed to keep the dialog padding (screen - dialog) but make the background image to fulfill the inner area ?
Thanks !