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


Java Animation.setStartOffset方法代码示例

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


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

示例1: generateLineLTRAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private Animation generateLineLTRAnimation(final RectF rectF, long offset) {

		final float currentLeft = rectF.left;
		final float currentRight = rectF.right;

		Animation animation = new Animation() {
			@Override
			protected void applyTransformation(float interpolatedTime, Transformation t) {
				super.applyTransformation(interpolatedTime, t);
				if (getCurrentState() == HBButtonState.NORMAL) {
					rectF.set(rectF.left, rectF.top, currentRight - (currentRight - currentLeft) / 2 * interpolatedTime, rectF.bottom);
				} else {
					rectF.set(rectF.left, rectF.top, currentRight + (currentRight - currentLeft) * interpolatedTime, rectF.bottom);
				}
				invalidate();
			}
		};
		animation.setDuration(getAnimationDuration());
		animation.setStartOffset(offset);
		return animation;
	}
 
开发者ID:LongDinhF,项目名称:Hamburger-Button,代码行数:22,代码来源:HBButton.java

示例2: generateLineRTLAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private Animation generateLineRTLAnimation(final RectF rectF, long offset) {

		final float currentLeft = rectF.left;
		final float currentRight = rectF.right;

		Animation animation = new Animation() {
			@Override
			protected void applyTransformation(float interpolatedTime, Transformation t) {
				super.applyTransformation(interpolatedTime, t);
				if (getCurrentState() == HBButtonState.NORMAL) {
					rectF.set(currentLeft + (currentRight - currentLeft) / 2 * interpolatedTime, rectF.top, rectF.right, rectF.bottom);
				} else {
					rectF.set(currentLeft - (currentRight - currentLeft) * interpolatedTime, rectF.top, rectF.right, rectF.bottom);
				}
				invalidate();
			}
		};
		animation.setDuration(getAnimationDuration());
		animation.setStartOffset(offset);
		return animation;
	}
 
开发者ID:LongDinhF,项目名称:Hamburger-Button,代码行数:22,代码来源:HBButton.java

示例3: createShrinkAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
                                               long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);

    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);

    animationSet.addAnimation(rotateAnimation);

    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);

    animationSet.addAnimation(translateAnimation);

    return animationSet;
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:26,代码来源:ArcLayout.java

示例4: initAnimations

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * Initializes all animations needed to show / hide views.
 */
private void initAnimations() {
  Context context = getContext();
  rerouteSlideDownTop = AnimationUtils.loadAnimation(context, R.anim.slide_down_top);
  rerouteSlideUpTop = AnimationUtils.loadAnimation(context, R.anim.slide_up_top);

  Animation fadeIn = new AlphaAnimation(0, 1);
  fadeIn.setInterpolator(new DecelerateInterpolator());
  fadeIn.setDuration(300);

  Animation fadeOut = new AlphaAnimation(1, 0);
  fadeOut.setInterpolator(new AccelerateInterpolator());
  fadeOut.setStartOffset(1000);
  fadeOut.setDuration(1000);

  fadeInSlowOut = new AnimationSet(false);
  fadeInSlowOut.addAnimation(fadeIn);
  fadeInSlowOut.addAnimation(fadeOut);
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:22,代码来源:InstructionView.java

示例5: onClick

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (disabledClick)
        return;

    super.onClick(v);
    Animation fadeOut = new AlphaAnimation(1.0f, 0.0f);
    fadeOut.setAnimationListener(this);
    fadeOut.setDuration(500);
    fadeOut.setStartOffset(0);
    Animation fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setAnimationListener(this);
    fadeIn.setDuration(500);
    fadeIn.setStartOffset(250);
    if (this.config == true) {
        this.leftKeyPressState.startAnimation(fadeOut);
        this.rightKeyPressState.startAnimation(fadeOut);
        this.reedState.startAnimation(fadeOut);
    } else {
        this.leftKeyPressState.startAnimation(fadeIn);
        this.rightKeyPressState.startAnimation(fadeIn);
        this.reedState.startAnimation(fadeIn);
    }
}
 
开发者ID:KunYi,项目名称:SensorTag2Testing,代码行数:25,代码来源:SimpleKeyTabRow.java

示例6: createAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * Create an animation object to be used to animate the view, based on the animation config
 * supplied at initialization time and the new view position and size.
 *
 * @param view the view to create the animation for
 * @param x the new X position for the view
 * @param y the new Y position for the view
 * @param width the new width value for the view
 * @param height the new height value for the view
 */
 public final @Nullable Animation createAnimation(
     View view,
     int x,
     int y,
     int width,
     int height) {
  if (!isValid()) {
    return null;
  }
  Animation animation = createAnimationImpl(view, x, y, width, height);
  if (animation != null) {
    int slowdownFactor = SLOWDOWN_ANIMATION_MODE ? 10 : 1;
    animation.setDuration(mDurationMs * slowdownFactor);
    animation.setStartOffset(mDelayMs * slowdownFactor);
    animation.setInterpolator(mInterpolator);
  }
  return animation;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:29,代码来源:AbstractLayoutAnimation.java

示例7: createShrinkAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
        long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);

    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);

    animationSet.addAnimation(rotateAnimation);

    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);

    animationSet.addAnimation(translateAnimation);

    return animationSet;
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:26,代码来源:ArcLayout.java

示例8: createShrinkAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
		long startOffset, long duration, Interpolator interpolator) {
	AnimationSet animationSet = new AnimationSet(false);
	animationSet.setFillAfter(true);

	final long preDuration = duration / 2;
	Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
			Animation.RELATIVE_TO_SELF, 0.5f);
	rotateAnimation.setStartOffset(startOffset);
	rotateAnimation.setDuration(preDuration);
	rotateAnimation.setInterpolator(new LinearInterpolator());
	rotateAnimation.setFillAfter(true);

	animationSet.addAnimation(rotateAnimation);

	Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
	translateAnimation.setStartOffset(startOffset + preDuration);
	translateAnimation.setDuration(duration - preDuration);
	translateAnimation.setInterpolator(interpolator);
	translateAnimation.setFillAfter(true);

	animationSet.addAnimation(translateAnimation);

	return animationSet;
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:26,代码来源:RayLayout.java

示例9: bindHolder

import android.view.animation.Animation; //导入方法依赖的package包/类
public void bindHolder(String result, int position) {
    mTextView.setText(result);
    Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_item);
    animation.setStartOffset(position * 200);
    animation.setInterpolator(new AccelerateInterpolator());
    itemView.startAnimation(animation);
}
 
开发者ID:InnoFang,项目名称:Android-Code-Demos,代码行数:8,代码来源:ResultAdapter.java

示例10: onClick

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (disabledClick)
        return;

    this.config = !this.config;
    Log.d("onClick", "Row ID" + v.getId());
    //Toast.makeText(this.context, "Found row with title : " + this.title.getText(), Toast.LENGTH_SHORT).show();
    Animation fadeOut = new AlphaAnimation(1.0f, 0.0f);
    fadeOut.setAnimationListener(this);
    fadeOut.setDuration(500);
    fadeOut.setStartOffset(0);
    Animation fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setAnimationListener(this);
    fadeIn.setDuration(500);
    fadeIn.setStartOffset(250);
    if (this.config == true) {
        this.sl1.startAnimation(fadeOut);
        if ((this.sl2.isEnabled())) this.sl2.startAnimation(fadeOut);
        if ((this.sl3.isEnabled())) this.sl3.startAnimation(fadeOut);
        this.value.startAnimation(fadeOut);
        this.onOffLegend.startAnimation(fadeIn);
        this.onOff.startAnimation(fadeIn);
        this.periodLegend.startAnimation(fadeIn);
        this.periodBar.startAnimation(fadeIn);
    } else {
        this.sl1.startAnimation(fadeIn);
        if ((this.sl2.isEnabled())) this.sl2.startAnimation(fadeIn);
        if ((this.sl3.isEnabled())) this.sl3.startAnimation(fadeIn);
        this.value.startAnimation(fadeIn);
        this.onOffLegend.startAnimation(fadeOut);
        this.onOff.startAnimation(fadeOut);
        this.periodLegend.startAnimation(fadeOut);
        this.periodBar.startAnimation(fadeOut);
    }
}
 
开发者ID:KunYi,项目名称:SensorTag2Testing,代码行数:37,代码来源:GenericTabRow.java

示例11: createHintSwitchAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createHintSwitchAnimation(final boolean expanded) {
    Animation animation = new RotateAnimation(expanded ? 45 : 0, expanded ? 0 : 45, Animation.RELATIVE_TO_SELF,
            0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setStartOffset(0);
    animation.setDuration(100);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setFillAfter(true);

    return animation;
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:11,代码来源:ArcMenu.java

示例12: createExpandAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 展开动画
 */
private static Animation createExpandAnimation(float fromXDelta,
                                               float toXDelta, float fromYDelta, float toYDelta, long startOffset,
                                               long duration, Interpolator interpolator) {
    Animation animation = new RotateAndTranslateAnimation(0, toXDelta, 0,
            toYDelta, 0, 720);
    animation.setStartOffset(startOffset);
    animation.setDuration(duration);
    animation.setInterpolator(interpolator);
    animation.setFillAfter(true);

    return animation;
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:16,代码来源:ArcLayout.java

示例13: startTickAnim

import android.view.animation.Animation; //导入方法依赖的package包/类
public void startTickAnim () {
    // hide tick
    mLeftRectWidth = 0;
    mRightRectWidth = 0;
    invalidate();
    Animation tickAnim = new Animation() {
        @Override
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            super.applyTransformation(interpolatedTime, t);
            if (0.54 < interpolatedTime && 0.7 >= interpolatedTime) {  // grow left and right rect to right
                mLeftRectGrowMode = true;
                mLeftRectWidth = mMaxLeftRectWidth * ((interpolatedTime - 0.54f) / 0.16f);
                if (0.65 < interpolatedTime) {
                    mRightRectWidth = MAX_RIGHT_RECT_W * ((interpolatedTime - 0.65f) / 0.19f);
                }
                invalidate();
            } else if (0.7 < interpolatedTime && 0.84 >= interpolatedTime) { // shorten left rect from right, still grow right rect
                mLeftRectGrowMode = false;
                mLeftRectWidth = mMaxLeftRectWidth * (1 - ((interpolatedTime - 0.7f) / 0.14f));
                mLeftRectWidth = mLeftRectWidth < MIN_LEFT_RECT_W ? MIN_LEFT_RECT_W : mLeftRectWidth;
                mRightRectWidth = MAX_RIGHT_RECT_W * ((interpolatedTime - 0.65f) / 0.19f);
                invalidate();
            } else if (0.84 < interpolatedTime && 1 >= interpolatedTime) { // restore left rect width, shorten right rect to const
                mLeftRectGrowMode = false;
                mLeftRectWidth = MIN_LEFT_RECT_W + (CONST_LEFT_RECT_W - MIN_LEFT_RECT_W) * ((interpolatedTime - 0.84f) / 0.16f);
                mRightRectWidth = CONST_RIGHT_RECT_W + (MAX_RIGHT_RECT_W - CONST_RIGHT_RECT_W) * (1 - ((interpolatedTime - 0.84f) / 0.16f));
                invalidate();
            }
        }
    };
    tickAnim.setDuration(750);
    tickAnim.setStartOffset(100);
    startAnimation(tickAnim);
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:35,代码来源:SuccessTickView.java

示例14: createHintSwitchAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createHintSwitchAnimation(final boolean expanded) {
	Animation animation = new RotateAnimation(expanded ? 45 : 0, expanded ? 0 : 45, Animation.RELATIVE_TO_SELF,
			0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
	animation.setStartOffset(0);
	animation.setDuration(100);
	animation.setInterpolator(new DecelerateInterpolator());
	animation.setFillAfter(true);

	return animation;
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:11,代码来源:RayMenu.java

示例15: createExpandAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createExpandAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
        long startOffset, long duration, Interpolator interpolator) {
    Animation animation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 0, 720);
    animation.setStartOffset(startOffset);
    animation.setDuration(duration);
    animation.setInterpolator(interpolator);
    animation.setFillAfter(true);

    return animation;
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:11,代码来源:ArcLayout.java


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