package com.sinyuk.yuk.utils;

import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.view.ViewPropertyAnimator;

import fr.castorflex.android.smoothprogressbar.SmoothProgressBar;

/**
 * Created by Sinyuk on 16/8/15.
 */
public class BlackMagics {
    /*
     * 进度条上移
     * @param v
     * @param withLayer
     */
    public static ViewPropertyAnimator scrollUp(SmoothProgressBar progressBar) {
        Preconditions.checkNotNull(progressBar,"progressBar is Null");
        final int offset = progressBar.getHeight();
        progressBar.setTranslationY(offset);
        progressBar.setAlpha(0.01f);
        return progressBar.animate()
                .translationY(0)
                .alpha(1)
                .setDuration(400)
                .setInterpolator(new FastOutSlowInInterpolator())
                .withLayer();
    }

    /*
    * 进度条下移
    * @param v
    * @param withLayer
    */
    public static ViewPropertyAnimator scrollDown(SmoothProgressBar progressBar) {
        Preconditions.checkNotNull(progressBar,"progressBar is Null");
        final int offset = progressBar.getHeight();
        return progressBar.animate()
                .translationY(offset)
                .alpha(0.01f)
                .setDuration(400)
                .setInterpolator(new FastOutSlowInInterpolator())
                .withLayer();
    }
}

@@ -381,16 +381,15 @@
 tor 
-scrollUp
+fadeOut
 (Smo
@@ -493,142 +493,8 @@
 %22);%0A
-        final int offset = progressBar.getHeight();%0A        progressBar.setTranslationY(offset);%0A        progressBar.setAlpha(0.01f);%0A
     
@@ -530,41 +530,8 @@
 e()%0A
-                .translationY(0)%0A
     
@@ -549,17 +549,17 @@
  .alpha(
-1
+0
 )%0A      
@@ -796,17 +796,13 @@
 tor 
-scrollDow
+fadeI
 n(Sm
@@ -907,60 +907,8 @@
 %22);%0A
-        final int offset = progressBar.getHeight();%0A
     
@@ -944,46 +944,8 @@
 e()%0A
-                .translationY(offset)%0A
     
@@ -967,11 +967,8 @@
 pha(
-0.0
 1f)%0A

Use fade in/out animation instead