當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectAnimator.start方法代碼示例

本文整理匯總了Java中com.nineoldandroids.animation.ObjectAnimator.start方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectAnimator.start方法的具體用法?Java ObjectAnimator.start怎麽用?Java ObjectAnimator.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.nineoldandroids.animation.ObjectAnimator的用法示例。


在下文中一共展示了ObjectAnimator.start方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createAnimation

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    ValueAnimator scaleAnim=ValueAnimator.ofFloat(0.5f,1,0.5f);
    scaleAnim.setDuration(1000);
    scaleAnim.setRepeatCount(-1);
    scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            scaleFloat = (float) animation.getAnimatedValue();
            postInvalidate();
        }
    });
    scaleAnim.start();

    ObjectAnimator rotateAnim=ObjectAnimator.ofFloat(getTarget(),"rotation",0,180,360);
    rotateAnim.setDuration(1000);
    rotateAnim.setRepeatCount(-1);
    rotateAnim.start();

    animators.add(scaleAnim);
    animators.add(rotateAnim);
    return animators;
}
 
開發者ID:cowthan,項目名稱:AyoSunny,代碼行數:25,代碼來源:BallRotateIndicator.java

示例2: show

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
private void show(HeadsUp headsUp) {

        floatView = new FloatView(context, 20);
        WindowManager.LayoutParams params = FloatView.winParams;
        params.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
                | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_FULLSCREEN
                | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
        params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
        params.width = WindowManager.LayoutParams.MATCH_PARENT;
        params.height = WindowManager.LayoutParams.WRAP_CONTENT;
        params.format = -3;
        params.gravity = Gravity.CENTER | Gravity.TOP;
        params.x = floatView.originalLeft;
        params.y = 0;
        params.alpha = 1f;
        wmOne.addView(floatView, params);
        ObjectAnimator a = ObjectAnimator.ofFloat(floatView.rootView, "translationY", -700, 0);
        a.setDuration(600);
        a.start();
        floatView.setNotification(headsUp);
        if(headsUp.getNotification()!=null ){
            notificationManager.notify(headsUp.getCode(), headsUp.getNotification());
        }


    }
 
開發者ID:benchegnzhou,項目名稱:MeiZi_App,代碼行數:27,代碼來源:HeadsUpManager.java

示例3: dismissShowdown

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
/**
 * 隱藏模糊背景
 */
protected void dismissShowdown() {

    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 1, 0);
    objectAnimator.setDuration(400);
    objectAnimator.start();
    objectAnimator.addListener(new SimpleAnimationListener() {

        @Override
        public void onAnimationEnd(Animator animation) {

            mParentVG.removeView(mBg);
        }


    });
}
 
開發者ID:duguju,項目名稱:MousePaintYzz,代碼行數:20,代碼來源:Delegate.java

示例4: showShowdown

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
/**
 * 顯示模糊背景
 */
protected void showShowdown() {

    ViewHelper.setTranslationY(mRootView, 0);
    mEffect.effect(mParentVG,mBg);
    ViewGroup.LayoutParams lp =
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

    if(mBg.getParent()!= null){
        mParentVG.removeView(mBg);
    }

    mParentVG.addView(mBg, lp);
    ViewHelper.setAlpha(mBg, 0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 0, 1);
    objectAnimator.setDuration(400);
    objectAnimator.start();
}
 
開發者ID:duguju,項目名稱:MousePaintYzz,代碼行數:21,代碼來源:Delegate.java

示例5: animateCheck

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
public void animateCheck() {
	changeBackground();
	ObjectAnimator objectAnimator;
	if (iSchecked) {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xFin);

	} else {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xIni);
	}
	objectAnimator.setDuration(300);
	objectAnimator.start();
}
 
開發者ID:mityung,項目名稱:XERUNG,代碼行數:13,代碼來源:Switch.java

示例6: runEnterAnimation

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
/**
 * The enter animation scales the picture in from its previous thumbnail
 * size/location, colorizing it in parallel. In parallel, the background of the
 * activity is fading in. When the pictue is in place, the text description
 * drops down.
 */
private void runEnterAnimation() {
  final long duration = ANIM_DURATION;

  // Set starting values for properties we're going to animate. These
  // values scale and position the full size version down to the thumbnail
  // size/location, from which we'll animate it back up
  ViewHelper.setPivotX(mViewPager, 0);
  ViewHelper.setPivotY(mViewPager, 0);
  ViewHelper.setScaleX(mViewPager, (float) thumbnailWidth / mViewPager.getWidth());
  ViewHelper.setScaleY(mViewPager, (float) thumbnailHeight / mViewPager.getHeight());
  ViewHelper.setTranslationX(mViewPager, thumbnailLeft);
  ViewHelper.setTranslationY(mViewPager, thumbnailTop);

  // Animate scale and translation to go from thumbnail to full size
  ViewPropertyAnimator.animate(mViewPager)
      .setDuration(duration)
      .scaleX(1)
      .scaleY(1)
      .translationX(0)
      .translationY(0)
      .setInterpolator(new DecelerateInterpolator());

  // Fade in the black background
  ObjectAnimator bgAnim = ObjectAnimator.ofInt(mViewPager.getBackground(), "alpha", 0, 255);
  bgAnim.setDuration(duration);
  bgAnim.start();

  // Animate a color filter to take the image from grayscale to full color.
  // This happens in parallel with the image scaling and moving into place.
  ObjectAnimator colorizer = ObjectAnimator.ofFloat(ImagePagerFragment.this,
      "saturation", 0, 1);
  colorizer.setDuration(duration);
  colorizer.start();

}
 
開發者ID:zuoweitan,項目名稱:Hitalk,代碼行數:42,代碼來源:ImagePagerFragment.java

示例7: alphaDismiss

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
public void alphaDismiss(boolean isAnimation){
    if(isAnimation) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 1, 0);
        objectAnimator.setDuration(300);
        objectAnimator.start();
    }else{
        ViewHelper.setAlpha(this,0);
    }
}
 
開發者ID:duguju,項目名稱:MousePaintYzz,代碼行數:10,代碼來源:IndicatorView.java

示例8: runEnterAnimation

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
/**
 * The enter animation scales the picture in from its previous thumbnail
 * size/location, colorizing it in parallel. In parallel, the background of the
 * activity is fading in. When the pictue is in place, the text description
 * drops down.
 */
private void runEnterAnimation() {
    final long duration = ANIM_DURATION;

    // Set starting values for properties we're going to animate. These
    // values scale and position the full size version down to the thumbnail
    // size/location, from which we'll animate it back up
    ViewHelper.setPivotX(mViewPager, 0);
    ViewHelper.setPivotY(mViewPager, 0);
    ViewHelper.setScaleX(mViewPager, (float) thumbnailWidth / mViewPager.getWidth());
    ViewHelper.setScaleY(mViewPager, (float) thumbnailHeight / mViewPager.getHeight());
    ViewHelper.setTranslationX(mViewPager, thumbnailLeft);
    ViewHelper.setTranslationY(mViewPager, thumbnailTop);

    // Animate scale and translation to go from thumbnail to full size
    ViewPropertyAnimator.animate(mViewPager)
            .setDuration(duration)
            .scaleX(1)
            .scaleY(1)
            .translationX(0)
            .translationY(0)
            .setInterpolator(new DecelerateInterpolator());

    // Fade in the black background
    ObjectAnimator bgAnim = ObjectAnimator.ofInt(mViewPager.getBackground(), "alpha", 0, 255);
    bgAnim.setDuration(duration);
    bgAnim.start();

    // Animate a color filter to take the image from grayscale to full color.
    // This happens in parallel with the image scaling and moving into place.
    ObjectAnimator colorizer = ObjectAnimator.ofFloat(ImagePagerFragment.this,
            "saturation", 0, 1);
    colorizer.setDuration(duration);
    colorizer.start();

}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:42,代碼來源:ImagePagerFragment.java

示例9: animateCheck

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
public void animateCheck() {
	changeBackground();
	ObjectAnimator objectAnimator;
	if (eventCheck) {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xFin);

	} else {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xIni);
	}
	objectAnimator.setDuration(300);
	objectAnimator.start();
}
 
開發者ID:shegang,項目名稱:meishiDemo,代碼行數:13,代碼來源:Switch.java

示例10: onSelectChanged

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
@Override
public void onSelectChanged(View v,boolean selected) {
    float end = selected?180f:0f;
    ObjectAnimator flipAnimator = ObjectAnimator.ofFloat(v,"rotationY",end);
    flipAnimator.setDuration(400);
    flipAnimator.setInterpolator(new DecelerateInterpolator());
    flipAnimator.start();
}
 
開發者ID:peng8350,項目名稱:JPTabBar,代碼行數:9,代碼來源:FlipAnimater.java

示例11: startScale

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
public static void startScale(final View view, float fromScale, float toScale, long duration, long startDelay, Interpolator setInterpolator) {
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "scaleX", fromScale, toScale).setDuration(duration);
    objectAnimator.setStartDelay(startDelay);
    objectAnimator.setInterpolator(setInterpolator);
    objectAnimator.start();
    objectAnimator = ObjectAnimator.ofFloat(view, "scaleY", fromScale, toScale).setDuration(duration);
    objectAnimator.setStartDelay(startDelay);
    objectAnimator.setInterpolator(setInterpolator);
    objectAnimator.start();
}
 
開發者ID:arieshao,項目名稱:Integration,代碼行數:11,代碼來源:AnimUtil.java

示例12: hide

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
public void hide(){
	
	ObjectAnimator animator = ObjectAnimator.ofFloat(ButtonFloat.this, "y", hidePosition);
	animator.setInterpolator(new BounceInterpolator());
	animator.setDuration(1500);
	animator.start();
	
	isShow = false;
}
 
開發者ID:JianxunRao,項目名稱:FangYanShuo,代碼行數:10,代碼來源:ButtonFloat.java

示例13: createAnimation

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    PropertyValuesHolder rotation5=PropertyValuesHolder.ofFloat("rotationX",0,180,180,0,0);
    PropertyValuesHolder rotation6=PropertyValuesHolder.ofFloat("rotationY",0,0,180,180,0);
    ObjectAnimator animator=ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6,rotation5);
    animator.setInterpolator(new LinearInterpolator());
    animator.setRepeatCount(-1);
    animator.setDuration(2500);
    animator.start();
    animators.add(animator);
    return animators;
}
 
開發者ID:cowthan,項目名稱:AyoSunny,代碼行數:14,代碼來源:SquareSpinIndicator.java

示例14: showShowdown

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
/**
 * 顯示模糊背景
 */
protected void showShowdown() {

    ViewHelper.setTranslationY(mRootView, 0);
    mEffect.effect(mParentVG,mBg);
    ViewGroup.LayoutParams lp =
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    mParentVG.addView(mBg, lp);
    ViewHelper.setAlpha(mBg, 0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 0, 1);
    objectAnimator.setDuration(400);
    objectAnimator.start();
}
 
開發者ID:xiangyunwan,項目名稱:AndroidSweetSheet-master,代碼行數:16,代碼來源:Delegate.java

示例15: alphaShow

import com.nineoldandroids.animation.ObjectAnimator; //導入方法依賴的package包/類
public void alphaShow(boolean isAnimation){

        if(isAnimation) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 0, 1);
            objectAnimator.setDuration(300);
            objectAnimator.start();
        }else{
            ViewHelper.setAlpha(this,1);
        }
    }
 
開發者ID:xiangyunwan,項目名稱:AndroidSweetSheet-master,代碼行數:11,代碼來源:IndicatorView.java


注:本文中的com.nineoldandroids.animation.ObjectAnimator.start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。