当前位置: 首页>>代码示例>>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;未经允许,请勿转载。