Building the calculator styling

We really want this calculator to look more like a real calculator, and for that we need to apply some styling. The current theme of the calculator is entirely the standard Android theme, and while it looks exactly like the rest of the Android system, it doesn't really suit this application. We want to style both the buttons and the display area of the application. We'll define style values in a resource file and relate to these in the layout XML file.

To start with, we'll define a series of nine-patch images to create our own button designs. We need three different images for this purpose. The first image is the "normal" state of the button, the second will be the "pressed" state of the button, and finally, a "focused" ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.