本文整理匯總了Java中android.view.animation.Animation.setRepeatMode方法的典型用法代碼示例。如果您正苦於以下問題:Java Animation.setRepeatMode方法的具體用法?Java Animation.setRepeatMode怎麽用?Java Animation.setRepeatMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.animation.Animation
的用法示例。
在下文中一共展示了Animation.setRepeatMode方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onWindowFocusChanged
import android.view.animation.Animation; //導入方法依賴的package包/類
public void onWindowFocusChanged(boolean hasFocus) {
if (customProgressDialog == null) {
return;
}
ImageView mprogressImage = (ImageView) findViewById(R.id.loadingImageView);
Animation animRoute = new RotateAnimation(0.0f, +360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animRoute.setDuration(1000);
animRoute.setRepeatMode(Animation.RESTART);
animRoute.setRepeatCount(Animation.INFINITE);
LinearInterpolator lir = new LinearInterpolator();
animRoute.setInterpolator(lir);
mprogressImage.startAnimation(animRoute);
}
示例2: onCreate
import android.view.animation.Animation; //導入方法依賴的package包/類
@Override
@SuppressLint("SetJavaScriptEnabled")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web);
WebView webView = (WebView) findViewById(R.id.web_view);
String url = getIntent().getStringExtra(URL);
if (url == null && getIntent().getData() != null) {
url = getIntent().getData().getQueryParameter(URL);
}
if (url == null) {
finish();
}
webView.setWebViewClient(new InnerWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
loading = (TextView) findViewById(R.id.loading);
Animation animation = new ScaleAnimation(1.0f, 1.2f, 1.0f, 1.2f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setRepeatMode(Animation.REVERSE);
animation.setRepeatCount(Animation.INFINITE);
animation.setDuration(500);
loading.startAnimation(animation);
setTitle(url);
}
示例3: setupAnimation
import android.view.animation.Animation; //導入方法依賴的package包/類
private void setupAnimation() {
mAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
mRotate = (interpolatedTime);
invalidate();
}
};
mAnimation.setRepeatCount(Animation.INFINITE);
mAnimation.setRepeatMode(Animation.RESTART);
mAnimation.setInterpolator(LINEAR_INTERPOLATOR);
mAnimation.setDuration(ANIMATION_DURATION);
}
示例4: setupAnimations
import android.view.animation.Animation; //導入方法依賴的package包/類
private void setupAnimations() {
mAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, @NonNull Transformation t) {
setLoadingAnimationTime(interpolatedTime);
}
};
mAnimation.setRepeatCount(Animation.INFINITE);
mAnimation.setRepeatMode(Animation.REVERSE);
mAnimation.setInterpolator(ACCELERATE_DECELERATE_INTERPOLATOR);
mAnimation.setDuration(ANIMATION_DURATION);
}
示例5: setupAnimations
import android.view.animation.Animation; //導入方法依賴的package包/類
private void setupAnimations() {
mAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
setRotate(interpolatedTime);
}
};
mAnimation.setRepeatCount(Animation.INFINITE);
mAnimation.setRepeatMode(Animation.RESTART);
mAnimation.setInterpolator(LINEAR_INTERPOLATOR);
mAnimation.setDuration(ANIMATION_DURATION);
}
示例6: onClick
import android.view.animation.Animation; //導入方法依賴的package包/類
@Override
public void onClick(View view) {
//Extract values from children
LinearLayout rowsView = (LinearLayout) rootView.findViewById(R.id.repeatable_items);
ArrayList<String> row = new ArrayList<>();
for (int i = 0; i < rowsView.getChildCount(); ++i) {
EditText et = (EditText) rowsView.getChildAt(i).findViewById(R.id.input_row);
row.add(et.getText().toString());
}
fq.addRow(row);
TextView tvCount = (TextView) rootView.findViewById(R.id.question_items_count);
tvCount.setText(fq.getRows().size() + " items");
Toast.makeText(FormSolverActivity.this, "SAVED", Toast.LENGTH_SHORT).show();
Animation animation = new ScaleAnimation(1,1.1f,1,1.1f);
animation.setDuration(300);
animation.setRepeatMode(Animation.REVERSE);
animation.setRepeatCount(1);
tvCount.startAnimation(animation);
//Remove any child from view
((LinearLayout) rootView.findViewById(R.id.repeatable_items)).removeAllViews();
((Button) rootView.findViewById(R.id.question_add_response_instance)).setText(getString(R.string.action_new_row));
rootView.findViewById(R.id.question_add_response_instance).setOnClickListener(new onRowAddedListener(rootView, fq));
fab.show();
}
示例7: show
import android.view.animation.Animation; //導入方法依賴的package包/類
@Override
public void show() {
super.show();
Animation animation = AnimationUtils.loadAnimation(mContext,R.anim.link_slide_left);
animation.setRepeatCount(Animation.INFINITE);
animation.setRepeatMode(Animation.RESTART);
mMaskView.setAnimation(animation);
}
示例8: startBreath
import android.view.animation.Animation; //導入方法依賴的package包/類
protected void startBreath() {
if (this.mVideoShotButton != null) {
Animation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation.setDuration(500);
alphaAnimation.setInterpolator(new LinearInterpolator());
alphaAnimation.setRepeatCount(-1);
alphaAnimation.setRepeatMode(2);
this.mVideoShotButton.startAnimation(alphaAnimation);
this.mHandler.sendEmptyMessageDelayed(258, 10000);
}
}
示例9: animateTitle
import android.view.animation.Animation; //導入方法依賴的package包/類
public void animateTitle() {
Animation anim = new ScaleAnimation(
1f, 1.5f, // Start and end values for the X axis scaling
1f, 1.5f, // Start and end values for the Y axis scaling
Animation.RELATIVE_TO_SELF, 1f, // Pivot point of X scaling
Animation.RELATIVE_TO_SELF, 1f); // Pivot point of Y scaling
anim.setFillAfter(true); // Needed to keep the result of the animation
anim.setDuration(1000);
anim.setRepeatCount(Animation.INFINITE);
anim.setRepeatMode(ValueAnimator.REVERSE);
title.startAnimation(anim);
}
示例10: blink
import android.view.animation.Animation; //導入方法依賴的package包/類
public static Animation blink() {
Animation animation = new AlphaAnimation(1, 0);
animation.setDuration(550);
animation.setInterpolator(new LinearInterpolator());
animation.setRepeatCount(10);
animation.setRepeatMode(Animation.REVERSE);
return animation;
}
示例11: AndroidVsIosHeaderView
import android.view.animation.Animation; //導入方法依賴的package包/類
public AndroidVsIosHeaderView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
inflate(context, R.layout.layout_irecyclerview_bat_vs_supper_refresh_header_view, this);
ivBatMan = (ImageView) findViewById(R.id.ivBatMan);
ivSuperMan = (ImageView) findViewById(R.id.ivSuperMan);
ivVs = (ImageView) findViewById(R.id.imageView);
PropertyValuesHolder translationX1 = PropertyValuesHolder.ofFloat("translationX",0.0f,100.0f,0.0f);
PropertyValuesHolder rotate = PropertyValuesHolder.ofFloat("rotationY",0.0f,380.0f,0.0f);
PropertyValuesHolder translationX2 = PropertyValuesHolder.ofFloat("translationX",0.0f,-100.0f,0.0f);
ObjectAnimator objectAnimator1 = ObjectAnimator.ofPropertyValuesHolder(ivBatMan, translationX1);
objectAnimator1.setRepeatCount(ValueAnimator.INFINITE);
objectAnimator1.setRepeatMode(ValueAnimator.INFINITE);
ObjectAnimator objectAnimator2 = ObjectAnimator.ofPropertyValuesHolder(ivSuperMan,translationX2);
objectAnimator2.setRepeatCount(ValueAnimator.INFINITE);
objectAnimator2.setRepeatMode(ValueAnimator.INFINITE);
ObjectAnimator objectAnimator3 = ObjectAnimator.ofPropertyValuesHolder(ivVs, rotate);
objectAnimator3.setRepeatCount(ValueAnimator.INFINITE);
objectAnimator3.setRepeatMode(ValueAnimator.INFINITE);
Animation animation =new RotateAnimation(0f,360f, Animation.RELATIVE_TO_SELF,
0.5f,Animation.RELATIVE_TO_SELF,0.5f);
Animation animation1 =new RotateAnimation(0f,-360f, Animation.RELATIVE_TO_SELF,
0.5f,Animation.RELATIVE_TO_SELF,0.5f);
animation.setFillAfter(true);
animation.setDuration(2000);
animation.setRepeatCount(ValueAnimator.INFINITE);
animation.setRepeatMode(ValueAnimator.INFINITE);
animation1.setFillAfter(true);
animation1.setDuration(2000);
animation1.setRepeatCount(ValueAnimator.INFINITE);
animation1.setRepeatMode(ValueAnimator.INFINITE);
ivBatMan.setAnimation(animation);
ivSuperMan.setAnimation(animation1);
btnSexAnimatorSet = new AnimatorSet();
btnSexAnimatorSet.playTogether(objectAnimator1, objectAnimator2,objectAnimator3);
btnSexAnimatorSet.setDuration(2000);
btnSexAnimatorSet.start();
}