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


Java Animation.setFillAfter方法代码示例

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


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

示例1: onFocusChange

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
public void onFocusChange(View v, boolean hasFocus) {

    int focus = 0;
    if (hasFocus) {
        focus = R.anim.enlarge;
    } else {
        focus = R.anim.decrease;
    }
    //如果有焦点就放大,没有焦点就缩小
    Animation mAnimation = AnimationUtils.loadAnimation(
            getActivity().getApplication(), focus);
    mAnimation.setBackgroundColor(Color.TRANSPARENT);
    mAnimation.setFillAfter(hasFocus);
    v.startAnimation(mAnimation);
    mAnimation.start();
    v.bringToFront();
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:19,代码来源:WoDouGameBaseFragment.java

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

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

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 底部视图 销毁
 */
private void bottomViewRemove(final ViewPattern bottomViewPattern,
                              final ViewPattern topViewPattern,
                              final Runnable endRunnable,
                              boolean isRemove,/*是否需要移除bottomViewPattern*/
                              final UIParam param) {
    if (bottomViewPattern == null) {
        return;
    }

    bottomViewPattern.isAnimToStart = false;

    if (bottomViewPattern.mView instanceof ILifecycle) {
        ((ILifecycle) bottomViewPattern.mView).onLifeViewHide();
    }

    if (topViewPattern.mIView.isDialog() && !isRemove) {
        //对话框弹出的时候, 底部IView 不执行周期
    } else {
        if (!RApplication.isLowDevice || param.mAnim) {
            final Animation animation = topViewPattern.mIView.loadOtherExitAnimation();
            if (animation != null) {
                animation.setFillAfter(false);
            }
            safeStartAnim(bottomViewPattern.mIView.getAnimView(), animation, endRunnable, true);
        } else {
            endRunnable.run();
        }
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:33,代码来源:UILayoutImpl.java

示例5: setActivityToolbarPosition

import android.view.animation.Animation; //导入方法依赖的package包/类
public static void setActivityToolbarPosition(int duration, Toolbar aMainToolbar, Toolbar aDecorativeToolbar, Activity aActivity, float fromToolbarPosition, float toToolbarPosition, float fromMainToolbarPosition, float toMainToolbarPosition) {
	duration = duration < 0 ? 0 : duration;

	float distanceToMoveY = toToolbarPosition - fromToolbarPosition;
	float DECORATIVE_TOOLBAR_HEIGHT = -1 * aActivity.getResources().getDimension(R.dimen.additional_toolbar_height);
	float toTranslationY = (distanceToMoveY < DECORATIVE_TOOLBAR_HEIGHT) ? DECORATIVE_TOOLBAR_HEIGHT : distanceToMoveY;

	// We want to make sure the toolbar is as close to the final position as possible without being visible.
	// This ensures that the animation is only running when the toolbar is visible to the user.
	if(aDecorativeToolbar.getY() < DECORATIVE_TOOLBAR_HEIGHT) {
		aDecorativeToolbar.setY(DECORATIVE_TOOLBAR_HEIGHT);
		toTranslationY = (DECORATIVE_TOOLBAR_HEIGHT - toToolbarPosition) * -1;
	}

	Animation moveToolbarAnimation = new TranslateAnimation(0, 0, 0, toTranslationY);
	moveToolbarAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
	moveToolbarAnimation.setDuration(duration);
	moveToolbarAnimation.setFillAfter(true);

	float toDeltaY = toMainToolbarPosition - fromMainToolbarPosition;
	Animation moveMainToolbarAnimation = new TranslateAnimation(0, 0, 0, toDeltaY);
	moveMainToolbarAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
	moveMainToolbarAnimation.setDuration(duration);
	moveMainToolbarAnimation.setFillAfter(true);

	aMainToolbar.setBackgroundColor(Service.getColorAttribute(R.attr.colorPrimary, R.color.primary, aActivity));
	aMainToolbar.startAnimation(moveMainToolbarAnimation);
	aDecorativeToolbar.startAnimation(moveToolbarAnimation);
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:30,代码来源:AnimationService.java

示例6: startAlphaRevealAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * For the Card Views
 */
public static AnimationSet startAlphaRevealAnimation(int delay, final View VIEW, boolean includeTransition) {
	final int ANIMATION_DURATION = 300;

	final Animation mAlphaAnimation = new AlphaAnimation(0f, 1f);
	mAlphaAnimation.setDuration(ANIMATION_DURATION);
	mAlphaAnimation.setFillAfter(true);

	final AnimationSet mRevealAnimations = new AnimationSet(true);
	mRevealAnimations.setInterpolator(new AccelerateDecelerateInterpolator());
	mRevealAnimations.addAnimation(mAlphaAnimation);
	mRevealAnimations.setFillAfter(true);

	if (includeTransition) {
		final Animation mTransitionAnimation = new TranslateAnimation(0, 0, VIEW.getHeight()/2, 0);
		mTransitionAnimation.setDuration(ANIMATION_DURATION);
		mTransitionAnimation.setFillAfter(false);

		mRevealAnimations.addAnimation(mTransitionAnimation);
	}

	new Handler().postDelayed(new Runnable() {
		@Override
		public void run() {
               if(VIEW != null)
			    VIEW.startAnimation(mRevealAnimations);
		}
	}, delay);

	return mRevealAnimations;
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:34,代码来源:AnimationService.java

示例7: showAndSetStreamCount

import android.view.animation.Animation; //导入方法依赖的package包/类
private void showAndSetStreamCount(int count) {
	mStreamsCountWrapper.setVisibility(View.VISIBLE);
	Animation alphaAnimation = new AlphaAnimation(0f, 1f);
	alphaAnimation.setDuration(240);
	alphaAnimation.setFillAfter(true);
	mStreamsCountWrapper.startAnimation(alphaAnimation);
	mStreamsCount.setText(Integer.toString(count));
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:9,代码来源:NavigationDrawerFragment.java

示例8: startProgress

import android.view.animation.Animation; //导入方法依赖的package包/类
public void startProgress() {
    actionButtonText.setVisibility(GONE);
    actionLoader.setVisibility(View.VISIBLE);
    Animation rotationAnim = android.view.animation.AnimationUtils.loadAnimation(getContext(),
            R.anim.rotate);
    rotationAnim.setFillAfter(true);
    actionLoader.startAnimation(rotationAnim);
}
 
开发者ID:hypertrack,项目名称:hypertrack-live-android,代码行数:9,代码来源:BottomButtonCard.java

示例9: 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:leobert-lan,项目名称:UiLib,代码行数:11,代码来源:RayLayout.java

示例10: OutToBottomAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
public OutToBottomAnimation(Context context, View animView, View nextView) {
    this.context = context;
    this.nextView = nextView;
    this.animView = animView;
    Animation animation = AnimationUtils.loadAnimation(context, R.anim.kf5_anim_out_to_bottom);
    animation.setAnimationListener(this);
    animation.setFillAfter(false);
    animView.startAnimation(animation);
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:10,代码来源:OutToBottomAnimation.java

示例11: onAnimationEnd

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
public void onAnimationEnd(Animation animation) {

    if (animView.isShown()) {
        animView.setVisibility(View.GONE);
    }
    if (!nextView.isShown()) {
        nextView.setVisibility(View.VISIBLE);
    }
    Animation nextAnimation = AnimationUtils.loadAnimation(context, R.anim.kf5_anim_in_from_bottom);
    nextAnimation.setFillAfter(true);
    nextView.startAnimation(nextAnimation);
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:14,代码来源:OutToBottomAnimation.java

示例12: showQueue

import android.view.animation.Animation; //导入方法依赖的package包/类
private void showQueue() {
    if (!isShown())
        setVisibility(VISIBLE);
    Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.kf5_anim_in_from_bottom);
    animation.setFillAfter(true);
    startAnimation(animation);
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:8,代码来源:QueueView.java

示例13: onCreate

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    Animation animation = AnimationUtils.loadAnimation(this, R.anim.anim_opacity);
    animation.setDuration(2000);
    animation.setFillAfter(true);
    findViewById(R.id.image_splash).setAnimation(animation);

    mHandler.sendEmptyMessageDelayed(TO_MAIN, DELAY_TIME);


}
 
开发者ID:Leavessilent,项目名称:QuanMinTV,代码行数:15,代码来源:SplashActivity.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: getDefaultScaleAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成自定义ScaleAnimation
 */
protected Animation getDefaultScaleAnimation() {
    Animation scaleAnimation = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    scaleAnimation.setDuration(300);
    scaleAnimation.setInterpolator(new AccelerateInterpolator());
    scaleAnimation.setFillEnabled(true);
    scaleAnimation.setFillAfter(true);
    return scaleAnimation;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:13,代码来源:BasePopupWindow.java


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