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

Issue in ViewPagerUtils #22

Closed
saurabhdhillon opened this issue Mar 15, 2018 · 2 comments
Closed

Issue in ViewPagerUtils #22

saurabhdhillon opened this issue Mar 15, 2018 · 2 comments

Comments

@saurabhdhillon
Copy link

` final int currentItem = viewPager.getCurrentItem();

    for (int i = 0; i < viewPager.getChildCount(); i++) {
        final View child = viewPager.getChildAt(i);
        final ViewPager.LayoutParams layoutParams = (ViewPager.LayoutParams) child.getLayoutParams();
        if (!layoutParams.isDecor && currentItem == layoutParams.position) {
            return child;
        }
    }
    return null;`

layoutParams.position is a private field couldn't use this. Can you help

@saurabhdhillon
Copy link
Author

@laenger can you help?

@laenger
Copy link
Owner

laenger commented Mar 22, 2018

ViewPager.LayoutParams.position is package private which is the reason why ViewPagerUtils is placed inside android.support.v4.view and not biz.laenger.android.vpbs

@laenger laenger closed this as completed Apr 4, 2018
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