Alot of the soundboards out there on the market look a little bit ugly by using the default android buttons in conjunction with a background (no offense to developers of these, perhaps they can learn from this); this mini-tutorial explains how to use xml to create a customised nice looking button thing.
Below is show the example I will use to demonstrate the default buttons in use with a background image (It’s a picture of me hugging the android statue!)
There are four images you will need to create (you can use less if you want); one for each of the following states:
||What this means
||Button highlighted (selected with trackpad)
||Button foussed and pressed
||Normal state of button
I recommend creating a nine-patch png for the button image, this way your image can be stretched to fit the button size as needed. Also soundboards look rather snazzy if you include a background image, and then you can use transparency in your png so that your buttons don’t obscure it.
Using draw9patch tool to make a 9patch png for use as a strechable button
<?xml version="1.0" encoding="utf-8"?>
<item android:drawable="@drawable/button_normal" />
An example usage of how to use this newly created xml button in your layout file.
Now you should have some nice sexy customised buttons that change depending on thier state. Which makes our example now look like this (I increased the padding and margins of the buttons slightly):
Pretty Buttons with transparency using 9patch png and xml
Below are a few examples of my work with some nice transparent buttons:
Example 9 patch image