Skip to content
Dmytro Danylyk edited this page Mar 10, 2015 · 5 revisions

Why this library was created?

"Within the material environment, virtual lights illuminate the scene and allow objects to cast shadows. A key light creates directional shadows, while an ambient light creates consistent, soft shadows from all angles." - Google Material Design Specs

With introduction of Material Design shadow is now highly usable 'ingredient' for 'cooking' Android Material Components like Raised Button, Floating Action Button or just background for dialog.

To display shadow for your components you have 2 approach:

  • Use Card View
  • Set background image

Card View approach

  1. Can't draw circle shadow.
  2. Not possible to set shadow position.
  3. Not possible to set shadow color. (Make shadow darker or lighter)
  4. No method to set selector for shadow (Lift on touch)

Background Image approach

  1. For every component you need shadow image for all drawable-dpi folders
  2. Ton's of resources increase apk size
Clone this wiki locally