UltraViewPager icon indicating copy to clipboard operation
UltraViewPager copied to clipboard

Calls PagerAdapters destroyItem method with a null parameter.

Open Fabrik19 opened this issue 6 years ago • 0 comments

This view pager is very hard to use while writing the PagerAdapter in Kotlin. The third parameter of the destroyItem method has a @NonNull annotation. As Kotlin translates this to a non nullable parameter and checks this non nullability at runtime the app crashes when null is provided to this method. Sadly the UltraViewPager uses this part of code:

            View child = ((RelativeLayout) object).getChildAt(0);
            ((RelativeLayout) object).removeAllViews();
            adapter.destroyItem(container, realPosition, child);

If the RelativeLayout has no children null is provided to the destroyItem method.

Fabrik19 avatar Dec 18 '18 10:12 Fabrik19