This post will show the android custom dialog with custom layout.
In the xml file you can create any type of layout.
XML
<<
? 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" >
<
LinearLayout
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: layout_margin = "10dp"
android: layout_below = "@+id/editText11"
android: background = "@android:color/transparent"
android: orientation = "horizontal"
android: id = "@+id/linearLayout2" >
<
Button android: id = "@+id/ok"
android: layout_width = "match_parent"
android: layout_height = "50dp"
android: layout_weight = "1"
android: background = "@color/colorPrimary"
android: padding = "5dp"
android: text = "ok"
android: textColor = "@android:color/white"
android: textSize = "15dp"
android: textStyle = "bold" / >
<
Button android: id = "@+id/gallery"
android: layout_width = "match_parent"
android: layout_height = "50dp"
android: layout_marginLeft = "5dp"
android: layout_weight = "1"
android: background = "@color/colorPrimary"
android: padding = "5dp"
android: text = "Gallery"
android: visibility = "invisible"
android: textColor = "@android:color/white"
android: textSize = "15dp"
android: textStyle = "bold" / >
<
Button android: id = "@+id/cancel"
android: layout_width = "match_parent"
android: layout_height = "50dp"
android: layout_marginLeft = "5dp"
android: layout_weight = "1"
android: background = "@color/colorPrimary"
android: padding = "5dp"
android: text = "Cancel"
android: textColor = "@android:color/white"
android: textSize = "15dp"
android: textStyle = "bold" / >
<
/LinearLayout>
<
EditText android: layout_width = "match_parent"
android: textColor = "#000"
android: gravity = "center"
android: layout_height = "wrap_content"
android: inputType = "textPersonName"
android: hint = "Enter video link"
android: singleLine = "true"
android: ems = "10"
android: layout_centerHorizontal = "true"
android: id = "@+id/editText11" / >
< /RelativeLayout>