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


Java ObjectAnimator.setRepeatMode方法代码示例

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


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

示例1: animateDisplayWave

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 动画
 */
private void animateDisplayWave() {
    if (left_WaveView != null && center_WaveView != null) {
        left_WaveView.setAnimationCacheEnabled(false);
        center_WaveView.setAnimationCacheEnabled(false);
        ObjectAnimator transX_waveLeft = ObjectAnimator.ofFloat(left_WaveView, "translationX", 0, 1920);
        ObjectAnimator transX_waveCenter = ObjectAnimator.ofFloat(center_WaveView, "translationX", 0, 1920);
        transX_waveLeft.setRepeatMode(ValueAnimator.RESTART);
        transX_waveLeft.setRepeatCount(Animation.INFINITE);
        transX_waveCenter.setRepeatMode(ValueAnimator.RESTART);
        transX_waveCenter.setRepeatCount(Animation.INFINITE);
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.setDuration(16000);
        animatorSet.setInterpolator(new LinearInterpolator());
        animatorSet.playTogether(transX_waveLeft, transX_waveCenter);
        animatorSet.start();
    }
}
 
开发者ID:NickKJ,项目名称:WavesView,代码行数:21,代码来源:WavePicView.java

示例2: createBaseWobble

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private ObjectAnimator createBaseWobble(final View v) {

    if (!isPreLollipop())
        v.setLayerType(LAYER_TYPE_SOFTWARE, null);

    ObjectAnimator animator = new ObjectAnimator();
    animator.setDuration(180);
    animator.setRepeatMode(ValueAnimator.REVERSE);
    animator.setRepeatCount(ValueAnimator.INFINITE);
    animator.setPropertyName("rotation");
    animator.setTarget(v);
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            v.setLayerType(LAYER_TYPE_NONE, null);
        }
    });
    return animator;
}
 
开发者ID:jpaijh,项目名称:TYT,代码行数:21,代码来源:DynamicGridView.java

示例3: build

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * build a copy of given animator
 *
 * @return
 */
public Animator build() {
    //这种方式clone出来的animator不能重复播放
    /*final ObjectAnimator result = getAnimator().clone();//克隆一份
    setupListeners(result);
    result.setupStartValues();
    return result;*/

    final ObjectAnimator self = this.getAnimator();
    final ObjectAnimator anim = new ObjectAnimator();
    anim.setTarget(self.getTarget());
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        anim.setAutoCancel(true);
    }
    if (self.getValues() != null) {
        anim.setValues(self.getValues());
    }
    anim.setInterpolator(self.getInterpolator());
    anim.setDuration(self.getDuration());
    anim.setStartDelay(self.getStartDelay());
    anim.setRepeatCount(self.getRepeatCount());
    anim.setRepeatMode(self.getRepeatMode());
    setupListeners(anim);
    return anim;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:30,代码来源:UDAnimator.java

示例4: 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

示例5: initData

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void initData() {
    Config config = (Config) getIntent().getSerializableExtra(MiniPayUtils.EXTRA_KEY_PAY_CONFIG);
    this.wechatQaImage = config.getWechatQaImage();
    this.aliQaImage = config.getAliQaImage();
    this.wechatTip = config.getWechatTip();
    this.aliTip = config.getAliTip();
    this.aliZhiKey = config.getAliZhiKey();

    if (!checkLegal()) {
        throw new IllegalStateException("MiniPay Config illegal!!!");
    } else {
        if (TextUtils.isEmpty(wechatTip)) wechatTip = getString(R.string.wei_zhi_tip);
        if (TextUtils.isEmpty(aliTip)) aliTip = getString(R.string.ali_zhi_tip);

        mZhiBg.setBackgroundResource(R.drawable.common_bg);
        mTitleTv.setText(R.string.wei_zhi_title);
        mSummeryTv.setText(wechatTip);
        mQaImage.setImageResource(wechatQaImage);
    }

    ObjectAnimator animator = ObjectAnimator.ofFloat(mTip, "alpha", 0, 0.66f, 1.0f, 0);
    animator.setDuration(2888);
    animator.setRepeatCount(6);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    animator.setRepeatMode(ValueAnimator.REVERSE);
    animator.start();
}
 
开发者ID:CankingApp,项目名称:MiniPay,代码行数:28,代码来源:ZhiActivity.java

示例6: startSunPulsateAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void startSunPulsateAnimation() {
    ObjectAnimator sunPulsateAnimator = ObjectAnimator.ofObject(mSunView, "backgroundColor",
            new ArgbEvaluator(), mColdSunColor, mHeatSunColor)
            .setDuration(1000);

    sunPulsateAnimator.setRepeatMode(ValueAnimator.REVERSE);
    sunPulsateAnimator.setRepeatCount(ValueAnimator.INFINITE);

    sunPulsateAnimator.start();
}
 
开发者ID:InnoFang,项目名称:Android-Code-Demos,代码行数:11,代码来源:SunsetFragment.java

示例7: onCreate

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
  protected void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
txtlabel=findViewById(R.id.mainTextView1);
ObjectAnimator anim=ObjectAnimator.ofFloat(txtlabel, View.ALPHA, 0.1f,1.0f);
anim.setDuration(2000);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(Animation.INFINITE);
anim.start();
startService(new Intent(MainActivity.this, TGPoll.class));
  }
 
开发者ID:agusibrahim,项目名称:TGBot-for-Android,代码行数:14,代码来源:MainActivity.java

示例8: setRepeatMode

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 重复方式(1 default, -1 infinite, 2 reverse)
 *
 * @param repeatMode
 * @return
 */
public UDAnimator setRepeatMode(int repeatMode) {
    final ObjectAnimator animator = getAnimator();
    if (animator != null) {
        animator.setRepeatMode(repeatMode);
    }
    return this;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:14,代码来源:UDAnimator.java

示例9: 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

示例10: initAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void initAnimation() {
    List<Animator> animators = new ArrayList<>();

    // horizontal animation.
    // wave waves infinitely.
    ObjectAnimator waveShiftAnim = ObjectAnimator.ofFloat(
            mWaveView, "waveShiftRatio", 0f, 1f);
    waveShiftAnim.setRepeatCount(ValueAnimator.INFINITE);
    waveShiftAnim.setDuration(1000);
    waveShiftAnim.setInterpolator(new LinearInterpolator());
    animators.add(waveShiftAnim);

    // vertical animation.
    // water level increases from 0 to center of WaveView
    ObjectAnimator waterLevelAnim = ObjectAnimator.ofFloat(
            mWaveView, "waterLevelRatio", 0f, 0.5f);
    waterLevelAnim.setDuration(1000);
    waterLevelAnim.setInterpolator(new DecelerateInterpolator());
    animators.add(waterLevelAnim);

    // amplitude animation.
    // wave grows big then grows small, repeatedly
    ObjectAnimator amplitudeAnim = ObjectAnimator.ofFloat(
            mWaveView, "amplitudeRatio", 0.0001f, 0.05f);
    amplitudeAnim.setRepeatCount(ValueAnimator.INFINITE);
    amplitudeAnim.setRepeatMode(ValueAnimator.REVERSE);
    amplitudeAnim.setDuration(5000);
    amplitudeAnim.setInterpolator(new LinearInterpolator());
    animators.add(amplitudeAnim);

    mAnimatorSet = new AnimatorSet();
    mAnimatorSet.playTogether(animators);
}
 
开发者ID:vijanny,项目名称:WaveView-RN,代码行数:34,代码来源:WaveHelper.java

示例11: getScalingAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public ObjectAnimator getScalingAnimator() {
    PropertyValuesHolder imgViewScaleY = PropertyValuesHolder.ofFloat(View
            .SCALE_Y, SCALE_FACTOR);
    PropertyValuesHolder imgViewScaleX = PropertyValuesHolder.ofFloat(View
            .SCALE_X, SCALE_FACTOR);

    ObjectAnimator imgViewScaleAnimator = ObjectAnimator
            .ofPropertyValuesHolder(this, imgViewScaleX, imgViewScaleY);
    imgViewScaleAnimator.setRepeatCount(1);
    imgViewScaleAnimator.setRepeatMode(ValueAnimator.REVERSE);
    imgViewScaleAnimator.setDuration(ANIMATION_DURATION);

    return imgViewScaleAnimator;
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:15,代码来源:RoundView.java

示例12: startAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
void startAnimation() {
    // This variation uses an ObjectAnimator. The functionality is exactly the same as
    // in Bouncer2, but this time the boilerplate code is greatly reduced because we
    // tell ObjectAnimator to automatically animate the target object for us, so we no
    // longer need to listen for frame updates and do that work ourselves.
    ObjectAnimator anim = getObjectAnimator();
    anim.setRepeatCount(ValueAnimator.INFINITE);
    anim.setRepeatMode(ValueAnimator.REVERSE);
    anim.setInterpolator(new AccelerateInterpolator());
    anim.start();
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:12,代码来源:Bouncer3.java

示例13: animateFold

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:16,代码来源:FoldingLayoutActivity.java

示例14: playSunAnim

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void playSunAnim() {
    ObjectAnimator anim = ObjectAnimator.ofFloat(splashSun, "rotation", 0f, 360f);
    anim.setRepeatMode(ObjectAnimator.RESTART);
    anim.setRepeatCount(ObjectAnimator.INFINITE);
    anim.setInterpolator(new LinearInterpolator());
    anim.setDuration(30 * 1000);
    anim.start();
}
 
开发者ID:linchupeng,项目名称:YourWeather,代码行数:9,代码来源:FirstActivity.java

示例15: performColorSwapAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public static void performColorSwapAnimation(FullscreenBaseGameActivity context, Integer[] shuffle, List<Button> buttons, FrameLayout[] layouts) {
    for (int i = 0; i < buttons.size(); i++) {
        int index = shuffle[i];
        layouts[i].addView(buttons.get(index));
        ObjectAnimator objectAnimator = ObjectAnimator.ofObject(buttons.get(i), "backgroundColor",
                new ArgbEvaluator(),
                ContextCompat.getColor(context, SimonColorImpl.getColorIdFromButtonId(buttons.get(index).getId())),
                ContextCompat.getColor(context, SimonColorImpl.getColorIdFromButtonId(buttons.get(i).getId())));
        objectAnimator.setRepeatCount(0);
        objectAnimator.setRepeatMode(ValueAnimator.REVERSE);
        objectAnimator.setDuration(300);
        objectAnimator.start();
    }
}
 
开发者ID:simoneapp,项目名称:S3-16-simone,代码行数:15,代码来源:AnimationHandler.java


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