Skip to content

Commit

Permalink
JvmStatic on SimpleAnimationUtils methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mherod committed Jun 3, 2019
1 parent 0c5fe6c commit 4efd0e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import android.support.annotation.DrawableRes;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.design.widget.TabLayout;
import android.support.v4.widget.ImageViewCompat;
import android.text.TextUtils;
Expand Down Expand Up @@ -389,7 +388,7 @@ public boolean onAnimationEnd(@NonNull View view) {
return false;
}
};
SimpleAnimationUtils.INSTANCE.revealOrFadeIn(this, animationDuration, animationListener, getRevealAnimationCenter()).start();
SimpleAnimationUtils.revealOrFadeIn(this, animationDuration, animationListener, getRevealAnimationCenter()).start();
} else {
setVisibility(View.VISIBLE);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("unused")

package com.ferfalk.simplesearchview.utils

import android.animation.Animator
Expand Down Expand Up @@ -25,22 +27,27 @@ object SimpleAnimationUtils {
val defaultInterpolator: Interpolator
get() = FastOutSlowInInterpolator()

@JvmStatic
fun revealOrFadeIn(view: View, duration: Int, center: Point?): Animator {
return revealOrFadeIn(view, duration, null, center)
}

@JvmStatic
fun revealOrFadeIn(view: View, listener: AnimationListener?): Animator {
return revealOrFadeIn(view, ANIMATION_DURATION_DEFAULT, listener, null)
}

@JvmStatic
fun revealOrFadeIn(view: View, center: Point?): Animator {
return revealOrFadeIn(view, ANIMATION_DURATION_DEFAULT, null, center)
}

@JvmStatic
fun revealOrFadeIn(view: View, listener: AnimationListener?, center: Point?): Animator {
return revealOrFadeIn(view, ANIMATION_DURATION_DEFAULT, listener, center)
}

@JvmStatic
@JvmOverloads
fun revealOrFadeIn(view: View, duration: Int = ANIMATION_DURATION_DEFAULT, listener: AnimationListener? = null, center: Point? = null): Animator {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Expand All @@ -50,18 +57,22 @@ object SimpleAnimationUtils {
}
}

@JvmStatic
fun hideOrFadeOut(view: View, duration: Int, center: Point?): Animator? {
return hideOrFadeOut(view, duration, null, center)
}

@JvmStatic
fun hideOrFadeOut(view: View, listener: AnimationListener?): Animator? {
return hideOrFadeOut(view, ANIMATION_DURATION_DEFAULT, listener, null)
}

@JvmStatic
fun hideOrFadeOut(view: View, center: Point?): Animator? {
return hideOrFadeOut(view, ANIMATION_DURATION_DEFAULT, null, center)
}

@JvmStatic
fun hideOrFadeOut(view: View, listener: AnimationListener?, center: Point?): Animator? {
return hideOrFadeOut(view, ANIMATION_DURATION_DEFAULT, listener, center)
}
Expand Down

0 comments on commit 4efd0e4

Please sign in to comment.