android - RippleDrawable mask color, what is it for? -


in referring rippledrawable android l, https://developer.android.com/reference/android/graphics/drawable/rippledrawable.html, there's way mask away contain ripple effect within view. masking done as

<ripple android:color="#ff0000ff">     <item android:drawable="@drawable/white" /> </ripple> 

we mask using

<ripple android:color="#ff0000ff">     <item android:drawable="@drawable/black" /> </ripple> 

as mentioned in document, mask layer not drawn on screen, masking away ripple effect. i'm curious, why should 1 set color (white or black or anything) there? there significant of setting color mask, or indeed value do?

hopes enlighten... thanks!

using opaque color mask -- whether that's @android:color/white, #ff000000, or #ff123456 doesn't matter -- means masking against opaque rectangle same size drawable. it's efficient rendering path ripple masks.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -