DragLinearLayout icon indicating copy to clipboard operation
DragLinearLayout copied to clipboard

animateLayoutChanges causes crash

Open SiavashB opened this issue 9 years ago • 0 comments

If the LinearLayout has animateLayoutChanges set to true, dragging a child view causes

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
                                                                            at android.view.ViewGroup.addViewInner(ViewGroup.java:3880)
                                                                            at android.view.ViewGroup.addView(ViewGroup.java:3733)
                                                                            at android.view.ViewGroup.addView(ViewGroup.java:3678)
                                                                            at com.jmedeisis.draglinearlayout.DragLinearLayout.onDrag(DragLinearLayout.java:442)
                                                                            at com.jmedeisis.draglinearlayout.DragLinearLayout.onTouchEvent(DragLinearLayout.java:661)

I tested this in an empty test project with simple TextViews as the children, to make sure there is nothing else causing it.

For now I think you should add to the "limitations" section that it will not work with animateLayoutChanges

SiavashB avatar Jul 07 '16 01:07 SiavashB