Java Code Examples for android.view.animation.TranslateAnimation#ABSOLUTE

The following examples show how to use android.view.animation.TranslateAnimation#ABSOLUTE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainMenuMgr.java    From android_tv_metro with Apache License 2.0 6 votes vote down vote up
private void intLayoutAnim()
{
    Animation slideIn = new TranslateAnimation(TranslateAnimation.RELATIVE_TO_SELF, -1, TranslateAnimation.ABSOLUTE, 0,
            TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.ABSOLUTE, 0);
    slideIn.setDuration(KAnimTimeShort);
    mAnimIn = new LayoutAnimationController(slideIn, LayoutAnimDelay);

    Animation slideOut = new TranslateAnimation(TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.RELATIVE_TO_SELF, -1,
             TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.ABSOLUTE, 0);
    slideOut.setDuration(KAnimTimeShort);

    slideOut.setFillAfter(true);
    mAnimOut = new LayoutAnimationController(slideOut, LayoutAnimDelay);
    mAnimOut.setOrder(LayoutAnimationController.ORDER_REVERSE);

    mainMenu.setLayoutAnimation(mAnimIn);
    mHideShowListener = new HideShowListener();
    mainMenu.setLayoutAnimationListener(mHideShowListener);

    mReady.autoSetVal(true, AnimationBlockTimer);
}
 
Example 2
Source File: MultiColumnPullToRefreshListView.java    From EverMemo with MIT License 6 votes vote down vote up
private void bounceBackHeader(){
	int yTranslate = state == State.REFRESHING ?
			header.getHeight() - headerContainer.getHeight() :
				-headerContainer.getHeight() - headerContainer.getTop();

			bounceAnimation = new TranslateAnimation(
					TranslateAnimation.ABSOLUTE, 0,
					TranslateAnimation.ABSOLUTE, 0,
					TranslateAnimation.ABSOLUTE, 0,
					TranslateAnimation.ABSOLUTE, yTranslate);

			bounceAnimation.setDuration(BOUNCE_ANIMATION_DURATION);
			bounceAnimation.setFillEnabled(true);
			bounceAnimation.setFillAfter(false);
			bounceAnimation.setFillBefore(true);
			//bounceAnimation.setInterpolator(new OvershootInterpolator(BOUNCE_OVERSHOOT_TENSION));
			bounceAnimation.setAnimationListener(new HeaderAnimationListener(yTranslate));
			startAnimation(bounceAnimation);
}
 
Example 3
Source File: MiniGame.java    From SchoolQuest with GNU General Public License v3.0 5 votes vote down vote up
void setUpTextBoxArrowAnimation(ImageView textboxArrow) {
    TranslateAnimation textBoxArrowAnimation = new TranslateAnimation(
            TranslateAnimation.ABSOLUTE, 0f,
            TranslateAnimation.ABSOLUTE, 0f,
            TranslateAnimation.RELATIVE_TO_PARENT, 0f,
            TranslateAnimation.RELATIVE_TO_PARENT, 0.01f);
    textBoxArrowAnimation.setDuration(500);
    textBoxArrowAnimation.setRepeatCount(-1);
    textBoxArrowAnimation.setRepeatMode(Animation.RESTART);
    textBoxArrowAnimation.setInterpolator(new LinearInterpolator());
    textBoxArrowAnimation.setFillAfter(true);

    textboxArrow.setAnimation(textBoxArrowAnimation);
}
 
Example 4
Source File: GameActivity.java    From SchoolQuest with GNU General Public License v3.0 5 votes vote down vote up
private void setUpTextBoxArrowAnimation() {
    ImageView textBoxArrow = findViewById(R.id.textbox_box_arrow);
    TranslateAnimation textBoxArrowAnimation = new TranslateAnimation(TranslateAnimation.ABSOLUTE, 0f,
            TranslateAnimation.ABSOLUTE, 0f,
            TranslateAnimation.RELATIVE_TO_PARENT, 0f,
            TranslateAnimation.RELATIVE_TO_PARENT, 0.01f);
    textBoxArrowAnimation.setDuration(500);
    textBoxArrowAnimation.setRepeatCount(-1);
    textBoxArrowAnimation.setRepeatMode(Animation.RESTART);
    textBoxArrowAnimation.setInterpolator(new LinearInterpolator());
    textBoxArrowAnimation.setFillAfter(true);

    textBoxArrow.setAnimation(textBoxArrowAnimation);
}