title: Android Dialog - Rounded Corners and Transparency
body: <p>I'm trying to make a custom android dialog with rounded corners. My current attempts have given me this result. </p>
  
  <p><img src="https://i.imgur.com/aE4PMhZ.png" alt="rounded corner dialog"></p>
  
  <p>As you can see, the corners are rounded, but it leaves the white corner still intact. </p>
  
  <p>Below is the xml that I put in the drawable folder to create the blue dialog with the red border with the rounded corners.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item&gt; 
          &lt;shape 
              android:shape="rectangle"&gt;
              &lt;solid android:color="@color/transparent_black" /&gt;
              &lt;corners android:radius="@dimen/border_radius"/&gt;
          &lt;/shape&gt;
      &lt;/item&gt;   
      &lt;item 
          android:left="@dimen/border_width" 
          android:right="@dimen/border_width"  
          android:top="@dimen/border_width"
          android:bottom="@dimen/border_width" &gt;  
  
          &lt;shape android:shape="rectangle"&gt; 
              &lt;solid android:color="@color/blue" /&gt;
              &lt;corners android:radius="@dimen/border_radius"/&gt;
          &lt;/shape&gt;
      &lt;/item&gt;    
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>Below is the layout of the dialog.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  style="@style/fill"
  android:orientation="vertical"
  android:layout_margin="@dimen/spacing_normal"
  android:padding="@dimen/spacing_normal"
  
  android:background="@drawable/border_error_dialog" &gt;
  
  &lt;RelativeLayout 
      style="@style/block"
      android:layout_gravity="center" &gt;
  
      &lt;ImageView
          android:id="@+id/imageView1"
          style="@style/wrap"
          android:layout_alignParentLeft="true"
          android:layout_centerHorizontal="true"
          android:contentDescription="@string/content_description_filler"
          android:src="@drawable/ic_launcher" /&gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          style="@style/error_text"
          android:layout_centerVertical="true"
          android:layout_toRightOf="@+id/imageView1"
          android:text="@string/error_login" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;Button
      android:id="@+id/button1"
      style="@style/wrap"
      android:layout_gravity="center"
      android:text="Button" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And below is the Activity in which I create the dialog.</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Button b1 = (Button) findViewById(R.id.button1);
      b1.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {               
              AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(MainActivity.this);
  
              View child = getLayoutInflater().inflate(R.layout.dialog_custom_tom, null);
              alertDialogBuilder.setView(child);
  
              AlertDialog alertDialog = alertDialogBuilder.create();
  
              alertDialog.show();
          }
      });
  }
  </code></pre>