From 37c40b8de7fcb2f263ea66fd4d5c7b9dd50dfe4f Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Apr 2017 19:32:31 +0200 Subject: [PATCH] minor style edits --- .../simplemobiletools/gallery/fragments/VideoFragment.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 9124af1f5..268432daa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -91,12 +91,11 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee super.setMenuVisibility(menuVisible) mIsFragmentVisible = menuVisible if (menuVisible) { - if (context != null && context.config.autoplayVideos) { + if (context?.config?.autoplayVideos == true) { playVideo() } - } else { - if (mIsPlaying) - pauseVideo() + } else if (mIsPlaying) { + pauseVideo() } } @@ -241,7 +240,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee override fun onDestroy() { super.onDestroy() - if (activity != null && !activity.isChangingConfigurations) { + if (activity?.isChangingConfigurations == false) { cleanup() } }