Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. #6

Open
raj123456789123456789 opened this issue Jun 18, 2018 · 4 comments

Comments

@raj123456789123456789
Copy link

Hi your layout manager is very good however i'm getting this error in
private int fill(RecyclerView.Recycler recycler, int dy, boolean apply) {
int delta = direction.layoutDirection * dy;
// multiply the parallex factor
if (apply)
delta = (int) (delta * parallex);
if (direction == LEFT)
return fillFromLeft(recycler, delta);
if (direction == RIGHT)

        return fillFromRight(recycler, delta);
    if (direction == TOP)
        return fillFromTop(recycler, delta);
    else return dy;
}
@HirayClay
Copy link
Owner

i can't reproduce this error. how did you find this error? just run the apk and that happened? it is sad , i will try to help

@raj123456789123456789
Copy link
Author

raj123456789123456789 commented Jun 19, 2018 via email

@HirayClay
Copy link
Owner

of course ,you can add a defensive if statement “if (view.getParent() == null) addView(view)” in fillFromLeft fillFromTop fillFromRight these three methods.
ifstatement
It is a 'shameless' workaround util i find why.Another truth—— I am a noob in android and this layout manager kind of sucks when you dig deep into RecyclerView:neckbeard:

@raj123456789123456789
Copy link
Author

I think you are a great developer because your layout manger has helped me a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants