當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。