-
Notifications
You must be signed in to change notification settings - Fork 254
Home
Dmytro Danylyk edited this page Mar 10, 2015
·
5 revisions
"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
- Can't draw circle shadow.
- Not possible to set shadow position.
- Not possible to set shadow color. (Make shadow darker or lighter)
- No method to set selector for shadow (Lift on touch)
Background Image approach
- For every component you need shadow image for all
drawable-dpi
folders - Ton's of resources increase apk size