Download presentation
Presentation is loading. Please wait.
Published byPeregrine Paul Modified over 9 years ago
1
Drawables and Skinning Widgets MOBILE SOFTWARE DEVELOPMENT
2
2 Contents XML Shapes Applying a Shape to a View Embed HTML Nine Patches Resources
3
3 XML Shapes
4
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
5 Nine Patch Define stretchable and static areas of PNG image using control pixels at side of image
6
6 State List Define widget graphics based on state ie. button focussed, pressed, button up <shape xmlns:android = " http://schemas.android.com/apk/res/android" android:shape="oval">
7
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
8 Resources Drawables http://developer.android.com/guide/topics/resources/ drawable-resource.html http://developer.android.com/guide/topics/resources/ drawable-resource.html http://developer.android.com/guide/topics/resources/ drawable-resource.html#Shape http://developer.android.com/guide/topics/resources/ drawable-resource.html#Shape http://developer.android.com/guide/topics/graphics/ 2d-graphics.html#nine-patch http://developer.android.com/guide/topics/graphics/ 2d-graphics.html#nine-patch http://radleymarx.com/blog/simple-guide-to-9-patch/ http://radleymarx.com/blog/simple-guide-to-9-patch/ http://developer.android.com/tools/help/draw9patch. html http://developer.android.com/tools/help/draw9patch. html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.