1

I want to make the exact dialog box as given in this picture : Customized dialog box

How do I achieve the same look and feel, can anyone suggest please.

Bhavit S. Sengar
  • 8,794
  • 6
  • 24
  • 34

4 Answers4

1

It's not too tricky :) You need to create a custom dialog. You'd begin by extending AlertDialog and overriding the onCreate method.

Within this custom dialog class you can use setContentView to assign a specific layout file to that dialog class, in which you can manipulate the contents however you like.

Joe Birch
  • 371
  • 2
  • 7
0

Use separate xml file for your dialog look. on the button click of your activity call this dialog

here is link to tutorial related to dialog implementation in android

Tutorial 1

Tutorial 2

Vaibhav Agarwal
  • 4,499
  • 3
  • 19
  • 20
0

It's just a straight forward xml layout, the only trick is to have layout background a transluent png with rounded corners, and disable border on your dialog

Ahmad Dwaik 'Warlock'
  • 5,953
  • 5
  • 34
  • 56
0

Can you try this

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/parent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_margin="15dip"
        android:background="@drawable/popup_bg"
        android:orientation="vertical" >
    //add list items here

    </LinearLayout>

    <ImageView
        android:id="@+id/close_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:clickable="true"
        android:cropToPadding="true"
        android:onClick="dismissPopUp"
        android:src="@drawable/icon_close_btn" />

</RelativeLayout>
Deniz
  • 12,332
  • 10
  • 44
  • 62