setFillEnabled()源码实例Demo

android.view.animation.ScaleAnimation#setFillEnabled()源码实例Demo

下面列出了android.view.animation.ScaleAnimation#setFillEnabled() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/**
 * 中间的View动画播放
 */
private void playCenter() {
    AnimationSet animationSet = new AnimationSet(false);
    ScaleAnimation scaleSmall = new ScaleAnimation(1.0f, 0.6f, 1.0f, 0.6f,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    ScaleAnimation scaleBig = new ScaleAnimation(1.0f, 5.0f/3, 1.0f, 5.0f/3,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    scaleBig.setDuration(2*1000);
    scaleBig.setInterpolator(interpolator);
    scaleSmall.setDuration(2*1000);
    scaleSmall.setStartOffset(2*1000);
    scaleSmall.setRepeatCount(-1);
    scaleSmall.setFillEnabled(true);
    scaleSmall.setFillAfter(true);
    scaleBig.setStartOffset(2*1000);
    scaleBig.setRepeatCount(-1);
    scaleBig.setFillEnabled(true);
    scaleBig.setFillAfter(true);
    scaleSmall.setInterpolator(interpolator);
    animationSet.addAnimation(scaleBig);
    animationSet.addAnimation(scaleSmall);
    center.startAnimation(animationSet);
}
 
源代码2 项目: glass_snippets   文件: HeadImageView.java
public void setScaleFactor(float factor) {
  if (getAnimation() != null && !getAnimation().hasEnded())
    getAnimation().cancel();
  
  if (factor < 1)
    factor=1;
  
  deactivate();
  
  ScaleAnimation a = new ScaleAnimation(mScaleFactor, factor, mScaleFactor, factor,
      Animation.RELATIVE_TO_SELF, .5F, Animation.RELATIVE_TO_SELF, .5F);

  a.setDuration(500);
  a.setFillAfter(true);
  a.setFillEnabled(true);
  setAnimation(a);

  mScaleFactor = factor;
  MAX_SCROLL_X = MAX_SCROLL_Y = null;
  
  activate();
}
 
源代码3 项目: star-zone-android   文件: AnimUtils.java
public static ScaleAnimation getScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY, pivotXType, pivotXValue, pivotYType, pivotYValue);
    scaleAnimation.setDuration(300L);
    scaleAnimation.setFillEnabled(true);
    scaleAnimation.setFillAfter(true);
    return scaleAnimation;
}
 
源代码4 项目: In77Camera   文件: EffectsButton.java
ScaleAnimation createUpAnim() {
    ScaleAnimation localScaleAnimation = new ScaleAnimation(1.2F, 1.0F, 1.2F, 1.0F, 1, 0.5F, 1, 0.5F);
    localScaleAnimation.setDuration(50L);
    localScaleAnimation.setFillEnabled(true);
    localScaleAnimation.setFillEnabled(false);
    localScaleAnimation.setFillAfter(true);
    return localScaleAnimation;
}
 
源代码5 项目: In77Camera   文件: EffectsButton.java
ScaleAnimation createDownAnim() {
    ScaleAnimation localScaleAnimation = new ScaleAnimation(1.0F, 1.2F, 1.0F, 1.2F, 1, 0.5F, 1, 0.5F);
    localScaleAnimation.setDuration(50L);
    localScaleAnimation.setFillEnabled(true);
    localScaleAnimation.setFillBefore(false);
    localScaleAnimation.setFillAfter(true);
    return localScaleAnimation;
}
 
源代码6 项目: Fatigue-Detection   文件: EffectsButton.java
ScaleAnimation createUpAnim() {
    ScaleAnimation localScaleAnimation = new ScaleAnimation(1.2F, 1.0F, 1.2F, 1.0F, 1, 0.5F, 1, 0.5F);
    localScaleAnimation.setDuration(50L);
    localScaleAnimation.setFillEnabled(true);
    localScaleAnimation.setFillEnabled(false);
    localScaleAnimation.setFillAfter(true);
    return localScaleAnimation;
}
 
源代码7 项目: Fatigue-Detection   文件: EffectsButton.java
ScaleAnimation createDownAnim() {
    ScaleAnimation localScaleAnimation = new ScaleAnimation(1.0F, 1.2F, 1.0F, 1.2F, 1, 0.5F, 1, 0.5F);
    localScaleAnimation.setDuration(50L);
    localScaleAnimation.setFillEnabled(true);
    localScaleAnimation.setFillBefore(false);
    localScaleAnimation.setFillAfter(true);
    return localScaleAnimation;
}
 
源代码8 项目: droidconat-2016   文件: Animations.java
public static void scale(View view, float ratioFrom, float ratioTo, long durationMillis) {
    ScaleAnimation anim = new ScaleAnimation(ratioFrom, ratioTo, ratioFrom, ratioTo, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    anim.setFillBefore(true);
    anim.setFillAfter(true);
    anim.setFillEnabled(true);
    anim.setDuration(durationMillis);
    anim.setInterpolator(new OvershootInterpolator());
    view.startAnimation(anim);
}
 
源代码9 项目: PocketMaps   文件: MapActions.java
/**
 * start button: control button handler FAB
 */

private void initControlBtnHandler() {
    final ScaleAnimation anim = new ScaleAnimation(0, 1, 0, 1);
    anim.setFillBefore(true);
    anim.setFillAfter(true);
    anim.setFillEnabled(true);
    anim.setDuration(300);
    anim.setInterpolator(new OvershootInterpolator());

    controlBtn.setOnClickListener(new View.OnClickListener() {
        @Override public void onClick(View v) {
            if (isMenuVisible()) {
                setMenuVisible(false);
                sideBarMenuVP.setVisibility(View.INVISIBLE);
                favourBtn.setVisibility(View.INVISIBLE);
                settingsBtn.setVisibility(View.INVISIBLE);
                controlBtn.setImageResource(R.drawable.ic_keyboard_arrow_up_white_24dp);
                controlBtn.startAnimation(anim);
            } else {
                setMenuVisible(true);
                sideBarMenuVP.setVisibility(View.VISIBLE);
                favourBtn.setVisibility(View.VISIBLE);
                settingsBtn.setVisibility(View.VISIBLE);
                controlBtn.setImageResource(R.drawable.ic_keyboard_arrow_down_white_24dp);
                controlBtn.startAnimation(anim);
            }
        }
    });
}
 
源代码10 项目: android-draggable-viewpager   文件: DragDropGrid.java
private void animateDragged() {

        ScaleAnimation scale = new ScaleAnimation(1f, 1.4f, 1f, 1.4f, displayWidth / 2, ROW_HEIGHT / 2);
        scale.setDuration(200);
        scale.setFillAfter(true);
        scale.setFillEnabled(true);

        if (aViewIsDragged()) {
            View draggedView = getDraggedView();
//			Log.e("animateDragged", ((TextView)draggedView.findViewWithTag("text")).getText().toString());

            draggedView.clearAnimation();
            draggedView.startAnimation(scale);
        }
    }
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。