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