From f76a0cf0ce1dc6eddad7476d7734dc0128f1f096 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 4 Jan 2017 20:19:11 +0100 Subject: [PATCH] reuse the built in fade animations --- .../gallery/fragments/VideoFragment.kt | 11 +++++++---- app/src/main/res/anim/fade_in.xml | 7 ------- app/src/main/res/anim/fade_out.xml | 7 ------- 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 app/src/main/res/anim/fade_in.xml delete mode 100644 app/src/main/res/anim/fade_out.xml 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 ab446d44e..19986d0d7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -172,16 +172,19 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C } private fun checkFullscreen() { - var anim = R.anim.fade_in + var anim = android.R.anim.fade_in if (mIsFullscreen) { - anim = R.anim.fade_out + anim = android.R.anim.fade_out mSeekBar!!.setOnSeekBarChangeListener(null) } else { mSeekBar!!.setOnSeekBarChangeListener(this) } - val animation = AnimationUtils.loadAnimation(context, anim) - mTimeHolder!!.startAnimation(animation) + AnimationUtils.loadAnimation(context, anim).apply { + duration = 150 + fillAfter = true + mTimeHolder!!.startAnimation(this) + } } private fun togglePlayPause() { diff --git a/app/src/main/res/anim/fade_in.xml b/app/src/main/res/anim/fade_in.xml deleted file mode 100644 index de0cefd7b..000000000 --- a/app/src/main/res/anim/fade_in.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/app/src/main/res/anim/fade_out.xml b/app/src/main/res/anim/fade_out.xml deleted file mode 100644 index cc932dcde..000000000 --- a/app/src/main/res/anim/fade_out.xml +++ /dev/null @@ -1,7 +0,0 @@ - -