From 1fcd3aee79200f0eb7c9a22f58c52a6b36e8a4b1 Mon Sep 17 00:00:00 2001 From: crehmann Date: Fri, 4 May 2018 17:17:18 +0200 Subject: [PATCH 1/2] Handle empty ViewPager --- .../laenger/android/vpbs/ViewPagerBottomSheetBehavior.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java b/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java index bf8d7a8..d611895 100644 --- a/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java +++ b/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java @@ -612,6 +612,10 @@ View findScrollingChild(View view) { if (view instanceof ViewPager) { ViewPager viewPager = (ViewPager) view; View currentViewPagerChild = ViewPagerUtils.getCurrentView(viewPager); + if(currentViewPagerChild == null){ + return null; + } + View scrollingChild = findScrollingChild(currentViewPagerChild); if (scrollingChild != null) { return scrollingChild; From 813d6a2b4fd1dc3c7e66a3a7a8f67f4d89cbe657 Mon Sep 17 00:00:00 2001 From: crehmann Date: Sun, 6 May 2018 15:36:41 +0200 Subject: [PATCH 2/2] fixed fromattting --- .../biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java b/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java index d611895..5eac402 100644 --- a/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java +++ b/vpbs/src/main/java/biz/laenger/android/vpbs/ViewPagerBottomSheetBehavior.java @@ -612,7 +612,7 @@ View findScrollingChild(View view) { if (view instanceof ViewPager) { ViewPager viewPager = (ViewPager) view; View currentViewPagerChild = ViewPagerUtils.getCurrentView(viewPager); - if(currentViewPagerChild == null){ + if (currentViewPagerChild == null) { return null; }