Skip to content
This repository was archived by the owner on Jul 22, 2019. It is now read-only.
This repository was archived by the owner on Jul 22, 2019. It is now read-only.

ViewPager inside adapter #68

Description

@panekzogen

Hello.

I don't have a strong knowledge about view processing in android but maybe this helps someone because library seems unsupported.
If someone want to create complex layout, in my case it was ViewPager inside adapter of swipe stack,
note that the layout processing doing in wrong order:
At SwipeStack.addNewView() which called on onLayout() for children nodes performing following:

bottomView.measure(measureSpecWidth | width, measureSpecHeight | height);
addViewInLayout(bottomView, 0, params, true);

But after several hours of reviewing android code and googling i found that right order is:

addView(bottomView, 0, params);
bottomView.measure(measureSpecWidth | width, measureSpecHeight | height);
bottomView.layout(0, 0, width, height);

If someone has deep knowledge about it and know on what exactly it affects, please explain.
Hope that it helps someone.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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