Skip to content

Instantly share code, notes, and snippets.

@devunwired
Created November 14, 2012 20:09

Revisions

  1. devunwired renamed this gist Nov 14, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. devunwired revised this gist Nov 14, 2012. 2 changed files with 7 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions dialog_background.xml
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Apply the margin value on the "item" element -->
    <!-- This example creates a 15dp visible margin around the dialog -->
    <item
    android:top="15dp"
    android:bottom="15dp"
    @@ -12,6 +13,7 @@
    <!-- Add attributes specific to your background (e.g. corner radius, colors, etc.) -->

    <!-- Set "padding" at minimum to match margin and add additional content padding as well, if desired -->
    <!-- This example creates 10dp of internal padding for content -->
    <padding
    android:top="25dp"
    android:bottom="25dp"
    5 changes: 5 additions & 0 deletions styles.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <!-- Possible example of applying the background to your application dialogs. -->
    <!-- You can also set the background directly on your dialog's content view hierarchy if you have customized the theme another way. -->
    <style name="Theme.CustomDialog" parent="@android:style/Theme.Dialog">
    <item name="android:windowBackground">@drawable/background_dialog</item>
    </style>
  3. devunwired created this gist Nov 14, 2012.
    22 changes: 22 additions & 0 deletions dialog_background.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Apply the margin value on the "item" element -->
    <item
    android:top="15dp"
    android:bottom="15dp"
    android:left="15dp"
    android:right="15dp">
    <shape
    android:shape="rectangle">

    <!-- Add attributes specific to your background (e.g. corner radius, colors, etc.) -->

    <!-- Set "padding" at minimum to match margin and add additional content padding as well, if desired -->
    <padding
    android:top="25dp"
    android:bottom="25dp"
    android:left="25dp"
    android:right="25dp" />
    </shape>
    </item>
    </layer-list>