# Custom Drawables

DevFeed: [Custom Drawables](<https://devfeed.tech/articles/custom-drawables-30577.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2015/04/custom-drawables/>)

Published: 2015-04-03T07:00:00Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>), [Canvas](<https://devfeed.tech/topics/canvas.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [canvas](<https://devfeed.tech/tags/canvas.md>), [code](<https://devfeed.tech/tags/code.md>), [source](<https://devfeed.tech/tags/source.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

## AI overview

This tutorial explains how to use custom Android Drawables to encapsulate application logic and create a reveal transition between selected and unselected icons in a horizontally scrolling selection view. It describes subclassing Drawable, using setLevel(int) to represent selection progress, and clipping the canvas during drawing.

## Source excerpt

We've all seen posts about why you should use custom views when applicable and how it can help you properly encapsulate your application code. What we don't see quite as much is how this type of thinking can be translated to other, non-View related, portions of our apps. In my app, Fragment, there are a few places where I make use of custom Drawables to encapsulate my logic just like you would for a custom View.