Jérémie Laval Jérémie Laval December 23, 2012 ,

Inset styling is a useful effect, especially on text. It is well-suited for secondary UI elements, because it makes them appear less prominent. In one of my own applications, I recently used inset text to improve the discoverability of a particular feature—informing the user that they can drag nearby user interface elements:


The following is the code that I used to implement the inset text style:

A “real” inset effect implies inner glow and proper shading, but I chose to use a simpler approach. I used solid colors in a shading palette and layered three instances of the text.

You can use InsetTextView in XML or in code. The following XML snippet demonstrates how it can be used in an Android user interface layout: