Skip to content

animateLayoutChanges causes crash #29

@SiavashB

Description

@SiavashB

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions