Вы можете сделать это так, добавив этот dailog.xml в папку для рисования
<?xml version="1.0" encoding="utf-8"?>
<!-- From: support/v7/appcompat/res/drawable/abc_dialog_material_background_light.xml -->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="16dp"
android:insetTop="16dp"
android:insetRight="16dp"
android:insetBottom="16dp">
<shape android:shape="rectangle">
<corners android:topRightRadius="10dp" android:topLeftRadius="10dp" android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp" />
<solid android:color="@color/colorPrimary" />
</shape>
</inset>
Добавьте это в styles.xml
<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<!--buttons color-->
<item name="colorAccent">#000000</item>
<!--title and message color-->
<item name="android:textColorPrimary">@android:color/white</item>
<!--dialog background-->
<item name="android:windowBackground">@drawable/dialog</item>
</style>
добавьте alerttdialog в действии
AlertDialog.Builder confirmation = new AlertDialog.Builder(this, R.style.MyDialogTheme);
confirmation.setTitle("Title");
confirmation.setMessage("Are you sure.?").setPositiveButton("Yes", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
}
});
confirmation.show();
результатом будет алертиалдиалог с округленными только верхними углами