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


Java Animation.setFillEnabled方法代码示例

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


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

示例1: getScaleAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成ScaleAnimation
 *
 * time=300
 */
public static Animation getScaleAnimation(float fromX,
                                      float toX,
                                      float fromY,
                                      float toY,
                                      int pivotXType,
                                      float pivotXValue,
                                      int pivotYType,
                                      float pivotYValue) {
    Animation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY, pivotXType, pivotXValue, pivotYType,
                                                  pivotYValue
    );
    scaleAnimation.setDuration(300);
    scaleAnimation.setFillEnabled(true);
    scaleAnimation.setFillAfter(true);
    return scaleAnimation;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:SimpleAnimUtil.java

示例2: getTranslateAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成TranslateAnimation
 *
 * @param durationMillis 动画显示时间
 * @param start          初始位置
 */
public static Animation getTranslateAnimation(int start, int end, int durationMillis) {
    Animation translateAnimation = new TranslateAnimation(0, 0, start, end);
    translateAnimation.setDuration(durationMillis);
    translateAnimation.setFillEnabled(true);
    translateAnimation.setFillAfter(true);
    return translateAnimation;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:SimpleAnimUtil.java

示例3: getDefaultScaleAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成自定义ScaleAnimation
 */
public static 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:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:SimpleAnimUtil.java

示例4: getDefaultAlphaAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成默认的AlphaAnimation
 */
public static Animation getDefaultAlphaAnimation() {
    Animation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
    alphaAnimation.setDuration(300);
    alphaAnimation.setInterpolator(new AccelerateInterpolator());
    alphaAnimation.setFillEnabled(true);
    alphaAnimation.setFillAfter(true);
    return alphaAnimation;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:SimpleAnimUtil.java

示例5: getTranslateAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成TranslateAnimation
 *
 * @param durationMillis 动画显示时间
 * @param start 初始位置
 */
protected Animation getTranslateAnimation(int start, int end, int durationMillis) {
    Animation translateAnimation = new TranslateAnimation(0, 0, start, end);
    translateAnimation.setDuration(durationMillis);
    translateAnimation.setFillEnabled(true);
    translateAnimation.setFillAfter(true);
    return translateAnimation;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:14,代码来源:BasePopupWindow.java

示例6: getScaleAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成ScaleAnimation
 */
protected Animation getScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) {
    Animation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY, pivotXType, pivotXValue, pivotYType,
            pivotYValue);
    scaleAnimation.setDuration(300);
    scaleAnimation.setFillEnabled(true);
    scaleAnimation.setFillAfter(true);
    return scaleAnimation;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:12,代码来源:BasePopupWindow.java

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

示例8: getDefaultAlphaAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 生成默认的AlphaAnimation
 */
protected Animation getDefaultAlphaAnimation() {
    Animation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
    alphaAnimation.setDuration(300);
    alphaAnimation.setInterpolator(new AccelerateInterpolator());
    alphaAnimation.setFillEnabled(true);
    alphaAnimation.setFillAfter(true);
    return alphaAnimation;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:12,代码来源:BasePopupWindow.java

示例9: onClick

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.jelly:
            Animation scaleAnimation =
                    new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 0.5f,
                            Animation.RELATIVE_TO_SELF, 0.5f);
            scaleAnimation.setDuration(3000);
            scaleAnimation.setInterpolator(CustomInterpolatorFactory.getJellyInterpolator());
            scaleAnimation.setFillEnabled(true);
            scaleAnimation.setFillAfter(true);
            mInterpolatorPopup.setCustomAnimation(scaleAnimation);
            mInterpolatorPopup.showPopupWindow();
            break;
        case R.id.anti:
            Animation rotateAnima =
                    new RotateAnimation(0,360,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
            rotateAnima.setDuration(2500);
            rotateAnima.setInterpolator(CustomInterpolatorFactory.getAnticipateInterpolator());
            rotateAnima.setFillEnabled(true);
            rotateAnima.setFillAfter(true);
            mInterpolatorPopup.setCustomAnimation(rotateAnima);
            mInterpolatorPopup.showPopupWindow();
            break;
        case R.id.anti2:
            Animation rotateAnima2 =
                    new RotateAnimation(0,360,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
            rotateAnima2.setDuration(2500);
            rotateAnima2.setInterpolator(CustomInterpolatorFactory.getAnticipateOverShootInterpolator());
            rotateAnima2.setFillEnabled(true);
            rotateAnima2.setFillAfter(true);
            mInterpolatorPopup.setCustomAnimation(rotateAnima2);
            mInterpolatorPopup.showPopupWindow();
            break;
        case R.id.spring:
            Animation scaleAnimation2 =
                    new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 0.5f,
                            Animation.RELATIVE_TO_SELF, 0.5f);
            scaleAnimation2.setDuration(2500);
            scaleAnimation2.setInterpolator(CustomInterpolatorFactory.getSpringInterPolator());
            scaleAnimation2.setFillEnabled(true);
            scaleAnimation2.setFillAfter(true);
            mInterpolatorPopup.setCustomAnimation(scaleAnimation2);
            mInterpolatorPopup.showPopupWindow();
            break;
        case R.id.overshoot:
            Animation translateAnimation = new TranslateAnimation(0, 0, 250*2, 0);
            translateAnimation.setDuration(2500);
            translateAnimation.setFillEnabled(true);
            translateAnimation.setFillAfter(true);
            translateAnimation.setInterpolator(CustomInterpolatorFactory.getOverShootInterpolator());
            mInterpolatorPopup.setCustomAnimation(translateAnimation);
            mInterpolatorPopup.showPopupWindow();
            break;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:57,代码来源:CustomInterpolatorPopupFrag.java


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