HOW-TO:Add a new window or dialog via skinning

Kodi allows skinners to add as many custom windows as they like. The skinner does this by creating an xml file for the new window, and then adding xml code as necessary to dictate when the new window should be displayed.

Note that the skinner cannot just create arbitrary controls on each window, as some controls (such as spincontrols) can only be controlled and filled by Kodi itself. However, for buttons, labels, images, rss controls etc. there's no problem at all. You can make custom windows up that display all sorts of relevant information. See the references section for more information.

This tutorial will show you how to add a new dialog window that pops up when the user clicks on a button elsewhere in the skin.

Create the custom xml file
We start by creating the new window's xml file. Kodi loads all files of the form custom- .xml (note: the 'custom' prefix is mandatory), where is a name or number. These are loaded from the location from which it obtained it's Home.xml file.

Let's create a new xml file custom_help.xml. The most important section of custom_help.xml will be the header section which defines where the window is positioned, it's unique identifier, and what type of window we are wanting.

The most important tags here are:

See here for more information on the rest of the tags available.

Now that this is done, you can add whatever controls you wish inside the block. Remember that their positioning is determined by the system you are using.

Determining when it should popup
The last thing to do is determine when the window will be on screen. This will, of course, be determined by how you want the window to operate:


 * It should popup on a press of a controller or remote key
 * If so, you can achieve this by adding ActivateWindow(1234) to a button in keymap.xml.


 * It should be activated from a button in the skin
 * If so, add a button control to the appropriate window, and set it's tag to


 * It should automatically popup when another window is active
 * You can achieve this by changing the tag in the xml above to Window.IsActive(window), where window is the string identifier of the window that you want. For instance,

will make the window popup whenever the user is playing a video in fullscreen. More information on the tags can be found here.