From cb9353c31a3cf293924d68fd25b695a09f2aedfb Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Apr 2017 20:31:59 +0200 Subject: [PATCH] toggle fullscreen at clicking outside videos too --- .../gallery/fragments/VideoFragment.kt | 13 ++++++++----- 1 file changed, 8 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 32f02967c..ed0520ed7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -84,11 +84,8 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mSurfaceView = mView.video_surface mSurfaceHolder = mSurfaceView!!.holder mSurfaceHolder!!.addCallback(this) - mSurfaceView!!.setOnClickListener({ - mIsFullscreen = !mIsFullscreen - checkFullscreen() - listener?.fragmentClicked() - }) + mSurfaceView!!.setOnClickListener({ toggleFullscreen() }) + mView.video_holder.setOnClickListener { toggleFullscreen() } initTimeHolder() } @@ -111,6 +108,12 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee initTimeHolder() } + private fun toggleFullscreen() { + mIsFullscreen = !mIsFullscreen + checkFullscreen() + listener?.fragmentClicked() + } + private fun initTimeHolder() { mTimeHolder = mView.video_time_holder val res = resources