本文整理匯總了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;
}