You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I came up with an issue. I've tried to implement simple list with draggable items. Dragged item has to have elevation (shadow). I've tried to use getActivationElevation but it does not work as described in wiki.
According to Wiki, getActivationElevation returns value of desired elevation when view is activated (eg. dragged), however this value is not applied correctly.
I've done some investigation myself. FlexibleViewHolder.toggleActivation correctly calls ViewCompat.setElevation with value from getActivationElevation. However, this is quickly overwritten by ItemTouchUIUtilImpl.onDraw. The new elevation value is 1f + findMaxElevation(...), and findMaxElevation ignores dragged item. This means that, if my base items have no elevation, dragged item will have elevation 1f no matter what value is returned by getActivationElevation.
This is easily reproducible in demo app, just change value returned in Simple.getActivationElevation to see that it has no effect or remove elevation from root RelativeLayout in recycler_header_item.xml to see that it will change elevation of item to 1f.
The text was updated successfully, but these errors were encountered:
Hello, I came up with an issue. I've tried to implement simple list with draggable items. Dragged item has to have elevation (shadow). I've tried to use
getActivationElevation
but it does not work as described in wiki.According to Wiki,
getActivationElevation
returns value of desiredelevation
when view is activated (eg. dragged), however this value is not applied correctly.I've done some investigation myself.
FlexibleViewHolder.toggleActivation
correctly callsViewCompat.setElevation
with value fromgetActivationElevation
. However, this is quickly overwritten byItemTouchUIUtilImpl.onDraw
. The newelevation
value is1f + findMaxElevation(...)
, andfindMaxElevation
ignores dragged item. This means that, if my base items have no elevation, dragged item will have elevation1f
no matter what value is returned bygetActivationElevation
.This is easily reproducible in demo app, just change value returned in
Simple.getActivationElevation
to see that it has no effect or removeelevation
from rootRelativeLayout
inrecycler_header_item.xml
to see that it will change elevation of item to1f
.The text was updated successfully, but these errors were encountered: