Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Steps I took:</p> <ol> <li>Create a class extending <a href="http://developer.android.com/reference/android/app/Dialog.html" rel="nofollow noreferrer">Dialog</a>.</li> <li>In the onCreate, call <code>setContentView(x, y)</code> with <code>x</code> being your R.layout and <code>y</code> being R.style.popupStyle (see below).</li> <li>In your res/values/style.xml, you need to override the default DialogWindow style. I tried just making a style that has this one as its parent, but that still didn't clear all defaults. So I checked the Android git tree and got the default style, and just copy-pasted it. This is the one: </li> </ol> <pre>&lt;style name="Theme.Dialog"&gt; &lt;item name="android:windowFrame"&gt;@null&lt;/item&gt; &lt;item name="android:windowTitleStyle"&gt;@android:style/DialogWindowTitle&lt;/item&gt; &lt;item name="android:windowBackground"&gt;@android:drawable/panel_background&lt;/item&gt; &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt; &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt; &lt;item name="android:windowAnimationStyle"&gt;@android:style/Animation.Dialog&lt;/item&gt; &lt;item name="android:windowSoftInputMode"&gt;stateUnspecified|adjustPan&lt;/item&gt; &lt;/style&gt;</pre> <p>You'll get a few errors, just solve them by copying more stuff from the official Android styles.xml and themes.xml files. Here's the contents of my styles.xml file: <a href="http://pastebin.com/RRR15YYS" rel="nofollow noreferrer">http://pastebin.com/RRR15YYS</a></p> <p>That just gives you a white popup, no borders, nothing. Start customizing. :)</p> <p>Thanks to mbaird for putting me on the right track.</p> <p>[edit] I needed to look up my own answer again, and I spent at least ten minutes searching the official android styles/themes files, so here they are, for future reference: <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/styles.xml;hb=HEAD" rel="nofollow noreferrer">styles.xml</a> and <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml;hb=HEAD" rel="nofollow noreferrer">themes.xml</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload