Elevating widgets
An excellent way of highlighting one widget over the others on the screen is to make it appear over the others on the screen, not two-dimensionally, but floating above them as though in three-dimensions. This is already a clear pattern if you look at the FloatingActionButton
classes; they don't just overlap other widgets, but they have a shadow and appear to float in space (hence the class name FloatingActionButton
).
One of the great features in the Android widget library is that the View
class defines the notion of elevation, which makes it usable by every widget in the toolkit. The elevation of a widget doesn't affect its two-dimensional position or size, but does cause it to produce a shadow that will be correctly shaded as though the widget is floating in three-dimensions. This can be used to create an amazing effect when you need to draw attention to a message, or when the user is repositioning a widget on the screen (for example, reorganizing a list of reminders)....