Search in sources :

Example 76 with AnimationSet

use of android.view.animation.AnimationSet in project StickerCamera by Skykai521.

the class LabelView method wave.

public void wave() {
    AnimationSet as = new AnimationSet(true);
    ScaleAnimation sa = new ScaleAnimation(1f, 1.5f, 1f, 1.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
    sa.setDuration(ANIMATIONEACHOFFSET * 3);
    // 设置循环
    sa.setRepeatCount(10);
    AlphaAnimation aniAlp = new AlphaAnimation(1, 0.1f);
    // 设置循环
    aniAlp.setRepeatCount(10);
    as.setDuration(ANIMATIONEACHOFFSET * 3);
    as.addAnimation(sa);
    as.addAnimation(aniAlp);
    labelIcon.startAnimation(as);
}
Also used : AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 77 with AnimationSet

use of android.view.animation.AnimationSet in project android-support-v4-googlemaps by petedoyle.

the class FragmentManagerImpl method makeOpenCloseAnimation.

static Animation makeOpenCloseAnimation(Context context, float startScale, float endScale, float startAlpha, float endAlpha) {
    AnimationSet set = new AnimationSet(false);
    ScaleAnimation scale = new ScaleAnimation(startScale, endScale, startScale, endScale, Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF, .5f);
    scale.setInterpolator(DECELERATE_QUINT);
    scale.setDuration(ANIM_DUR);
    set.addAnimation(scale);
    AlphaAnimation alpha = new AlphaAnimation(startAlpha, endAlpha);
    alpha.setInterpolator(DECELERATE_CUBIC);
    alpha.setDuration(ANIM_DUR);
    set.addAnimation(alpha);
    return set;
}
Also used : AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 78 with AnimationSet

use of android.view.animation.AnimationSet in project robolectric by robolectric.

the class ShadowAnimationSetTest method start_shouldRunAnimation.

@Test
@Ignore("Needs additional work")
public void start_shouldRunAnimation() {
    final AnimationSet set = new AnimationSet(true);
    final Animation move = new TranslateAnimation(0, 100, 0, 100);
    move.setDuration(1000);
    move.setAnimationListener(moveListener);
    final Animation spin = new RotateAnimation(0, 360);
    spin.setDuration(1000);
    spin.setStartOffset(1000);
    spin.setAnimationListener(spinListener);
    set.start();
    verify(moveListener).onAnimationStart(move);
    Robolectric.flushForegroundThreadScheduler();
    verify(moveListener).onAnimationEnd(move);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) RotateAnimation(android.view.animation.RotateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 79 with AnimationSet

use of android.view.animation.AnimationSet in project Signal-Android by WhisperSystems.

the class HidingLinearLayout method hide.

public void hide() {
    if (!isEnabled() || getVisibility() == GONE)
        return;
    AnimationSet animation = new AnimationSet(true);
    animation.addAnimation(new ScaleAnimation(1, 0, 1, 1, Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0.5f));
    animation.addAnimation(new AlphaAnimation(1, 0));
    animation.setDuration(100);
    animation.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            setVisibility(GONE);
        }
    });
    animateWith(animation);
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 80 with AnimationSet

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

the class SearchFileFragment method showItems.

private void showItems(ArrayList<ExplorerItem> found) {
    items.clear();
    items.addAll(found);
    status.setVisibility(View.GONE);
    adapter.notifyDataSetChanged();
    if (!animated) {
        listView.setAlpha(0);
        listView.post(new Runnable() {

            @Override
            public void run() {
                listView.setAlpha(1);
                for (int i = 0; i < listView.getChildCount(); i++) {
                    View searchItemView = listView.getChildAt(i);
                    AnimationSet slideInAnimation = new AnimationSet(true);
                    slideInAnimation.setInterpolator(new MaterialInterpolator());
                    slideInAnimation.setDuration(200);
                    if (i != 0) {
                        slideInAnimation.setStartOffset(i * 50 + 25);
                    } else {
                        slideInAnimation.setStartOffset(75);
                    }
                    AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
                    slideInAnimation.addAnimation(alphaAnimation);
                    TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, 150, 0);
                    slideInAnimation.addAnimation(translateAnimation);
                    searchItemView.startAnimation(slideInAnimation);
                }
            }
        });
        animated = true;
    } else
        listView.setVisibility(View.VISIBLE);
}
Also used : MaterialInterpolator(im.actor.sdk.controllers.pickers.file.view.MaterialInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation) SearchView(android.support.v7.widget.SearchView) View(android.view.View) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) ListView(android.widget.ListView) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation)

Aggregations

AnimationSet (android.view.animation.AnimationSet)117 AlphaAnimation (android.view.animation.AlphaAnimation)85 TranslateAnimation (android.view.animation.TranslateAnimation)75 Animation (android.view.animation.Animation)71 ScaleAnimation (android.view.animation.ScaleAnimation)69 ClipRectAnimation (android.view.animation.ClipRectAnimation)32 CurvedTranslateAnimation (com.android.server.wm.animation.CurvedTranslateAnimation)32 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)30 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)30 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)30 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)30 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)30 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)30 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)30 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)30 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)30 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)30 WindowAnimation_taskToFrontEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation)30 WindowAnimation_taskToFrontExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation)30 WindowAnimation_wallpaperCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)30