[Android] Remove useless launchAnim method

Nicolas Pomepuy git at videolan.org
Fri Aug 2 14:57:48 CEST 2019


vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Aug  1 15:20:50 2019 +0200| [0792bf31eff1b196edb8c415024423892e179386] | committer: Geoffrey Métais

Remove useless launchAnim method

(cherry picked from commit 350d4820d7e29a9c67e391c981b9437a658737d9)

> https://code.videolan.org/videolan/vlc-android/commit/0792bf31eff1b196edb8c415024423892e179386
---

 .../src/org/videolan/vlc/gui/view/FadableImageView.kt  | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/view/FadableImageView.kt b/vlc-android/src/org/videolan/vlc/gui/view/FadableImageView.kt
index a8fd7c8c0..bbc70e08f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/view/FadableImageView.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/view/FadableImageView.kt
@@ -28,42 +28,38 @@ class FadableImageView : AppCompatImageView {
         }
     }
 
-    private fun launchAnim(hasToFade: Boolean) {
-        if (!hasToFade) resetFade() else fade()
-    }
-
     override fun setBackground(background: Drawable?) {
         super.setBackground(background)
-        launchAnim(background != null)
+        if (background != null) fade() else resetFade()
     }
 
     override fun setBackgroundResource(resid: Int) {
         super.setBackgroundResource(resid)
-        launchAnim(resid != 0)
+        if (resid != 0) fade() else resetFade()
     }
 
     override fun setImageBitmap(bm: Bitmap?) {
-        launchAnim(bm != null)
+        if (bm != null) fade() else resetFade()
         super.setImageBitmap(bm)
     }
 
     override fun setImageDrawable(drawable: Drawable?) {
-        launchAnim(drawable != null)
+        if (drawable != null) fade() else resetFade()
         super.setImageDrawable(drawable)
     }
 
     override fun setImageIcon(icon: Icon?) {
-        launchAnim(icon != null)
+        if (icon != null) fade() else resetFade()
         super.setImageIcon(icon)
     }
 
     override fun setImageResource(resId: Int) {
-        launchAnim(resId != 0)
+        if (resId != 0) fade() else resetFade()
         super.setImageResource(resId)
     }
 
     override fun setImageURI(uri: Uri?) {
-        launchAnim(uri != null)
+        if (uri != null) fade() else resetFade()
         super.setImageURI(uri)
     }
 }
\ No newline at end of file



More information about the Android mailing list