I'm trying to apply margin updates or animations to a child view which parent is dragged using a ViewDragHelper
.
However the updated layout properties have no effect and are not rendered while the view is dragged. Everything from adding and removing views, to layout animations or layout param updates are ignored while dragging:
To illustrate this issue, i've created a delayed runnable which updates the height of a view (the green view) after 3 seconds:
spacer.postDelayed(new Runnable() {
@Override
public void run() {
Log.d(TAG,"set layout params!!!!");
ViewGroup.LayoutParams spacerParams = spacer.getLayoutParams();
spacerParams.height = (int) (200+(Math.random()*200));
spacer.setLayoutParams(spacerParams);
}
},3000);
Check this demo screen recording: https://i.stack.imgur.com/eDzXE.jpg