laenger / ViewPagerBottomSheet

Use ViewPagers in Bottom Sheets!
Apache License 2.0
465 stars 86 forks source link

Issue in ViewPagerUtils #22

Closed saurabhdhillon closed 6 years ago

saurabhdhillon commented 6 years ago

` 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 commented 6 years ago

@laenger can you help?

laenger commented 6 years ago

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