From f728ca2650b18dd26961352cac4aff171b628447 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 9 Feb 2017 20:51:42 +0100 Subject: [PATCH] add an activity null check at toggling fullscreen --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index e4aa8196d..32a4d89d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -159,6 +159,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } private fun checkFullscreen() { + if (activity == null) + return + var anim = android.R.anim.fade_in if (mIsFullscreen) { anim = android.R.anim.fade_out @@ -167,7 +170,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mSeekBar!!.setOnSeekBarChangeListener(this) } - AnimationUtils.loadAnimation(context, anim).apply { + AnimationUtils.loadAnimation(activity, anim).apply { duration = 150 fillAfter = true mTimeHolder!!.startAnimation(this)