|
@@ -77,7 +77,7 @@ class AnimationUtil private constructor() {
|
|
|
* @param view
|
|
|
*/
|
|
|
fun showViewFromBottomToTop(view: View?, duration: Long = 300) {
|
|
|
- if (showBottomToTop != null && showBottomToTop!!.isRunning) {
|
|
|
+ if (showBottomToTop?.isRunning == true) {
|
|
|
if (showBottomToTop?.target == view) {
|
|
|
showBottomToTop?.cancel()
|
|
|
showBottomToTop = null
|
|
@@ -114,7 +114,7 @@ class AnimationUtil private constructor() {
|
|
|
* @param view
|
|
|
*/
|
|
|
fun hideViewFromTopToBottom(view: View?, duration: Long = 300) {
|
|
|
- if (showBottomToTop != null && showBottomToTop!!.isRunning) {
|
|
|
+ if (showBottomToTop?.isRunning == true) {
|
|
|
if (showBottomToTop?.target == view) {
|
|
|
showBottomToTop?.cancel()
|
|
|
showBottomToTop = null
|
|
@@ -127,7 +127,6 @@ class AnimationUtil private constructor() {
|
|
|
val pvhA = PropertyValuesHolder.ofFloat("alpha", view.alpha, 0f)
|
|
|
val pvhY = PropertyValuesHolder.ofFloat("Y", Math.min(view.y, view.top.toFloat()), view.top.toFloat() + view.height)
|
|
|
showBottomToTop = ObjectAnimator.ofPropertyValuesHolder(view, pvhA, pvhY)
|
|
|
- showBottomToTop = ObjectAnimator.ofPropertyValuesHolder(view, pvhA, pvhY)
|
|
|
showBottomToTop?.apply {
|
|
|
interpolator = AccelerateInterpolator()
|
|
|
addListener(object : AnimatorListenerAdapter() {
|
|
@@ -147,7 +146,7 @@ class AnimationUtil private constructor() {
|
|
|
}
|
|
|
|
|
|
fun showViewFromRightToLeft(view: View?, duration: Long = 300) {
|
|
|
- if (showRightToLeft != null && showRightToLeft!!.isRunning) {
|
|
|
+ if (showRightToLeft?.isRunning == true) {
|
|
|
if (showRightToLeft?.target == view) {
|
|
|
showRightToLeft?.cancel()
|
|
|
showRightToLeft = null
|
|
@@ -179,7 +178,7 @@ class AnimationUtil private constructor() {
|
|
|
}
|
|
|
|
|
|
fun hideViewFromLeftToRight(view: View?, duration: Long = 300) {
|
|
|
- if (showRightToLeft != null && showRightToLeft!!.isRunning) {
|
|
|
+ if (showRightToLeft?.isRunning == true) {
|
|
|
if (showRightToLeft?.target == view) {
|
|
|
showRightToLeft?.cancel()
|
|
|
showRightToLeft = null
|
|
@@ -216,7 +215,7 @@ class AnimationUtil private constructor() {
|
|
|
* @param view
|
|
|
*/
|
|
|
fun showViewFromTopToBottom(view: View?, duration: Long = 300) {
|
|
|
- if (showTopToBottom != null && showTopToBottom!!.isRunning) {
|
|
|
+ if (showTopToBottom?.isRunning == true) {
|
|
|
if (showTopToBottom?.target == view) {
|
|
|
showTopToBottom?.cancel()
|
|
|
showTopToBottom = null
|
|
@@ -253,7 +252,7 @@ class AnimationUtil private constructor() {
|
|
|
* @param view
|
|
|
*/
|
|
|
fun hideViewFromBottomToTop(view: View?, duration: Long = 300) {
|
|
|
- if (showTopToBottom != null && showTopToBottom!!.isRunning) {
|
|
|
+ if (showTopToBottom?.isRunning == true) {
|
|
|
if (showTopToBottom?.target == view) {
|
|
|
showTopToBottom?.cancel()
|
|
|
showTopToBottom = null
|
|
@@ -285,7 +284,7 @@ class AnimationUtil private constructor() {
|
|
|
}
|
|
|
|
|
|
fun showViewFromLeftToRight(view: View?, duration: Long = 300) {
|
|
|
- if (showLeftToRight != null && showLeftToRight!!.isRunning) {
|
|
|
+ if (showLeftToRight?.isRunning == true) {
|
|
|
if (showLeftToRight?.target == view) {
|
|
|
showLeftToRight?.cancel()
|
|
|
showLeftToRight = null
|
|
@@ -317,7 +316,7 @@ class AnimationUtil private constructor() {
|
|
|
}
|
|
|
|
|
|
fun hideViewFromRightToLeft(view: View?, duration: Long = 300) {
|
|
|
- if (showLeftToRight != null && showLeftToRight!!.isRunning) {
|
|
|
+ if (showLeftToRight?.isRunning == true) {
|
|
|
if (showLeftToRight?.target == view) {
|
|
|
showLeftToRight?.cancel()
|
|
|
showLeftToRight = null
|