android.view.animation.AccelerateInterpolator Java Examples

The following examples show how to use android.view.animation.AccelerateInterpolator. 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: Case1Scene.java    From scene with Apache License 2.0 7 votes vote down vote up
@NonNull
@Override
protected Animator onPopAnimator(final AnimationInfo fromInfo, final AnimationInfo toInfo) {
    final View toView = toInfo.mSceneView;
    final View fromView = fromInfo.mSceneView;

    ValueAnimator fromAlphaAnimator = ObjectAnimator.ofFloat(fromView, View.ALPHA, 1.0f, 0.0f);
    fromAlphaAnimator.setInterpolator(new LinearInterpolator());
    fromAlphaAnimator.setDuration(150 * 20);
    fromAlphaAnimator.setStartDelay(50 * 20);

    ValueAnimator fromTranslateAnimator = ObjectAnimator.ofFloat(fromView, View.TRANSLATION_Y, 0, 0.08f * toView.getHeight());
    fromTranslateAnimator.setInterpolator(new AccelerateInterpolator(2));
    fromTranslateAnimator.setDuration(200 * 20);

    ValueAnimator toAlphaAnimator = ObjectAnimator.ofFloat(toView, View.ALPHA, 0.7f, 1.0f);
    toAlphaAnimator.setInterpolator(new LinearOutSlowInInterpolator());
    toAlphaAnimator.setDuration(20 * 20);
    return TransitionUtils.mergeAnimators(fromAlphaAnimator, fromTranslateAnimator, toAlphaAnimator);
}
 
Example #2
Source File: MainActivity.java    From FileTransfer with GNU General Public License v3.0 6 votes vote down vote up
@OnClick(R.id.fab)
public void onClick(View view) {
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
            == PackageManager.PERMISSION_GRANTED) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mFab, "translationY", 0, mFab
                .getHeight() * 2).setDuration(200L);
        objectAnimator.setInterpolator(new AccelerateInterpolator());
        objectAnimator.addListener(this);
        objectAnimator.start();
    } else {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.permission_setting);
        builder.setMessage(R.string.permission_need_des);
        builder.setPositiveButton(R.string.permission_go, (dialog, which) -> {
            Intent intent = new Intent();
            intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
            Uri uri = Uri.fromParts("package", getPackageName(), null);
            intent.setData(uri);
            startActivity(intent);
        });
        builder.setNegativeButton(R.string.cancel, null);
        builder.show();
    }
}
 
Example #3
Source File: ViewPropertyAnimatorCodeFragment.java    From ifican with Apache License 2.0 6 votes vote down vote up
@Override
public void onPrevPressed() {
    if (--currentStep > 0) {
        switch (currentStep) {
            case 2:
                text2.setVisibility(View.GONE);
                break;
            case 1:
                image.animate().alpha(0f).scaleY(0f).scaleX(0f)
                        .rotation(0).setInterpolator(new AccelerateInterpolator())
                        .setDuration(1000).setListener(new SimpleAnimatorListener() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        container.setVisibility(View.GONE);
                    }
                });
                break;
        }
        return;
    }
    super.onPrevPressed();
}
 
Example #4
Source File: TaskGuide.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
public TaskGuide(Context context, QQToken qqtoken)
{
    super(context, qqtoken);
    d = null;
    e = null;
    g = new Handler(Looper.getMainLooper());
    i = com.tencent.open.z.a;
    j = com.tencent.open.z.a;
    A = 0;
    B = 0;
    C = 0.0F;
    D = new AccelerateInterpolator();
    E = false;
    a = false;
    F = false;
    G = false;
    L = null;
    M = null;
    f = (WindowManager)context.getSystemService("window");
    d();
}
 
Example #5
Source File: CustomAnimator.java    From umeng_community_android with MIT License 6 votes vote down vote up
protected void initAnimation(final boolean show) {
    mAnimation = new Animation() {
        @Override
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            if (interpolatedTime < 0) { // 预处理加速器可能出现负数
                return;
            }
            MarginLayoutParams params = (MarginLayoutParams) mView.getLayoutParams();
            policyMargin(interpolatedTime, params, show);
            mView.setLayoutParams(params);
        }
    };
    // mAnimation.setInterpolator(new AnticipateInterpolator());
    mAnimation.setInterpolator(new AccelerateInterpolator());
    mAnimation.setDuration(300);
}
 
Example #6
Source File: RefreshCircleHeader.java    From timecat with Apache License 2.0 6 votes vote down vote up
@Override
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
    mShowOuter = false;
    mShowBoll = false;
    ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mFinishRatio = (float) animation.getAnimatedValue();
            RefreshCircleHeader.this.invalidate();
        }
    });
    animator.setInterpolator(new AccelerateInterpolator());
    animator.setDuration(DURATION_FINISH);
    animator.start();
    return DURATION_FINISH;
}
 
Example #7
Source File: PopBackgroundView.java    From AndroidColorPop with Apache License 2.0 6 votes vote down vote up
/**
 * Internal void to start the circles animation.
 * <p>
 * when this void is called the circles radius would be updated by a
 * {@link ValueAnimator} and then it will call the {@link View}'s
 * invalidate() void witch calls the onDraw void each time so a bigger
 * circle would be drawn each time till the cirlce's fill the whole screen.
 * </p>
 */
private void animateCirlce() {
	if (circles_fill_type == CIRLCES_FILL_HEIGHT_TYPE) {
		circle_max_radius = screen_height + (screen_height / 4);
	} else {
		circle_max_radius = screen_width + (screen_width / 4);
	}
	ValueAnimator va = ValueAnimator.ofInt(0, circle_max_radius / 3);
	va.setDuration(1000);
	va.addListener(this);
	va.setInterpolator(new AccelerateInterpolator());
	va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
		public void onAnimationUpdate(ValueAnimator animation) {
			int value = (int) animation.getAnimatedValue();
			circle_radius = value * 3;
			invalidate();
		}
	});
	va.start();
}
 
Example #8
Source File: StartActivity.java    From HomeGenie-Android with GNU General Public License v3.0 6 votes vote down vote up
public void hideLogo() {
    _isLogoVisible = false;
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Animation fadeOut = new AlphaAnimation(0.8f, 0);
            fadeOut.setInterpolator(new AccelerateInterpolator()); //and this
            fadeOut.setStartOffset(0);
            fadeOut.setDuration(500);
            //
            AnimationSet animation = new AnimationSet(false); //change to false
            animation.addAnimation(fadeOut);
            animation.setFillAfter(true);
            RelativeLayout ivLogo = (RelativeLayout) findViewById(R.id.logo);
            ivLogo.startAnimation(animation);
        }
    });
}
 
Example #9
Source File: BottomRedPointView.java    From letv with Apache License 2.0 6 votes vote down vote up
private void init(Context context, View target) {
    this.context = context;
    this.target = target;
    fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setInterpolator(new DecelerateInterpolator());
    fadeIn.setDuration(200);
    fadeOut = new AlphaAnimation(1.0f, 0.0f);
    fadeOut.setInterpolator(new AccelerateInterpolator());
    fadeOut.setDuration(200);
    this.isShown = false;
    if (this.target != null) {
        applyTo(this.target);
    } else {
        show();
    }
}
 
Example #10
Source File: UniversalOnScrollListener.java    From Twire with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
    if (isMainActivity) {
        float toolbarTranslationY = mMainToolbar.getTranslationY(); // Save the Y value to a variable to prevent "getting" it multiple times
        int TOOLBAR_HEIGHT = (int) mActivity.getResources().getDimension(R.dimen.main_toolbar_height);
        if (mActivity.getSupportActionBar() != null) {
            TOOLBAR_HEIGHT = mActivity.getSupportActionBar().getHeight();
        }

        // If the toolbar is not fully drawn when the scrolling state is idle - animate to be either fully shown or fully hidden.
        // But don't run the animation if the amountScrolled amount is less that the toolbar height
        // Also animate the shadow the length and direction
        if (amountScrolled > mActivity.getResources().getDimension(R.dimen.additional_toolbar_height)) {
            if (newState == 0 && toolbarTranslationY > -TOOLBAR_HEIGHT && toolbarTranslationY < -(TOOLBAR_HEIGHT / 2) && amountScrolled > TOOLBAR_HEIGHT) {
                // Hide animation
                mToolbarShadow.animate().translationY(-TOOLBAR_HEIGHT).setInterpolator(new AccelerateInterpolator()).start();
                mMainToolbar.animate().translationY(-TOOLBAR_HEIGHT).setInterpolator(new AccelerateInterpolator()).start();
            } else if (newState == 0 && toolbarTranslationY > -(TOOLBAR_HEIGHT / 2) && toolbarTranslationY < 0 && amountScrolled > TOOLBAR_HEIGHT) {
                // Show animation
                mToolbarShadow.animate().translationY(0).setInterpolator(new AccelerateInterpolator()).start();
                mMainToolbar.animate().translationY(0).setInterpolator(new AccelerateInterpolator()).start();
            }
        }
    }
}
 
Example #11
Source File: PlayerPlaybackControlsFragment.java    From RetroMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
public void showBouceAnimation() {
    playPauseFab.clearAnimation();

    playPauseFab.setScaleX(0.9f);
    playPauseFab.setScaleY(0.9f);
    playPauseFab.setVisibility(View.VISIBLE);
    playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
    playPauseFab.setPivotY(playPauseFab.getHeight() / 2);

    playPauseFab.animate()
            .setDuration(200)
            .setInterpolator(new DecelerateInterpolator())
            .scaleX(1.1f)
            .scaleY(1.1f)
            .withEndAction(() -> playPauseFab.animate()
                    .setDuration(200)
                    .setInterpolator(new AccelerateInterpolator())
                    .scaleX(1f)
                    .scaleY(1f)
                    .alpha(1f)
                    .start())
            .start();
}
 
Example #12
Source File: MainActivity.java    From mirror with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onDragDismiss(final ArtboardView view, boolean isDragDown) {
    mIsDragDismiss = true;
    switchToArtboardListView();
    view.animate().alpha(0.0F)
            .translationY(isDragDown ? -view.getHeight() : view.getHeight())
            .setDuration(AnimUtils.DURATION)
            .setInterpolator(new AccelerateInterpolator())
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animator) {
                    mIsDragDismiss = false;
                    mArtboardPagerView.getBackground().mutate().setAlpha(255);
                    view.setTranslationY(0.0F);
                    view.setAlpha(1.0F);
                }
            })
            .start();
}
 
Example #13
Source File: SwitchAnimationUtil.java    From UltimateAndroid with Apache License 2.0 6 votes vote down vote up
private void runRotateAnimation(View view, long delay) {
	view.setAlpha(0);
	AnimatorSet set = new AnimatorSet();
	ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view,
			"rotation", 0f, 360f);
	ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(view, "scaleX",
			0f, 1f);
	ObjectAnimator objectAnimator3 = ObjectAnimator.ofFloat(view, "scaleY",
			0f, 1f);
	ObjectAnimator objectAnimator4 = ObjectAnimator.ofFloat(view, "alpha",
			0f, 1f);

	objectAnimator2.setInterpolator(new AccelerateInterpolator(1.0f));
	objectAnimator3.setInterpolator(new AccelerateInterpolator(1.0f));

	set.setDuration(mDuration);
	set.playTogether(objectAnimator, objectAnimator2, objectAnimator3,
			objectAnimator4);
	set.setStartDelay(delay);
	set.start();
}
 
Example #14
Source File: LineScale.java    From crystal-preloaders with Apache License 2.0 6 votes vote down vote up
private void setAnimator(final int index){

        valueAnimators[index] = ValueAnimator.ofFloat(maxScale, minScale);
        valueAnimators[index].setStartDelay(delays[index]);
        valueAnimators[index].setDuration(650);
        valueAnimators[index].setRepeatCount(ValueAnimator.INFINITE);
        valueAnimators[index].setRepeatMode(ValueAnimator.REVERSE);
        valueAnimators[index].setInterpolator(new AccelerateInterpolator());
        valueAnimators[index].addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                yScale[index] = (float) animation.getAnimatedValue();
                if(index == 0 || index == valueAnimators.length){
                    getTarget().invalidate();
                }
            }
        });
    }
 
Example #15
Source File: AnimatorUtil.java    From CoordinatorLayoutExample with Apache License 2.0 6 votes vote down vote up
public static void showHeight(final View view,float  start,float end){
    final ValueAnimator animator=ValueAnimator.ofFloat(start,end);
    final ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            float value = (Float) animator.getAnimatedValue();
            layoutParams.height=(int) value;
            view.setLayoutParams(layoutParams);
            Log.i(TAG, "onAnimationUpdate: value="+value);

        }
    });
    animator.setDuration(500);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.start();
}
 
Example #16
Source File: ScaleTouchListener.java    From ScaleTouchListener with Apache License 2.0 6 votes vote down vote up
private void createAnimators() {
    alphaDownAnimator = ObjectAnimator.ofFloat(mView.get(), "alpha", config.getAlpha());
    alphaUpAnimator = ObjectAnimator.ofFloat(mView.get(), "alpha", 1.0f);
    scaleXDownAnimator = ObjectAnimator.ofFloat(mView.get(), "scaleX", config.getScaleDown());
    scaleXUpAnimator = ObjectAnimator.ofFloat(mView.get(), "scaleX", 1.0f);
    scaleYDownAnimator = ObjectAnimator.ofFloat(mView.get(), "scaleY", config.getScaleDown());
    scaleYUpAnimator = ObjectAnimator.ofFloat(mView.get(), "scaleY", 1.0f);

    downSet = new AnimatorSet();
    downSet.setDuration(config.getDuration());
    downSet.setInterpolator(new AccelerateInterpolator());
    downSet.playTogether(alphaDownAnimator, scaleXDownAnimator, scaleYDownAnimator);

    upSet = new AnimatorSet();
    upSet.setDuration(config.getDuration());
    upSet.setInterpolator(new FastOutSlowInInterpolator());
    upSet.playTogether(alphaUpAnimator, scaleXUpAnimator, scaleYUpAnimator);

    finalAnimationListener = new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            onClick(mView.get());
        }
    };
}
 
Example #17
Source File: RippleAnimator.java    From TheGlowingLoader with Apache License 2.0 6 votes vote down vote up
public void startCircleMajor(final Callback callback) {
    PropertyValuesHolder rp = PropertyValuesHolder.ofFloat("radius", 0, circleMaxRadius);
    PropertyValuesHolder ap = PropertyValuesHolder.ofFloat("alpha", 1, 0);
    PropertyValuesHolder sp = PropertyValuesHolder.ofInt("stroke", (int) (circleMaxRadius * .15f), 0);

    ValueAnimator va = ValueAnimator.ofPropertyValuesHolder(rp, ap, sp);
    va.setInterpolator(new AccelerateInterpolator(.4f));
    va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            circleRadius = (float) animation.getAnimatedValue("radius");
            circleAlpha = (float) animation.getAnimatedValue("alpha");
            circleStroke = (int) animation.getAnimatedValue("stroke");
            callback.onValueUpdated();
        }
    });
    va.setDuration(450);
    va.start();
}
 
Example #18
Source File: DrawerGradientActivity.java    From android-transition with Apache License 2.0 6 votes vote down vote up
public void updateTransition(View v) {
    mDrawerListenerAdapter.removeAllTransitions();

    ViewTransitionBuilder builder = ViewTransitionBuilder.transit(mGradient).translationX(-mGradient.getWidth(), 0);
    switch (v.getId()) {
        case R.id.interpolator_default:
            break;
        case R.id.interpolator_linear:
            builder.interpolator(new LinearInterpolator());
            break;
        case R.id.interpolator_accelerate:
            builder.interpolator(new AccelerateInterpolator());
            break;
        case R.id.interpolator_decelerate:
            builder.interpolator(new DecelerateInterpolator());
            break;
        case R.id.interpolator_fastout:
            builder.interpolator(new FastOutLinearInInterpolator());
            break;
        case R.id.interpolator_anticipate:
            builder.interpolator(new AnticipateInterpolator());
            break;
    }
    mDrawerListenerAdapter.addTransition(builder);
}
 
Example #19
Source File: PinView.java    From financisto with GNU General Public License v2.0 5 votes vote down vote up
private Animation inFromRightAnimation() {
	Animation inFromRight = new TranslateAnimation(
			Animation.RELATIVE_TO_PARENT, +1.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f);
	inFromRight.setDuration(300);
	inFromRight.setInterpolator(new AccelerateInterpolator());
	return inFromRight;
}
 
Example #20
Source File: BadgeView.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
private void init(Context context, View target, int tabIndex) {

    this.context = context;
    this.target = target;
    this.targetTabIndex = tabIndex;

    // apply defaults
    badgePosition = DEFAULT_POSITION;
    badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP);
    badgeMarginV = badgeMarginH / 2; //vertical margin was overwritting tab text
    badgeColor = DEFAULT_BADGE_COLOR;

    setTypeface(Typeface.DEFAULT_BOLD);
    int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP);
    setPadding(paddingPixels, 0, paddingPixels, 0);
    setTextColor(DEFAULT_TEXT_COLOR);

    fadeIn = new AlphaAnimation(0, 1);
    fadeIn.setInterpolator(new DecelerateInterpolator());
    fadeIn.setDuration(200);

    fadeOut = new AlphaAnimation(1, 0);
    fadeOut.setInterpolator(new AccelerateInterpolator());
    fadeOut.setDuration(200);

    isShown = false;

    if (this.target != null) {
      applyTo(this.target);
    } else {
      show();
    }
  }
 
Example #21
Source File: MaterialProgressBar.java    From zhizhihu with Apache License 2.0 5 votes vote down vote up
private Animator createIndeterminateAnimator() {
    AnimatorSet set = new AnimatorSet();
    Animator progressAnimator = getAnimator(SECONDARY_PROGRESS, new DecelerateInterpolator());
    Animator secondaryProgressAnimator = getAnimator(PROGRESS, new AccelerateInterpolator());
    set.playTogether(progressAnimator, secondaryProgressAnimator);
    set.setDuration(duration);
    return set;
}
 
Example #22
Source File: AnimationController.java    From FamilyChat with Apache License 2.0 5 votes vote down vote up
public void slideFadeOutToBottom(View view, long durationMillis, long delayMillis)
{
	TranslateAnimation animation1 = new TranslateAnimation(rela1, 0, rela1, 0, rela1, 0, rela1,1);
	AlphaAnimation animation2 = new AlphaAnimation(1, 0);
	AnimationSet animation = new AnimationSet(false);
	animation.addAnimation(animation1);
	AccelerateInterpolator accelerateInterpolator=new AccelerateInterpolator();
	animation1.setInterpolator(accelerateInterpolator);
	animation.addAnimation(animation2);
	baseOut(view, animation, durationMillis, delayMillis);
}
 
Example #23
Source File: CommonPropertyAnimActivity.java    From AndroidStudyDemo with GNU General Public License v2.0 5 votes vote down vote up
public void startTransAnimation(View v) {
    float scale = getResources().getDisplayMetrics().density;

    ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(mShowTransAnimIV, "x", 20.0f*scale, 220.0f*scale);
    ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(mShowTransAnimIV, "y", 20.0f*scale, 220.0f*scale);
    ObjectAnimator objectAnimator3 = ObjectAnimator.ofFloat(mShowTransAnimIV, "x", 220.0f*scale, 20.0f*scale);
    ObjectAnimator objectAnimator4 = ObjectAnimator.ofFloat(mShowTransAnimIV, "y", 220.0f*scale, 20.0f*scale);

    objectAnimator1.setDuration(C.Int.ANIM_DURATION);
    objectAnimator2.setDuration(C.Int.ANIM_DURATION);
    objectAnimator3.setDuration(C.Int.ANIM_DURATION * 2);
    objectAnimator4.setDuration(C.Int.ANIM_DURATION * 2);

    objectAnimator1.setInterpolator(new AccelerateInterpolator());
    objectAnimator2.setInterpolator(new DecelerateInterpolator());
    objectAnimator3.setInterpolator(new LinearInterpolator());
    objectAnimator4.setInterpolator(new AccelerateDecelerateInterpolator());

    AnimatorSet animatorSet = new AnimatorSet();

    //  Long version to set up animation set
    //    animSet.play(anim1).before(anim2);
    //    animSet.play(anim3).after(anim2);
    //    animSet.play(anim3).with(anim4);
    //    animSet.play(anim1).after(500);

    animatorSet.play(objectAnimator1).before(objectAnimator2).after(C.Int.ANIM_DURATION);
    animatorSet.play(objectAnimator3).after(objectAnimator2).with(objectAnimator4);

    animatorSet.start();
}
 
Example #24
Source File: MainActivity.java    From Study_Android_Demo with Apache License 2.0 5 votes vote down vote up
public void setAnim_java(View view) {
	// 2.����һ��AnimationSet
	AnimationSet set = new AnimationSet(true);
	// 3.������������:ƽ�ơ���ת�����š�͸��
			// 2.����TranslateAnimation
	TranslateAnimation trans = new TranslateAnimation(
			TranslateAnimation.RELATIVE_TO_PARENT, 0,
			TranslateAnimation.RELATIVE_TO_PARENT, 0,
			TranslateAnimation.RELATIVE_TO_PARENT, 0,
			TranslateAnimation.RELATIVE_TO_PARENT, -1f);
	// 2.����ScaleAnimation
	ScaleAnimation scale = new ScaleAnimation(1f, 0.6f, 1f, 0.6f,
			ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
			ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
	// 4.ͨ��set.addAnimtion()
	set.addAnimation(trans);
	set.addAnimation(scale);
	// ��ֵ��
	set.setInterpolator(new AccelerateInterpolator());
	// ����ʱ��
	set.setDuration(2000);
	// ����ֹͣ�����
	set.setFillAfter(true);
	// 5.���Ŷ���
	iv_rocket.startAnimation(set);

}
 
Example #25
Source File: GalleryActivity.java    From OmniList with GNU Affero General Public License v3.0 5 votes vote down vote up
private void hideSystemUI() {
    runOnUiThread(() -> {
        toolbar.animate().translationY(- toolbar.getHeight()).setInterpolator(
                new AccelerateInterpolator()).setDuration(200).start();
        getWindow().getDecorView().setSystemUiVisibility(
                SystemUiVisibilityUtil.getSystemVisibility());
        fullScreenMode = true;
    });
}
 
Example #26
Source File: FoldingLayoutActivity.java    From FoldingLayout with Apache License 2.0 5 votes vote down vote up
/**
 * Animates the folding view inwards (to a completely folded state) from its
 * current state and then back out to its original state.
 */
public void animateFold ()
{
    float foldFactor = mFoldLayout.getFoldFactor();

    ObjectAnimator animator = ObjectAnimator.ofFloat(mFoldLayout, "foldFactor", foldFactor, 1);
    animator.setRepeatMode(ValueAnimator.REVERSE);
    animator.setRepeatCount(1);
    animator.setDuration(FOLD_ANIMATION_DURATION);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.start();
}
 
Example #27
Source File: AnimationHelper.java    From FragmentRigger with MIT License 5 votes vote down vote up
public static Animation createRotate3dExitAnimation() {
  Rotate3dAnimation animation = new Rotate3dAnimation(0, 90, true);
  animation.setDuration(300);
  animation.setFillAfter(false);
  animation.setInterpolator(new AccelerateInterpolator());
  return animation;
}
 
Example #28
Source File: BadgeView.java    From android-discourse with Apache License 2.0 5 votes vote down vote up
private void init(Context context, View target, int tabIndex) {

        this.context = context;
        this.target = target;
        this.targetTabIndex = tabIndex;

        // apply defaults
        badgePosition = DEFAULT_POSITION;
        badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP);
        badgeMarginV = badgeMarginH;
        badgeColor = DEFAULT_BADGE_COLOR;

        setTypeface(Typeface.DEFAULT_BOLD);
        int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP);
        setPadding(paddingPixels, 0, paddingPixels, 0);
        setTextColor(DEFAULT_TEXT_COLOR);

        fadeIn = new AlphaAnimation(0, 1);
        fadeIn.setInterpolator(new DecelerateInterpolator());
        fadeIn.setDuration(200);

        fadeOut = new AlphaAnimation(1, 0);
        fadeOut.setInterpolator(new AccelerateInterpolator());
        fadeOut.setDuration(200);

        isShown = false;

        if (this.target != null) {
            applyTo(this.target);
        } else {
            show();
        }

    }
 
Example #29
Source File: MusicalNoteLayout.java    From TikTok with Apache License 2.0 5 votes vote down vote up
private Animator getFinalAnimator(View target) {
    AnimatorSet set = getEnterAnimator(target);
    ValueAnimator bezierValueAnimator = getBezierValueAnimator(target);
    AnimatorSet finalSet = new AnimatorSet();
    finalSet.playTogether(set, bezierValueAnimator);
    finalSet.setInterpolator(new AccelerateInterpolator());
    finalSet.setTarget(target);
    return finalSet;
}
 
Example #30
Source File: RxAnimations.java    From RxAnimations with Apache License 2.0 5 votes vote down vote up
public static Completable fadeOut(final View view, final int duration) {
    return animate(view, new AccelerateInterpolator())
            .duration(duration)
            .fadeOut()
            .onAnimationCancel(aView -> aView.setAlpha(TRANSPARENT))
            .schedule();
}