當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。