本文整理汇总了Java中android.view.View.setAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java View.setAnimation方法的具体用法?Java View.setAnimation怎么用?Java View.setAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setAnimation方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAdapterInsertAnimation
import android.view.View; //导入方法依赖的package包/类
public static void setAdapterInsertAnimation(final View aCard, int row, int height) {
final int ANIMATION_DURATION = 650;
final int BASE_DELAY = 50;
TranslateAnimation translationAnimation = new TranslateAnimation(0,0, height,0);
AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
final AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(translationAnimation);
animationSet.addAnimation(alphaAnimation);
animationSet.setInterpolator(new AccelerateDecelerateInterpolator());
animationSet.setFillAfter(true);
animationSet.setFillBefore(true);
animationSet.setDuration(ANIMATION_DURATION + row * BASE_DELAY);
aCard.setAnimation(animationSet);
}
示例2: wrap
import android.view.View; //导入方法依赖的package包/类
public static View10 wrap(View view) {
View10 proxy = PROXIES.get(view);
Animation animation = view.getAnimation();
if (proxy == null || proxy != animation && animation != null) {
proxy = new View10(view);
PROXIES.put(view, proxy);
} else if (animation == null) {
view.setAnimation(proxy);
}
return proxy;
}
示例3: animateSides
import android.view.View; //导入方法依赖的package包/类
/**
* Animating the sides of the row, For example animating the user profile image and the message date.
* */
private void animateSides(View view, boolean fromLeft, Animation.AnimationListener animationListener){
if (!isScrolling)
return;
if (fromLeft)
view.setAnimation(AnimationUtils.loadAnimation(mActivity, R.anim.expand_slide_form_left));
else view.setAnimation(AnimationUtils.loadAnimation(mActivity, R.anim.expand_slide_form_right));
view.getAnimation().setAnimationListener(animationListener);
view.animate();
}
示例4: animateContent
import android.view.View; //导入方法依赖的package包/类
/**
* Animating the center part of the row, For example the image in an image message or the text in text message.
* */
private void animateContent(View view, Animation.AnimationListener animationListener, boolean showFull){
if (!isScrolling)
return;
view.setAnimation(AnimationUtils.loadAnimation(mActivity, showFull ? R.anim.fade_in_expand : R.anim.fade_in_half_and_expand));
view.getAnimation().setAnimationListener(animationListener);
view.animate();
}
示例5: startAnim
import android.view.View; //导入方法依赖的package包/类
private void startAnim(View widget) {
int distance = widget.getHeight();
widget.setVisibility(0);
this.mFloatLayout.setVisibility(0);
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
alphaAnimation.setDuration(200);
alphaAnimation.setStartOffset(200);
this.mFloatLayout.setAnimation(alphaAnimation);
this.mAnimation = new TranslateAnimation(0.0f, 0.0f, (float) distance, 0.0f);
this.mAnimation.setDuration(200);
this.mAnimation.setStartOffset(200);
widget.setAnimation(this.mAnimation);
this.mAnimation.start();
alphaAnimation.start();
}
示例6: rotate
import android.view.View; //导入方法依赖的package包/类
public static void rotate(View v){
//创建旋转动画 对象 fromDegrees:旋转开始的角度 toDegrees:结束的角度
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
//设置动画的显示时间
rotateAnimation.setDuration(1000);
//设置动画重复播放几次
rotateAnimation.setRepeatCount(RotateAnimation.INFINITE);
//设置动画插值器
rotateAnimation.setInterpolator(new LinearInterpolator());
//设置动画重复播放的方式,翻转播放
rotateAnimation.setRepeatMode(Animation.RESTART);
//拿着imageview对象来运行动画效果
v.setAnimation(rotateAnimation);
}
示例7: AnimatorProxy
import android.view.View; //导入方法依赖的package包/类
private AnimatorProxy(View view) {
setDuration(0);
setFillAfter(true);
view.setAnimation(this);
this.mView = new WeakReference(view);
}
示例8: View10
import android.view.View; //导入方法依赖的package包/类
private View10(View view) {
setDuration(0);
setFillAfter(true);
view.setAnimation(this);
mView = new WeakReference<>(view);
}
示例9: AnimatorProxy
import android.view.View; //导入方法依赖的package包/类
private AnimatorProxy(View view) {
setDuration(0); //perform transformation immediately
setFillAfter(true); //persist transformation beyond duration
view.setAnimation(this);
mView = new WeakReference<View>(view);
}
示例10: bindItemAnimation
import android.view.View; //导入方法依赖的package包/类
private Animation bindItemAnimation(final View child, final boolean isClicked, final long duration) {
Animation animation = createItemDisapperAnimation(duration, isClicked);
child.setAnimation(animation);
return animation;
}
示例11: setFadeInAnimation
import android.view.View; //导入方法依赖的package包/类
public void setFadeInAnimation(View view){
Animation animation = new AlphaAnimation(0, 1);
animation.setDuration(500);
view.setAnimation(animation);
}
示例12: setFadeOutAnimation
import android.view.View; //导入方法依赖的package包/类
public void setFadeOutAnimation(View view){
Animation animation = new AlphaAnimation(1, 0);
animation.setDuration(500);
view.setAnimation(animation);
}
示例13: bindItemAnimation
import android.view.View; //导入方法依赖的package包/类
private Animation bindItemAnimation(final View child, final boolean isClicked, final long duration) {
Animation animation = createItemDisapperAnimation(duration, isClicked);
child.setAnimation(animation);
return animation;
}