本文整理汇总了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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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));
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}