reuse the built in fade animations

This commit is contained in:
tibbi 2017-01-04 20:19:11 +01:00
parent 2f8f3b4362
commit f76a0cf0ce
3 changed files with 7 additions and 18 deletions

View file

@ -172,16 +172,19 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C
} }
private fun checkFullscreen() { private fun checkFullscreen() {
var anim = R.anim.fade_in var anim = android.R.anim.fade_in
if (mIsFullscreen) { if (mIsFullscreen) {
anim = R.anim.fade_out anim = android.R.anim.fade_out
mSeekBar!!.setOnSeekBarChangeListener(null) mSeekBar!!.setOnSeekBarChangeListener(null)
} else { } else {
mSeekBar!!.setOnSeekBarChangeListener(this) mSeekBar!!.setOnSeekBarChangeListener(this)
} }
val animation = AnimationUtils.loadAnimation(context, anim) AnimationUtils.loadAnimation(context, anim).apply {
mTimeHolder!!.startAnimation(animation) duration = 150
fillAfter = true
mTimeHolder!!.startAnimation(this)
}
} }
private fun togglePlayPause() { private fun togglePlayPause() {

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150"
android:fillAfter="true"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0"/>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150"
android:fillAfter="true"
android:fromAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="0.0"/>