From b7cb6a5364281bdd19689afd8d22989da654f027 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 30 Sep 2017 22:55:25 +0200 Subject: [PATCH] make viewPager nullable during fake drag --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 8b1150d40..9fe6db7fd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -327,7 +327,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val dragPosition = animation.animatedValue as Int val dragOffset = dragPosition - oldDragPosition oldDragPosition = dragPosition - view_pager.fakeDragBy(dragOffset * (if (forward) 1f else -1f)) + view_pager?.fakeDragBy(dragOffset * (if (forward) 1f else -1f)) } })