meta data for this page
  •  
Translations of this page:
  • en

Shadows: Rule 2 - The Zero-Alpha Limitation

Android calculates drop shadows based on the opacity of an object's fill. It utilizes a binary optimization rule:

  • If a Shape Resource has an Alpha Fill opacity of exactly 00 (the first two characters in the ARGB code, representing 0%), the engine determines the object is completely invisible.
  • Result: It entirely skips the shadow calculation to save processing power. Furthermore, if the Alpha Fill opacity is 0%, the engine will also refuse to render any borders applied to that shape, causing the entire object to completely vanish from the screen.

To visualize this note the following test images (Test 2, Test 3, and Test 4) all have 00 Alpha, thus no shadow or shape.

Discussion

Enter your comment. Wiki syntax is allowed:
Please solve the following equation to prove you're human. 163 +6 =