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


Java ObjectAnimator.ofInt方法代码示例

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


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

示例1: slideTo

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void slideTo(int slideOffset, boolean forceInstant) {
  if (animator != null) {
    animator.cancel();
    animator = null;
  }

  if (!forceInstant) {
    animator = ObjectAnimator.ofInt(this, "slideOffset", this.slideOffset, slideOffset);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.setDuration(400);
    animator.start();
    ViewCompat.postInvalidateOnAnimation(this);
  } else {
    this.slideOffset = slideOffset;
    requestLayout();
    invalidate();
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:19,代码来源:QuickAttachmentDrawer.java

示例2: initData

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
protected void initData(Context context) {
    super.initData(context);

    // creating animators
    mDimSelectorWheelAnimator = ObjectAnimator.ofFloat(this, PROPERTY_SELECTOR_PAINT_COEFF, 1, 0);

    mDimSeparatorsAnimator = ObjectAnimator.ofInt(this, PROPERTY_SEPARATORS_PAINT_ALPHA,
            mSelectionDividerActiveAlpha, mSelectionDividerDimmedAlpha
    );

    // creating paints
    mSeparatorsPaint = new Paint();
    mSeparatorsPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
    mSeparatorsPaint.setAlpha(mSelectionDividerDimmedAlpha);

    mSelectorWheelPaint = new Paint();
    mSelectorWheelPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
}
 
开发者ID:vondear,项目名称:RxTools,代码行数:20,代码来源:AbstractWheelView.java

示例3: startErrorScrollingAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void startErrorScrollingAnimator() {

        int textWidth = Math.round(textPaint.measureText(error.toString()));
        if (errorLabelAnimator == null) {
            errorLabelAnimator = ObjectAnimator.ofInt(this, "errorLabelPosX", 0, (textWidth + getWidth() / 2));
            errorLabelAnimator.setStartDelay(1000);
            errorLabelAnimator.setInterpolator(new LinearInterpolator());
            errorLabelAnimator.setDuration(150 * error.length());
            errorLabelAnimator.addUpdateListener(this);
            errorLabelAnimator.setRepeatCount(ValueAnimator.INFINITE);
        } else {
            errorLabelAnimator.setIntValues(0, textWidth + getWidth() / 2);
        }
        errorLabelAnimator.start();
    }
 
开发者ID:hamsaadev,项目名称:RTLMaterialSpinner,代码行数:16,代码来源:RtlMaterialSpinner.java

示例4: startErrorScrollingAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void startErrorScrollingAnimator() {

        int textWidth = Math.round(textPaint.measureText(error.toString()));
        if (errorLabelAnimator == null) {
            errorLabelAnimator = ObjectAnimator.ofInt(this, "errorLabelPosX", 0, textWidth + getWidth() / 2);
            errorLabelAnimator.setStartDelay(1000);
            errorLabelAnimator.setInterpolator(new LinearInterpolator());
            errorLabelAnimator.setDuration(150 * error.length());
            errorLabelAnimator.addUpdateListener(this);
            errorLabelAnimator.setRepeatCount(ValueAnimator.INFINITE);
        } else {
            errorLabelAnimator.setIntValues(0, textWidth + getWidth() / 2);
        }
        errorLabelAnimator.start();
    }
 
开发者ID:mityung,项目名称:XERUNG,代码行数:16,代码来源:MaterialSpinner.java

示例5: 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

示例6: backgroundColor

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Background color animation builder.
 *
 * @param colors the colors
 * @return the animation builder
 */
public AnimationBuilder backgroundColor(int... colors) {
    for (View view : views) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "backgroundColor", colors);
        objectAnimator.setEvaluator(new ArgbEvaluator());
        this.animatorList.add(objectAnimator);
    }
    return this;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:15,代码来源:AnimationBuilder.java

示例7: textColor

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Text color animation builder.
 *
 * @param colors the colors
 * @return the animation builder
 */
public AnimationBuilder textColor(int... colors) {
    for (View view : views) {
        if (view instanceof TextView) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "textColor", colors);
            objectAnimator.setEvaluator(new ArgbEvaluator());
            this.animatorList.add(objectAnimator);
        }
    }
    return this;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:17,代码来源:AnimationBuilder.java

示例8: backgroundColor

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public AnimationBuilder backgroundColor(int... colors) {
    for (View view : this.views) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "backgroundColor", colors);
        objectAnimator.setEvaluator(new ArgbEvaluator());
        this.animatorList.add(objectAnimator);
    }
    return this;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:AnimationBuilder.java

示例9: textColor

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public AnimationBuilder textColor(int... colors) {
    for (View view : this.views) {
        if (view instanceof TextView) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "textColor", colors);
            objectAnimator.setEvaluator(new ArgbEvaluator());
            this.animatorList.add(objectAnimator);
        }
    }
    return this;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:AnimationBuilder.java

示例10: 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

示例11: reset

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void reset() {
    if (mObjectAnimator != null && mObjectAnimator.isRunning()) {
        return;
    }
    mObjectAnimator = ObjectAnimator.ofInt(this, "t", (int) -mDetalY / 5, 0);
    mObjectAnimator.setDuration(150);
    mObjectAnimator.start();
}
 
开发者ID:DIY-green,项目名称:AndroidStudyDemo,代码行数:9,代码来源:PullLayout.java

示例12: color

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
@NonNull
public Animator color(int from, int to, float duration, @Nullable Interpolator interpolator, boolean isText) {


    ObjectAnimator animator;


    if (mView instanceof TextView && isText) {

        TextView tv = (TextView) mView;

        tv.setTextColor(from);

        animator = ObjectAnimator.ofInt(mView, "textColor", from, to);
    } else {
        mView.setBackgroundColor(from);
        animator = ObjectAnimator.ofInt(mView, "backgroundColor", from, to);
    }

    setProperties(animator, duration, interpolator);


    animator.setEvaluator(new ArgbEvaluator());


    return animator;
}
 
开发者ID:canyinghao,项目名称:CanAnimation,代码行数:28,代码来源:CanObjectAnimator.java


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