當前位置: 首頁>>代碼示例>>Java>>正文


Java TranslateAnimation.setFillAfter方法代碼示例

本文整理匯總了Java中android.view.animation.TranslateAnimation.setFillAfter方法的典型用法代碼示例。如果您正苦於以下問題:Java TranslateAnimation.setFillAfter方法的具體用法?Java TranslateAnimation.setFillAfter怎麽用?Java TranslateAnimation.setFillAfter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.animation.TranslateAnimation的用法示例。


在下文中一共展示了TranslateAnimation.setFillAfter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: translateHeader

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
/**
 * Translates the adapter in Y
 *
 * @param of offset in px
 */
public void translateHeader(float of) {
    float ofCalculated = of * mScrollMultiplier;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && of < mHeader.getHeight()) {
        mHeader.setTranslationY(ofCalculated);
    } else if (of < mHeader.getHeight()) {
        TranslateAnimation anim = new TranslateAnimation(0, 0, ofCalculated, ofCalculated);
        anim.setFillAfter(true);
        anim.setDuration(0);
        mHeader.startAnimation(anim);
    }
    mHeader.setClipY(Math.round(ofCalculated));
    if (mParallaxScroll != null) {
        final RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(0);
        float left;
        if (holder != null) {
            left = Math.min(1, ((ofCalculated) / (mHeader.getHeight() * mScrollMultiplier)));
        }else {
            left = 1;
        }
        mParallaxScroll.onParallaxScroll(left, of, mHeader);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:28,代碼來源:UltimateRecyclerView.java

示例2: getStartAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
/**
 * 獲得入場動畫
 *
 * @return
 */
protected Animation getStartAnimation() {
    AlphaAnimation animAlpha = new AlphaAnimation(0, 1);
    animAlpha.setDuration(TIME_START_ANIM);
    animAlpha.setFillAfter(true);

    TranslateAnimation animTrans = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 1.5f,
            Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, 0f);
    animTrans.setDuration(TIME_START_ANIM);
    animTrans.setFillAfter(true);
    animTrans.setInterpolator(new DecelerateInterpolator());

    AnimationSet sets = new AnimationSet(true);
    sets.addAnimation(animAlpha);
    sets.addAnimation(animTrans);

    return sets;
}
 
開發者ID:jeasinlee,項目名稱:AndroidBasicLibs,代碼行數:25,代碼來源:DrawerToast.java

示例3: getEndAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
/**
 * 獲得離場動畫
 *
 * @return
 */
protected Animation getEndAnimation() {
    AlphaAnimation animAlpha = new AlphaAnimation(1, 0);
    animAlpha.setDuration(TIME_END_ANIM);
    animAlpha.setFillAfter(true);

    TranslateAnimation animTrans = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, -1.5f,
            Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, 0f);
    animTrans.setDuration(TIME_END_ANIM);
    animTrans.setFillAfter(true);
    animTrans.setInterpolator(new AccelerateInterpolator());

    AnimationSet sets = new AnimationSet(true);
    sets.addAnimation(animAlpha);
    sets.addAnimation(animTrans);

    return sets;
}
 
開發者ID:jeasinlee,項目名稱:AndroidBasicLibs,代碼行數:25,代碼來源:DrawerToast.java

示例4: createTranslationOutAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
private Animation createTranslationOutAnimation() {
    int type = TranslateAnimation.RELATIVE_TO_SELF;
    TranslateAnimation an = new TranslateAnimation(type, 0, type, 0, type, 0, type, 1);
    an.setDuration(TRANSLATE_DURATION);
    an.setFillAfter(true);
    return an;
}
 
開發者ID:quickhybrid,項目名稱:quickhybrid-android,代碼行數:8,代碼來源:ActionSheet.java

示例5: trans

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
private void trans(long dura, float frX, float toX) {
    TranslateAnimation animation = new TranslateAnimation(frX, toX, 0.0F, 0.0F);
    animation.setInterpolator(new LinearInterpolator());
    animation.setDuration(dura);
    animation.setFillAfter(true);
    vTrans.startAnimation(animation);
}
 
開發者ID:quickhybrid,項目名稱:quickhybrid-android,代碼行數:8,代碼來源:ActionBarSeg.java

示例6: setExitAnimRightMargin

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
@Override
public void setExitAnimRightMargin(float dp) {
    int rightmargin =UIUtils.dip2ipx(dp);
    mExitAnim = new TranslateAnimation(0, DEFAULT_WIDTH + rightmargin, 0, 0);
    mExitAnim.setFillAfter(true);
    mExitAnim.setDuration(DURATION_ENTER_EXIT);
    mExitAnim.setAnimationListener(this);
}
 
開發者ID:vip001,項目名稱:BubbleBar,代碼行數:9,代碼來源:BubbleBarView.java

示例7: animationAtEnd

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
private void animationAtEnd() {
    mGridName.setEnabled(false);
    TranslateAnimation animate = new TranslateAnimation(mEditButton.getWidth(), 0, 0, 0);
    animate.setDuration(500);
    animate.setFillAfter(true);
    mEditButton.startAnimation(animate);
    mEditButton.setVisibility(View.VISIBLE);
}
 
開發者ID:riteshakya037,項目名稱:Android-Scrapper,代碼行數:9,代碼來源:GridSettingFragment.java

示例8: animationAtStart

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
private void animationAtStart() {
    mGridName.setEnabled(true);
    TranslateAnimation animate = new TranslateAnimation(0, mEditButton.getWidth(), 0, 0);
    animate.setDuration(500);
    animate.setFillAfter(true);
    mEditButton.startAnimation(animate);
    mEditButton.setVisibility(View.GONE);
}
 
開發者ID:riteshakya037,項目名稱:Android-Scrapper,代碼行數:9,代碼來源:GridSettingFragment.java

示例9: getTranslateAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
/**
 * 位移 Translate
 */
public static Animation getTranslateAnimation(float fromXDelta,
                                              float toXDelta, float fromYDelta, float toYDelta,
                                              long durationMillis) {
    TranslateAnimation translate = new TranslateAnimation(fromXDelta,
            toXDelta, fromYDelta, toYDelta);
    translate.setDuration(durationMillis);
    translate.setFillAfter(true);
    return translate;
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:13,代碼來源:KJAnimations.java

示例10: getMoveAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
/**
 * 獲取移動的動畫
 */
public Animation getMoveAnimation(float toXValue, float toYValue) {
    TranslateAnimation mTranslateAnimation = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF, 0.0F,
            Animation.RELATIVE_TO_SELF, toXValue,
            Animation.RELATIVE_TO_SELF, 0.0F,
            Animation.RELATIVE_TO_SELF, toYValue);// 當前位置移動到指定位置
    mTranslateAnimation.setFillAfter(true);// 設置一個動畫效果執行完畢後,View對象保留在終止的位置。
    mTranslateAnimation.setDuration(300L);
    return mTranslateAnimation;
}
 
開發者ID:6ag,項目名稱:LiuAGeAndroid,代碼行數:14,代碼來源:DragGridView.java

示例11: createTranslationOutAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
private Animation createTranslationOutAnimation() {
    int type = TranslateAnimation.RELATIVE_TO_SELF;
    TranslateAnimation an = new TranslateAnimation(type, 0, type, 0, type,
            0, type, 1);
    an.setDuration(TRANSLATE_DURATION);
    an.setFillAfter(true);
    return an;
}
 
開發者ID:hh-in-zhuzhou,項目名稱:ShangHanLun,代碼行數:9,代碼來源:ActionSheet.java

示例12: startAlphaAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
public static void startAlphaAnimation(View v, int height, int visibility) {
    TranslateAnimation translateAnimation = (visibility == View.GONE)
            ? new TranslateAnimation(0, 0, 0, -height)
            : new TranslateAnimation(0, 0, 0, 0);

    translateAnimation.setDuration(ALPHA_ANIMATIONS_DURATION);
    translateAnimation.setFillAfter(true);
    v.startAnimation(translateAnimation);
}
 
開發者ID:yuhodev,項目名稱:login,代碼行數:10,代碼來源:RouteIndex.java

示例13: ApplyHorizontalScrollAnimation

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
private static void ApplyHorizontalScrollAnimation(View view, boolean left, int speed) {
  float sign = left ? 1f : -1f;
  AnimationSet animationSet = new AnimationSet(true);
  animationSet.setRepeatCount(Animation.INFINITE);
  animationSet.setRepeatMode(Animation.RESTART);

  TranslateAnimation move = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, sign * 0.70f,
      Animation.RELATIVE_TO_PARENT, sign * -0.70f, Animation.RELATIVE_TO_PARENT, 0,
      Animation.RELATIVE_TO_PARENT, 0);
  move.setStartOffset(0);
  move.setDuration(speed);
  move.setFillAfter(true);
  animationSet.addAnimation(move);
  view.startAnimation(animationSet);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:16,代碼來源:AnimationUtil.java

示例14: getTranslateAnimator

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
/**
 * 獲取位移動畫
 */
private TranslateAnimation getTranslateAnimator(float targetX, float targetY) {
    TranslateAnimation translateAnimation = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF, 0f,
            Animation.ABSOLUTE, targetX,
            Animation.RELATIVE_TO_SELF, 0f,
            Animation.ABSOLUTE, targetY);
    // RecyclerView默認移動動畫250ms 這裏設置360ms 是為了防止在位移動畫結束後 remove(view)過早 導致閃爍
    translateAnimation.setDuration(ANIM_TIME);
    translateAnimation.setFillAfter(true);
    return translateAnimation;
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:15,代碼來源:ChannelAdapter.java

示例15: getTranslateAnimator

import android.view.animation.TranslateAnimation; //導入方法依賴的package包/類
private TranslateAnimation getTranslateAnimator(float targetX, float targetY) {
    TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0f, 0, targetX, 1, 0.0f, 0, targetY);
    translateAnimation.setDuration(ANIM_TIME);
    translateAnimation.setFillAfter(true);
    return translateAnimation;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:7,代碼來源:ChannelFragmentAdapter.java


注:本文中的android.view.animation.TranslateAnimation.setFillAfter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。