当前位置: 首页>>代码示例>>Java>>正文


Java ObjectAnimator.setInterpolator方法代码示例

本文整理汇总了Java中android.animation.ObjectAnimator.setInterpolator方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectAnimator.setInterpolator方法的具体用法?Java ObjectAnimator.setInterpolator怎么用?Java ObjectAnimator.setInterpolator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.animation.ObjectAnimator的用法示例。


在下文中一共展示了ObjectAnimator.setInterpolator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startRevertFromMenu

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public static void startRevertFromMenu(View root, AnimatorListenerAdapter animatorListenerAdapter) 
{
       revertFromMenu((DepthLayout)root.findViewById(R.id.ma_appBar), 20f, 0, 0);
	revertFromMenu((DepthLayout)root.findViewById(R.id.layout_container), 30f, 10, 0);
	
	//revertFromMenu((DepthLayout) root.findViewById(R.id.frame_fab), 20f, 0, 0);
	// revertFromMenu((DepthLayout) root.findViewById(R.id.root_dl), 30f, 10, 0);
       // revertFromMenu((DepthLayout) root.findViewById(R.id.appbar), 20f, 0, 0);
       //revertFromMenu((DepthLayout) root.findViewById(R.id.fab_container), 20f, 20, 6);
       // revertFromMenu((DepthLayout) root.findViewById(R.id.dl2), 20f, 30, 1);
       // revertFromMenu((DepthLayout) root.findViewById(R.id.dl3), 20f, 40, 2).addListener(animatorListenerAdapter);

       ObjectAnimator translationY = ObjectAnimator.ofFloat(root, View.TRANSLATION_Y, 0).setDuration(DURATION);
       translationY.setInterpolator(new QuintInOut());
       translationY.start();
   }
 
开发者ID:MSay2,项目名称:Mire,代码行数:17,代码来源:TransitionHelperWallpaper.java

示例2: generateAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private Animator generateAnimation() {

        ObjectAnimator blink = ObjectAnimator.ofFloat(this, "waveScale", 0f, 1f);
        blink.setDuration(priority);
        if (playInterpolator != null) {
            blink.setInterpolator(playInterpolator);
        }

        blink.setRepeatCount(Animation.INFINITE);
        blink.setRepeatMode(Animation.INFINITE);

        ObjectAnimator alphaAnimator = ObjectAnimator.ofInt(this, "alpha", 255, 0);
        alphaAnimator.setDuration(priority);
        if (alphaInterpolator != null) {
            alphaAnimator.setInterpolator(alphaInterpolator);
        }
        alphaAnimator.setRepeatCount(Animation.INFINITE);
        alphaAnimator.setRepeatMode(Animation.INFINITE);

        animatorSet.playTogether(blink, alphaAnimator);

        return animatorSet;
    }
 
开发者ID:alshell7,项目名称:terminal-seekbar,代码行数:24,代码来源:TerminalBackDrawable.java

示例3: animateShutter

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void animateShutter() {
  vShutter.setVisibility(View.VISIBLE);
  vShutter.setAlpha(0.f);

  ObjectAnimator alphaInAnim = ObjectAnimator.ofFloat(vShutter, "alpha", 0f, 0.8f);
  alphaInAnim.setDuration(100);
  alphaInAnim.setStartDelay(100);
  alphaInAnim.setInterpolator(ACCELERATE_INTERPOLATOR);

  ObjectAnimator alphaOutAnim = ObjectAnimator.ofFloat(vShutter, "alpha", 0.8f, 0f);
  alphaOutAnim.setDuration(200);
  alphaOutAnim.setInterpolator(DECELERATE_INTERPOLATOR);

  AnimatorSet animatorSet = new AnimatorSet();
  animatorSet.playSequentially(alphaInAnim, alphaOutAnim);
  animatorSet.addListener(new AnimatorListenerAdapter() {
    @Override
    public void onAnimationEnd(Animator animation) {
      vShutter.setVisibility(View.GONE);
    }
  });
  animatorSet.start();
}
 
开发者ID:softonic,项目名称:instamaterial,代码行数:24,代码来源:TakePhotoActivity.java

示例4: createEnterTabSwitcherModeAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private ObjectAnimator createEnterTabSwitcherModeAnimation() {
    ObjectAnimator enterAnimation =
            ObjectAnimator.ofFloat(this, mTabSwitcherModePercentProperty, 1.f);
    enterAnimation.setDuration(TAB_SWITCHER_MODE_ENTER_ANIMATION_DURATION_MS);
    enterAnimation.setInterpolator(new LinearInterpolator());
    enterAnimation.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            // This is to deal with the view going invisible when resuming the activity and
            // running this animation.  The view is still there and clickable but does not
            // render and only a layout triggers a refresh.  See crbug.com/306890.
            if (!mToggleTabStackButton.isEnabled()) requestLayout();
        }
    });

    return enterAnimation;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:18,代码来源:ToolbarPhone.java

示例5: createDialogSlideAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Create an animator to slide in the entire dialog from the top of the screen.
 */
private Animator createDialogSlideAnimator(boolean isEnter) {
    final float animHeight = -1f * mContainer.getHeight();
    ObjectAnimator translateAnim;
    if (isEnter) {
        mContainer.setTranslationY(animHeight);
        translateAnim = ObjectAnimator.ofFloat(mContainer, View.TRANSLATION_Y, 0f);
        translateAnim.setInterpolator(BakedBezierInterpolator.FADE_IN_CURVE);
    } else {
        translateAnim = ObjectAnimator.ofFloat(mContainer, View.TRANSLATION_Y, animHeight);
        translateAnim.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE);
    }
    translateAnim.setDuration(FADE_DURATION);
    return translateAnim;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:18,代码来源:WebsiteSettingsPopup.java

示例6: animateXY

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Animates the drawing / rendering of the chart on both x- and y-axis with
 * the specified animation time. If animate(...) is called, no further
 * calling of invalidate() is necessary to refresh the chart.
 *
 * @param durationMillisX
 * @param durationMillisY
 * @param easingX
 * @param easingY
 */
public void animateXY(int durationMillisX, int durationMillisY, EasingFunction easingX,
        EasingFunction easingY) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    ObjectAnimator animatorY = ObjectAnimator.ofFloat(this, "phaseY", 0f, 1f);
    animatorY.setInterpolator(easingY);
    animatorY.setDuration(
            durationMillisY);
    ObjectAnimator animatorX = ObjectAnimator.ofFloat(this, "phaseX", 0f, 1f);
    animatorX.setInterpolator(easingX);
    animatorX.setDuration(
            durationMillisX);

    // make sure only one animator produces update-callbacks (which then
    // call invalidate())
    if (durationMillisX > durationMillisY) {
        animatorX.addUpdateListener(mListener);
    } else {
        animatorY.addUpdateListener(mListener);
    }

    animatorX.start();
    animatorY.start();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:ChartAnimator.java

示例7: buildAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public Animator buildAnimation(@NonNull ViewDefault viewDefault, @NonNull final View viewToMorph, boolean isReversed) {
    float fromDegrees, toDegrees;
    fromDegrees = viewDefault.getDispositionAngle();
    switch (animationType) {
        case BY:
            toDegrees = fromDegrees + (isReversed ? -targetDegrees : targetDegrees);
            break;
        case TO:
        default:
            if (isReversed) {
                toDegrees = fromDegrees != targetDegrees ? fromDegrees : initialDegrees;
            } else {
                initialDegrees = fromDegrees;
                toDegrees = targetDegrees;
            }
            break;
    }
    viewDefault.setDispositionAngle(toDegrees);
    PropertyValuesHolder[] parameters = new PropertyValuesHolder[1];
    parameters[0] = PropertyValuesHolder.ofFloat(View.ROTATION, fromDegrees, toDegrees);
    ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(viewToMorph, parameters);
    if (duration >= 0) {
        animator.setDuration(duration);
    }
    if (interpolator != null) {
        animator.setInterpolator(interpolator);
    }
    return animator;
}
 
开发者ID:rjsvieira,项目名称:morphos,代码行数:31,代码来源:RotationAnimation.java

示例8: createLoadingAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private Animator createLoadingAnimator() {
    ObjectAnimator rotation = ObjectAnimator
            .ofFloat(mImgLoading, "rotation", 0, 360);
    //RotateAnimation animation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotation.setRepeatCount(ObjectAnimator.INFINITE);
    rotation.setRepeatMode(ObjectAnimator.RESTART);
    rotation.setInterpolator(new LinearInterpolator());
    rotation.setDuration(mLoadingTime);
    return rotation;
}
 
开发者ID:imliujun,项目名称:LJFramework,代码行数:11,代码来源:LoadingRefreshHeader.java

示例9: progressAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void progressAnimator(final View view) {
    PropertyValuesHolder animator = PropertyValuesHolder.ofFloat("scaleX",
            0.5f, 1f);
    PropertyValuesHolder animator2 = PropertyValuesHolder.ofFloat("scaleY",
            0.5f, 1f);
    ObjectAnimator animator3 = ObjectAnimator.ofPropertyValuesHolder(view,
            animator, animator2);
    animator3.setDuration(1000);
    animator3.setInterpolator(new JellyInterpolator());
    animator3.start();

}
 
开发者ID:fergus825,项目名称:SmartOrnament,代码行数:13,代码来源:LoginActivity.java

示例10: startRipple

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void startRipple(final Runnable animationEndRunnable) {
    if (eventCancelled) return;

    float endRadius = getEndRadius();

    cancelAnimations();

    rippleAnimator = new AnimatorSet();
    rippleAnimator.addListener(new AnimatorListenerAdapter() {
        @Override public void onAnimationEnd(Animator animation) {
            if (!ripplePersistent) {
                setRadius(0);
                setRippleAlpha(rippleAlpha);
            }
            if (animationEndRunnable != null && rippleDelayClick) {
                animationEndRunnable.run();
            }
            childView.setPressed(false);
        }
    });

    ObjectAnimator ripple = ObjectAnimator.ofFloat(this, radiusProperty, radius, endRadius);
    ripple.setDuration(rippleDuration);
    ripple.setInterpolator(new DecelerateInterpolator());
    ObjectAnimator fade = ObjectAnimator.ofInt(this, circleAlphaProperty, rippleAlpha, 0);
    fade.setDuration(rippleFadeDuration);
    fade.setInterpolator(new AccelerateInterpolator());
    fade.setStartDelay(rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY);

    if (ripplePersistent) {
        rippleAnimator.play(ripple);
    } else if (getRadius() > endRadius) {
        fade.setStartDelay(0);
        rippleAnimator.play(fade);
    } else {
        rippleAnimator.playTogether(ripple, fade);
    }
    rippleAnimator.start();
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:40,代码来源:MaterialRippleLayout.java

示例11: setClickable

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void setClickable(){
    mView.setClickable(true);
    mButton.setClickable(true);
    mButton.setEnabled(true);
    mButton.setBackgroundColor(0xffbd2430);
    //Animation
    ObjectAnimator animator = ObjectAnimator.ofFloat(mCardView, "cardElevation", 2, 30);
    animator.setInterpolator(new DecelerateInterpolator());
    animator.setDuration(200);
    animator.start();
}
 
开发者ID:ndleyton,项目名称:OneTwo,代码行数:12,代码来源:TimerBackend.java

示例12: changeBackground

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void changeBackground(){
    ObjectAnimator animator = isMenuOpen ? ObjectAnimator.ofFloat(mBackgroundView, "alpha", 0.9f, 0f) :
            ObjectAnimator.ofFloat(mBackgroundView, "alpha", 0f, 0.9f);
    animator.setDuration(150);
    animator.setInterpolator(new LinearInterpolator());
    animator.start();
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:8,代码来源:MultiFloatingActionButton.java

示例13: hideMenu

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void hideMenu() {
    isMenuVisible = false;
    ObjectAnimator translationY = ObjectAnimator.ofFloat(menu, View.TRANSLATION_Y, menu.getHeight());
    translationY.setDuration(750);
    translationY.setInterpolator(new ExpoIn());
    translationY.start();
}
 
开发者ID:florent37,项目名称:Depth,代码行数:8,代码来源:RootActivity.java

示例14: enterSoftware

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void enterSoftware() {
    cancelAnimations();
    mGlowAlpha = mGlowAlphaMax;
    ObjectAnimator scaleAnimator = ObjectAnimator.ofFloat(this, "glowScale",
            0f, GLOW_MAX_SCALE_FACTOR);
    scaleAnimator.setInterpolator(mInterpolator);
    scaleAnimator.setDuration(ANIMATION_DURATION_SCALE);
    scaleAnimator.addListener(mAnimatorListener);
    scaleAnimator.start();
    mRunningAnimations.add(scaleAnimator);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:12,代码来源:KeyButtonRipple.java

示例15: createAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    PropertyValuesHolder rotation5=PropertyValuesHolder.ofFloat("rotationX",0,180,180,0,0);
    PropertyValuesHolder rotation6=PropertyValuesHolder.ofFloat("rotationY",0,0,180,180,0);
    ObjectAnimator animator=ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6,rotation5);
    animator.setInterpolator(new LinearInterpolator());
    animator.setRepeatCount(-1);
    animator.setDuration(2500);
    animator.start();
    animators.add(animator);
    return animators;
}
 
开发者ID:zhouphenix,项目名称:Multi-SwipeToRefreshLayout,代码行数:14,代码来源:SquareSpinIndicator.java


注:本文中的android.animation.ObjectAnimator.setInterpolator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。