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


Java Animation.setRepeatCount方法代码示例

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


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

示例1: startHideContinueIconAnimations

import android.view.animation.Animation; //导入方法依赖的package包/类
private AnimationSet startHideContinueIconAnimations() {
	Animation mScaleAnimation = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
	Animation mRotateAnimation = new RotateAnimation(
				0, 360,
				Animation.RELATIVE_TO_SELF, 0.5f,
				Animation.RELATIVE_TO_SELF, 0.5f
	);
	mRotateAnimation.setRepeatCount(0);

	AnimationSet mAnimations = new AnimationSet(true);
	mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
	mAnimations.setFillAfter(true);
	mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
	mAnimations.addAnimation(mScaleAnimation);
	mAnimations.addAnimation(mRotateAnimation);

	mContinueIcon.startAnimation(mAnimations);
	return mAnimations;
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:20,代码来源:WelcomeActivity.java

示例2: startShowContinueIconAnimations

import android.view.animation.Animation; //导入方法依赖的package包/类
private AnimationSet startShowContinueIconAnimations() {
	Animation mScaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
	Animation mRotateAnimation = new RotateAnimation(
				0, 360,
				Animation.RELATIVE_TO_SELF, 0.5f,
				Animation.RELATIVE_TO_SELF, 0.5f
	);
	mRotateAnimation.setRepeatCount(0);

	AnimationSet mAnimations = new AnimationSet(true);
	mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
	mAnimations.setFillAfter(true);
	mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
	mAnimations.addAnimation(mScaleAnimation);
	mAnimations.addAnimation(mRotateAnimation);

	mContinueIcon.startAnimation(mAnimations);
	return mAnimations;
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:20,代码来源:WelcomeActivity.java

示例3: 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);
    }
 
开发者ID:haihaio,项目名称:AmenWeather,代码行数:17,代码来源:CustomProgressDialog.java

示例4: ViewLoading

import android.view.animation.Animation; //导入方法依赖的package包/类
public ViewLoading(Context context , int styleId) {
    super(context, styleId);
    // 加载布局
    setContentView(R.layout.dialog_toast_view);
    ImageView progressImageView = (ImageView) findViewById(R.id.iv_image);
    //创建旋转动画
    Animation animation =new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(2000);
    animation.setRepeatCount(10);//动画的重复次数
    animation.setFillAfter(true);//设置为true,动画转化结束后被应用
    progressImageView.startAnimation(animation);//开始动画
    // 设置Dialog参数
    Window window = getWindow();
    if(window!=null){
        WindowManager.LayoutParams params = window.getAttributes();
        params.gravity = Gravity.CENTER;
        window.setAttributes(params);
    }
}
 
开发者ID:yangchong211,项目名称:YCUtils,代码行数:20,代码来源:ViewLoading.java

示例5: onCreate

import android.view.animation.Animation; //导入方法依赖的package包/类
protected final void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    Context context = getContext();
    View linearLayout = new LinearLayout(context);
    LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, a(context, (float) IntFloatWheelView.DEFAULT_VALUE));
    layoutParams.gravity = 17;
    linearLayout.setOrientation(0);
    linearLayout.setLayoutParams(layoutParams);
    Drawable gradientDrawable = new GradientDrawable();
    gradientDrawable.setColor(-450944201);
    gradientDrawable.setCornerRadius((float) a(context, 5.0f));
    linearLayout.setBackgroundDrawable(gradientDrawable);
    View imageView = new ImageView(context);
    layoutParams = new LinearLayout.LayoutParams(a(context, 20.0f), a(context, 20.0f));
    layoutParams.gravity = 16;
    layoutParams.setMargins(a(this.a.f, 17.0f), a(this.a.f, 10.0f), a(this.a.f, 8.0f), a(this.a.f, 10.0f));
    imageView.setLayoutParams(layoutParams);
    imageView.setScaleType(ScaleType.FIT_CENTER);
    imageView.setImageDrawable(a(context, a.d));
    Animation rotateAnimation = new RotateAnimation(0.0f, 359.0f, 1, 0.5f, 1, 0.5f);
    rotateAnimation.setRepeatCount(-1);
    rotateAnimation.setDuration(900);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    imageView.startAnimation(rotateAnimation);
    View textView = new TextView(context);
    textView.setText(TextUtils.isEmpty(this.a.g) ? a.a : this.a.g);
    textView.setTextSize(16.0f);
    textView.setTextColor(-1);
    layoutParams = new LinearLayout.LayoutParams(-2, -2);
    layoutParams.gravity = 16;
    layoutParams.setMargins(0, 0, a(context, 17.0f), 0);
    textView.setLayoutParams(layoutParams);
    linearLayout.addView(imageView);
    linearLayout.addView(textView);
    setContentView(linearLayout);
    setCancelable(false);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:38,代码来源:a.java

示例6: 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);
}
 
开发者ID:drakeet,项目名称:Floo,代码行数:27,代码来源:WebActivity.java

示例7: 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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:PhoenixHeader.java

示例8: translateX

import android.view.animation.Animation; //导入方法依赖的package包/类
public static void translateX(View view, int translateStartX,int translateEndX){
    Animation animation = new TranslateAnimation(translateStartX*view.getMeasuredWidth(), translateEndX*view.getMeasuredWidth(), 0, 0);
    animation.setDuration(500);
    animation.setRepeatCount(0);//动画的重复次数
    animation.setFillAfter(true);//设置为true,动画转化结束后被应用
    view.startAnimation(animation);//开始动画
}
 
开发者ID:lanyan520,项目名称:Idea-ijkplayer,代码行数:8,代码来源:TranslateAnimationHelper.java

示例9: 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();
}
 
开发者ID:feup-infolab,项目名称:labtablet,代码行数:30,代码来源:FormSolverActivity.java

示例10: 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);
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:9,代码来源:LinkDialog.java

示例11: 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);
}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:13,代码来源:RentalsSunDrawable.java

示例12: translateY

import android.view.animation.Animation; //导入方法依赖的package包/类
public static void translateY(View view,int translateStartY,int translateEndY){
    Animation animation = new TranslateAnimation(0, 0,translateStartY*view.getMeasuredHeight(),translateEndY*view.getMeasuredHeight());
    animation.setDuration(500);
    animation.setRepeatCount(0);//动画的重复次数
    animation.setFillAfter(true);//设置为true,动画转化结束后被应用
    view.startAnimation(animation);//开始动画
}
 
开发者ID:lanyan520,项目名称:Idea-ijkplayer,代码行数:8,代码来源:TranslateAnimationHelper.java

示例13: 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);
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:13,代码来源:TaurusHeader.java

示例14: animate

import android.view.animation.Animation; //导入方法依赖的package包/类
private void animate() {
    Animation rotation = AnimationUtils.loadAnimation(this, R.anim.rotate);
    rotation.setRepeatCount(Animation.INFINITE);
    img.startAnimation(rotation);
}
 
开发者ID:stuxo,项目名称:REDAndroid,代码行数:6,代码来源:InboxActivity.java

示例15: animate

import android.view.animation.Animation; //导入方法依赖的package包/类
private void animate() {
	Animation rotation = AnimationUtils.loadAnimation(this, R.anim.rotate);
	rotation.setRepeatCount(Animation.INFINITE);
	img.startAnimation(rotation);
}
 
开发者ID:stuxo,项目名称:REDAndroid,代码行数:6,代码来源:CategoryActivity.java


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