"Custom Drawing with Canvas" by Joshua Lamson
When you’re creating a new View to display some complex data, it’s easy for the number of View objects you’re using to get out of control. Between elaborate shapes, shaders/colors, and text in specific places and orientations, using only Android Views and layouts can turn your layout into a dense, complicated mess. Luckily, there’s a better way to add all your customizations. What you need is a blank Canvas! (Literally, android.graphics.Canvas). In this session, we’ll delve into the details of using a Canvas to display anything you need in a truly custom way. You’ll leave this talk knowing how to:
– Paint custom shapes, Paths, and text onto Canvas
– Override a View’s draw methods to draw on its Canvas
– Override a ViewGroup’s draw methods to draw over, under, and around its children
– Overriding a Drawable’s draw methods to create custom reusable Drawables
– Update your View’s state in response to touches and state changes
– And how to do all of the this while keeping your Views performant and your app buttery-smooth.
About Joshua Lamson
Joshua Lamson is a Software Engineer at POSSIBLE Mobile, specializing in Android Development. Joshua is a graduate of the Colorado School of Mines and has an affinity for Rubik’s cubes. Follow him @darkmoose117
About the Droids
Each 3rd Tuesday of the month, we meet at POSSIBLE Mobile downtown. From 5:30-6pm we will socialize and enjoy food and drinks. At 6pm we will either have a presentation about a new/interesting Android topic, or we'll work on a group project. If you are a new or experienced Android developer, or just someone that is curious about Android development, we hope you will join us and become a regular participant!