Search in sources :

Example 1 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project cw-omnibus by commonsguy.

the class SlidingPanel method toggle.

public void toggle() {
    TranslateAnimation anim = null;
    isOpen = !isOpen;
    if (isOpen) {
        setVisibility(View.VISIBLE);
        anim = new TranslateAnimation(0.0f, 0.0f, getHeight(), 0.0f);
    } else {
        anim = new TranslateAnimation(0.0f, 0.0f, 0.0f, getHeight());
        anim.setAnimationListener(collapseListener);
    }
    anim.setDuration(speed);
    anim.setInterpolator(new AccelerateInterpolator(1.0f));
    startAnimation(anim);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation)

Example 2 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project cw-omnibus by commonsguy.

the class SlidingPanel method toggle.

public void toggle() {
    TranslateAnimation anim = null;
    AnimationSet set = new AnimationSet(true);
    isOpen = !isOpen;
    if (isOpen) {
        setVisibility(View.VISIBLE);
        anim = new TranslateAnimation(0.0f, 0.0f, getHeight(), 0.0f);
    } else {
        anim = new TranslateAnimation(0.0f, 0.0f, 0.0f, getHeight());
        anim.setAnimationListener(collapseListener);
        set.addAnimation(fadeOut);
    }
    set.addAnimation(anim);
    set.setDuration(speed);
    set.setInterpolator(new AccelerateInterpolator(1.0f));
    startAnimation(set);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet)

Example 3 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project nmid-headline by miao1007.

the class PlatformListPage method initAnim.

private void initAnim() {
    animShow = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 0);
    animShow.setDuration(300);
    animHide = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1);
    animHide.setDuration(300);
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation)

Example 4 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project actor-platform by actorapp.

the class AttachFragment method hide.

@Override
public void hide() {
    if (root != null && root.getVisibility() == View.VISIBLE) {
        onHidden();
        fastAttachAdapter.clearSelected();
        messenger().getGalleryScannerActor().send(new GalleryScannerActor.Hide());
        fastShare.scrollToPosition(0);
        hideView(root);
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP && !isFastShareFullScreen) {
            View internal = fastShare;
            int cx = internal.getWidth() - Screen.dp(56 + 56);
            int cy = internal.getHeight() - Screen.dp(56 / 2);
            float finalRadius = (float) Math.hypot(cx, cy);
            Animator anim = ViewAnimationUtils.createCircularReveal(internal, cx, cy, finalRadius, 0);
            anim.addListener(new Animator.AnimatorListener() {

                @Override
                public void onAnimationStart(Animator animator) {
                    internal.setAlpha(1);
                }

                @Override
                public void onAnimationEnd(Animator animator) {
                    internal.setAlpha(0);
                }

                @Override
                public void onAnimationCancel(Animator animator) {
                }

                @Override
                public void onAnimationRepeat(Animator animator) {
                }
            });
            anim.setDuration(200);
            anim.start();
        } else {
            TranslateAnimation animation = new TranslateAnimation(0, 0, 0, root.getHeight());
            animation.setInterpolator(MaterialInterpolator.getInstance());
            animation.setDuration(250);
            fastShare.startAnimation(animation);
            bottomBackground.startAnimation(animation);
        }
    }
}
Also used : Animator(android.animation.Animator) TranslateAnimation(android.view.animation.TranslateAnimation) GalleryScannerActor(im.actor.core.utils.GalleryScannerActor) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Example 5 with TranslateAnimation

use of android.view.animation.TranslateAnimation in project actor-platform by actorapp.

the class InputBarFragment method hideAudio.

protected void hideAudio(boolean cancel) {
    if (!isAudioVisible) {
        return;
    }
    isAudioVisible = false;
    showView(attachButton);
    showView(messageEditText);
    showView(emojiButton);
    getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
    voiceRecordActor.send(new VoiceCaptureActor.Stop(cancel));
    TranslateAnimation animation = new TranslateAnimation(0, Screen.getWidth(), 0, 0);
    animation.setDuration(160);
    audioContainer.clearAnimation();
    audioContainer.setAnimation(animation);
    audioContainer.animate();
    audioContainer.setVisibility(View.GONE);
    messageEditText.requestFocus();
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) VoiceCaptureActor(im.actor.sdk.core.audio.VoiceCaptureActor)

Aggregations

TranslateAnimation (android.view.animation.TranslateAnimation)229 Animation (android.view.animation.Animation)109 AlphaAnimation (android.view.animation.AlphaAnimation)90 AnimationSet (android.view.animation.AnimationSet)69 ScaleAnimation (android.view.animation.ScaleAnimation)44 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)30 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)27 View (android.view.View)22 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)22 TextView (android.widget.TextView)18 AnimationListener (android.view.animation.Animation.AnimationListener)17 LinearInterpolator (android.view.animation.LinearInterpolator)13 RotateAnimation (android.view.animation.RotateAnimation)13 ClipRectAnimation (android.view.animation.ClipRectAnimation)12 ListView (android.widget.ListView)12 CurvedTranslateAnimation (com.android.server.wm.animation.CurvedTranslateAnimation)12 ImageView (android.widget.ImageView)11 LayoutAnimationController (android.view.animation.LayoutAnimationController)8 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)8 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)8