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