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


Java View.setAnimation方法代码示例

本文整理汇总了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);
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:19,代码来源:AnimationService.java

示例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;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:12,代码来源:View10.java

示例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();
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:15,代码来源:ChatSDKMessagesListAdapter.java

示例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();
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:12,代码来源:ChatSDKMessagesListAdapter.java

示例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();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:16,代码来源:FeedBackAnimFragment.java

示例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);
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:15,代码来源:AnimationUtil.java

示例7: AnimatorProxy

import android.view.View; //导入方法依赖的package包/类
private AnimatorProxy(View view) {
    setDuration(0);
    setFillAfter(true);
    view.setAnimation(this);
    this.mView = new WeakReference(view);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:AnimatorProxy.java

示例8: View10

import android.view.View; //导入方法依赖的package包/类
private View10(View view) {
    setDuration(0);
    setFillAfter(true);
    view.setAnimation(this);
    mView = new WeakReference<>(view);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:7,代码来源:View10.java

示例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);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:7,代码来源:AnimatorProxy.java

示例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;
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:7,代码来源:ArcMenu.java

示例11: setFadeInAnimation

import android.view.View; //导入方法依赖的package包/类
public void setFadeInAnimation(View view){
    Animation animation = new AlphaAnimation(0, 1);
    animation.setDuration(500);
    view.setAnimation(animation);
}
 
开发者ID:pooi,项目名称:Nearby,代码行数:6,代码来源:BaseFragment.java

示例12: setFadeOutAnimation

import android.view.View; //导入方法依赖的package包/类
public void setFadeOutAnimation(View view){
    Animation animation = new AlphaAnimation(1, 0);
    animation.setDuration(500);
    view.setAnimation(animation);
}
 
开发者ID:pooi,项目名称:Nearby,代码行数:6,代码来源:BaseActivity.java

示例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;
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:7,代码来源:RayMenu.java


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