Created
July 5, 2013 19:30
-
-
Save brainv/5936693 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aaplab.android.robird.utils; | |
import android.view.View; | |
import com.nineoldandroids.animation.Animator; | |
import com.nineoldandroids.view.ViewHelper; | |
import com.nineoldandroids.view.ViewPropertyAnimator; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: user | |
* Date: 19.08.12 | |
* Time: 2:44 | |
*/ | |
public class FadeUtils { | |
public static void fade(final View view, final int visibility) { | |
ViewPropertyAnimator.animate(view).alpha(0).setListener(new Animator.AnimatorListener() { | |
@Override | |
public void onAnimationStart(Animator animator) { | |
} | |
@Override | |
public void onAnimationEnd(Animator animator) { | |
view.setVisibility(visibility); | |
} | |
@Override | |
public void onAnimationCancel(Animator animator) { | |
} | |
@Override | |
public void onAnimationRepeat(Animator animator) { | |
} | |
}); | |
} | |
public static void show(final View view) { | |
ViewHelper.setAlpha(view, 0); | |
view.setVisibility(View.VISIBLE); | |
ViewPropertyAnimator.animate(view).alpha(1f); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment