Drawables and Skinning Widgets MOBILE SOFTWARE DEVELOPMENT
2 Contents XML Shapes Applying a Shape to a View Embed HTML Nine Patches Resources
3 XML Shapes
4 XML Shapes Can specify as background shape of widget / button /text view etc. Rectangle, Oval, Line, Ring Automatically scales to size of View can also set size using tags creates rounded corners for shape specifies a colour gradient for a shape pad view content ie. text
5 Nine Patch Define stretchable and static areas of PNG image using control pixels at side of image
6 State List Define widget graphics based on state ie. button focussed, pressed, button up <shape xmlns:android = " android:shape="oval">
7 HTML Use static HTML.fromHTML() method to render simple HTML tags inside a TextView Can render links, images, bold, italic etc. Use static Linkify.addLinks() method to add clickable links to a TextView If you want anything more complicated use a WebView TextView textView = (TextView) findViewById (R.id.textView1); Spanned test = Html.fromHtml("The quick brown fox, jumps over the lazy dog"); textView.setText(test);
8 Resources Drawables drawable-resource.html drawable-resource.html drawable-resource.html#Shape drawable-resource.html#Shape 2d-graphics.html#nine-patch 2d-graphics.html#nine-patch html html