[null, {"document_url": "http://android-er.blogspot.com/2012/09/custom-view.html", "unformatted_src": "http://4.bp.blogspot.com/-V4vo7sSv7fw/UEYFEKkEVVI/AAAAAAAAEmo/iaFGJxe62Vs/s400/AndroidDraw_01.png", "src": "http://4.bp.blogspot.com/-V4vo7sSv7fw/UEYFEKkEVVI/AAAAAAAAEmo/iaFGJxe62Vs/s400/AndroidDraw_01.png", "formatted_filename": "AndroidDraw", "alt_text": "Custom View", "rendered_width": 225, "rendered_height": 400}, null, null, null, null, null, null]

Custom View

It's a very basic custom view extends android.view.View; simple draw background and a cross across the view. We will do more exercises base on it in coming posts. Create a custom view, MyView.java extends View.

Modify the main code, MainActivity.java, to set it in ContentView. 
Related examples:
- Paint.setShader() with SweepGradient
- LinearGradient example
- Draw bitmap on canvas
- Draw text with shadow on canvas
- Draw bitmap with shadow on canvas
- RadialGradient example
- Using ColorMatrixColorFilter
- Generate negative image using ColorMatrix
- LightingColorFilter example
- PorterDuffColorFilter example
