Search in sources :

Example 11 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project TourGuide by worker8.

the class ToolTipCustomizationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_customization);
    Button button = (Button) findViewById(R.id.button);
    Animation animation = new TranslateAnimation(0f, 0f, 200f, 0f);
    animation.setDuration(1000);
    animation.setFillAfter(true);
    animation.setInterpolator(new BounceInterpolator());
    ToolTip toolTip = new ToolTip().setTitle("Next Button").setDescription("Click on Next button to proceed...").setTextColor(Color.parseColor("#bdc3c7")).setBackgroundColor(Color.parseColor("#e74c3c")).setShadow(true).setGravity(Gravity.TOP | Gravity.LEFT).setEnterAnimation(animation);
    mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK).setToolTip(toolTip).setOverlay(new Overlay()).setPointer(new Pointer()).playOn(button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
        }
    });
}
Also used : ToolTip(tourguide.tourguide.ToolTip) Button(android.widget.Button) BounceInterpolator(android.view.animation.BounceInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) TranslateAnimation(android.view.animation.TranslateAnimation) Pointer(tourguide.tourguide.Pointer) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 12 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project ZI by yixia.

the class DefaultAnimationsBuilder method buildDefaultSlideOutUpAnimation.

/**
   * @return The default Animation for a hiding {@link Crouton}.
   */
public static Animation buildDefaultSlideOutUpAnimation() {
    if (null == slideOutUpAnimation) {
        slideOutUpAnimation = new TranslateAnimation(SlideOutUpAnimationParameters.FROM_X_DELTA, SlideOutUpAnimationParameters.TO_X_DELTA, SlideOutUpAnimationParameters.FROM_Y_DELTA, SlideOutUpAnimationParameters.TO_Y_DELTA);
        slideOutUpAnimation.setDuration(SlideOutUpAnimationParameters.DURATION);
    }
    return slideOutUpAnimation;
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation)

Example 13 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project PhotoNoter by yydcdut.

the class PGEditSeekbarLayout method hideWithAnimation.

public void hideWithAnimation(Animation.AnimationListener animationListener) {
    if (mSeekBarParentView != null) {
        AlphaAnimation showAlphaAnimation = new AlphaAnimation(1f, 0f);
        showAlphaAnimation.setDuration(300l);
        showAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
        showAlphaAnimation.setAnimationListener(animationListener);
        mSeekBarParentView.startAnimation(showAlphaAnimation);
    }
    float bottomHeight = getContext().getResources().getDimension(R.dimen.pg_sdk_edit_second_bottom_down_height);
    TranslateAnimation translateAnimation = new TranslateAnimation(0f, 0f, 0f, bottomHeight);
    translateAnimation.setDuration(300l);
    translateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    mBottomView.startAnimation(translateAnimation);
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 14 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project PhotoNoter by yydcdut.

the class PGEditView method hideBottomSecondMenuWithAnimation.

public void hideBottomSecondMenuWithAnimation() {
    if (Build.VERSION.SDK_INT >= 11) {
        float secondBottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_second_bottom_height);
        TranslateAnimation translateAnimation = new TranslateAnimation(0f, 0f, 0f, secondBottomHeight);
        translateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
        translateAnimation.setDuration(ANIMATION_TIME);
        translateAnimation.setAnimationListener(new AnimationAdapter() {

            @Override
            public void onAnimationEnd(Animation animation) {
                mActivity.runOnUiThread(new Runnable() {

                    @Override
                    public void run() {
                        if (null != mMenuListener) {
                            mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
                        }
                    }
                });
            }
        });
        mSecondMenusLayout.startAnimation(translateAnimation);
        mFirstHorizontalLayout.setVisibility(View.VISIBLE);
        float bottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_bottom_height);
        TranslateAnimation firstTranslateAnimation = new TranslateAnimation(0f, 0f, bottomHeight, 0f);
        firstTranslateAnimation.setDuration(ANIMATION_TIME);
        firstTranslateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
        AlphaAnimation firstAlphaAnimation = new AlphaAnimation(0f, 1f);
        firstAlphaAnimation.setDuration(ANIMATION_TIME);
        firstAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
        AnimationSet animationSet = new AnimationSet(true);
        animationSet.addAnimation(firstTranslateAnimation);
        animationSet.addAnimation(firstAlphaAnimation);
        mFirstHorizontalLayout.startAnimation(animationSet);
    } else {
        if (null != mMenuListener) {
            mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
        }
        mFirstHorizontalLayout.setVisibility(View.VISIBLE);
    }
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation) AnimationSet(android.view.animation.AnimationSet) AnimationAdapter(us.pinguo.edit.sdk.base.widget.AnimationAdapter) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 15 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project WordPress-Android by wordpress-mobile.

the class AniUtils method animateBar.

private static void animateBar(View view, boolean show, boolean isTopBar, Duration duration) {
    int newVisibility = (show ? View.VISIBLE : View.GONE);
    if (view == null || view.getVisibility() == newVisibility) {
        return;
    }
    float fromY;
    float toY;
    if (isTopBar) {
        fromY = (show ? -1f : 0f);
        toY = (show ? 0f : -1f);
    } else {
        fromY = (show ? 1f : 0f);
        toY = (show ? 0f : 1f);
    }
    Animation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, fromY, Animation.RELATIVE_TO_SELF, toY);
    long durationMillis = duration.toMillis(view.getContext());
    animation.setDuration(durationMillis);
    if (show) {
        animation.setInterpolator(new DecelerateInterpolator());
    } else {
        animation.setInterpolator(new AccelerateInterpolator());
    }
    view.clearAnimation();
    view.startAnimation(animation);
    view.setVisibility(newVisibility);
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) TranslateAnimation(android.view.animation.TranslateAnimation)

Aggregations

TranslateAnimation (android.view.animation.TranslateAnimation)157 Animation (android.view.animation.Animation)70 AlphaAnimation (android.view.animation.AlphaAnimation)65 AnimationSet (android.view.animation.AnimationSet)48 ScaleAnimation (android.view.animation.ScaleAnimation)27 View (android.view.View)17 AnimationListener (android.view.animation.Animation.AnimationListener)16 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)14 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)14 ClipRectAnimation (android.view.animation.ClipRectAnimation)12 LinearInterpolator (android.view.animation.LinearInterpolator)12 CurvedTranslateAnimation (com.android.server.wm.animation.CurvedTranslateAnimation)12 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)11 ListView (android.widget.ListView)11 TextView (android.widget.TextView)11 ImageView (android.widget.ImageView)9 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)8 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)8 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)8 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)8