java类android.view.animation.OvershootInterpolator的实例源码

WelcomeActivity.java 文件源码 项目:Pocket-Plays-for-Twitch 阅读 41 收藏 0 点赞 0 评论 0
private AnimationSet startHideContinueIconAnimations() {
    Animation mScaleAnimation = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    Animation mRotateAnimation = new RotateAnimation(
                0, 360,
                Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f
    );
    mRotateAnimation.setRepeatCount(0);

    AnimationSet mAnimations = new AnimationSet(true);
    mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
    mAnimations.setFillAfter(true);
    mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
    mAnimations.addAnimation(mScaleAnimation);
    mAnimations.addAnimation(mRotateAnimation);

    mContinueIcon.startAnimation(mAnimations);
    return mAnimations;
}
FlyRefreshStyleActivity.java 文件源码 项目:SmartRefreshLayout 阅读 35 收藏 0 点赞 0 评论 0
@Override
protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
    View target = holder.itemView;
    View icon = target.findViewById(R.id.icon);
    Animator swing = ObjectAnimator.ofFloat(icon, "rotationX", 45, 0);
    swing.setInterpolator(new OvershootInterpolator(5));

    View right = holder.itemView.findViewById(R.id.right);
    Animator rotateIn = ObjectAnimator.ofFloat(right, "rotationY", 90, 0);
    rotateIn.setInterpolator(new DecelerateInterpolator());

    AnimatorSet animator = new AnimatorSet();
    animator.setDuration(getAddDuration());
    animator.playTogether(swing, rotateIn);

    animator.start();
}
DetailsFragment.java 文件源码 项目:GitHub 阅读 34 收藏 0 点赞 0 评论 0
@Override public void setData(Mail data) {
  this.mail = data;

  senderImageView.setImageResource(data.getSender().getImageRes());
  senderNameView.setText(data.getSender().getName());
  senderMailView.setText(data.getSender().getEmail());
  subjectView.setText(data.getSubject());
  contentView.setText(data.getText() + data.getText() + data.getText() + data.getText());
  starView.setStarred(data.isStarred());
  dateView.setText(format.format(data.getDate()));
  labelView.setMail(data);
  labelView.setVisibility(View.VISIBLE);
  replayView.setVisibility(View.VISIBLE);

  // Animate only if not restoring
  if (!isRestoringViewState()) {
    labelView.setAlpha(0f);
    labelView.animate().alpha(1f).setDuration(150).start();

    PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("scaleX", 0, 1);
    PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("scaleY", 0, 1);
    ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(replayView, holderX, holderY);
    animator.setInterpolator(new OvershootInterpolator());
    animator.start();
  }
}
FlyRefreshStyleActivity.java 文件源码 项目:GitHub 阅读 31 收藏 0 点赞 0 评论 0
@Override
protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
    View target = holder.itemView;
    View icon = target.findViewById(R.id.icon);
    Animator swing = ObjectAnimator.ofFloat(icon, "rotationX", 45, 0);
    swing.setInterpolator(new OvershootInterpolator(5));

    View right = holder.itemView.findViewById(R.id.right);
    Animator rotateIn = ObjectAnimator.ofFloat(right, "rotationY", 90, 0);
    rotateIn.setInterpolator(new DecelerateInterpolator());

    AnimatorSet animator = new AnimatorSet();
    animator.setDuration(getAddDuration());
    animator.playTogether(swing, rotateIn);

    animator.start();
}
DetailsFragment.java 文件源码 项目:GitHub 阅读 27 收藏 0 点赞 0 评论 0
@Override public void setData(Mail data) {
  this.mail = data;

  senderImageView.setImageResource(data.getSender().getImageRes());
  senderNameView.setText(data.getSender().getName());
  senderMailView.setText(data.getSender().getEmail());
  subjectView.setText(data.getSubject());
  contentView.setText(data.getText() + data.getText() + data.getText() + data.getText());
  starView.setStarred(data.isStarred());
  dateView.setText(format.format(data.getDate()));
  labelView.setMail(data);
  labelView.setVisibility(View.VISIBLE);
  replayView.setVisibility(View.VISIBLE);

  // Animate only if not restoring
  if (!isRestoringViewState()) {
    labelView.setAlpha(0f);
    labelView.animate().alpha(1f).setDuration(150).start();

    PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("scaleX", 0, 1);
    PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("scaleY", 0, 1);
    ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(replayView, holderX, holderY);
    animator.setInterpolator(new OvershootInterpolator());
    animator.start();
  }
}
PswInputView.java 文件源码 项目:DizzyPassword 阅读 37 收藏 0 点赞 0 评论 0
@Override
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
    super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
    if (mFocusAnim != null) {
        mFocusAnim.end();
    }
    if (gainFocus) {
        mFocusAnim = ObjectAnimator.ofFloat(this, "FocusLine", mFocusLineLength, (float) (getWidth() - 2 * mRoundRadius));
        input.showSoftInput(this, InputMethodManager.SHOW_FORCED);
    } else {
        mFocusAnim = ObjectAnimator.ofFloat(this, "FocusLine", mFocusLineLength, 0);
        input.hideSoftInputFromInputMethod(this.getWindowToken(), 0);
    }
    mFocusAnim.setDuration(1000).setInterpolator(new OvershootInterpolator());
    mFocusAnim.start();
}
DemoLikePathActivity.java 文件源码 项目:ArcLayout-master 阅读 29 收藏 0 点赞 0 评论 0
@SuppressWarnings("NewApi")
private void showMenu() {
  menuLayout.setVisibility(View.VISIBLE);

  List<Animator> animList = new ArrayList<>();

  for (int i = 0, len = arcLayout.getChildCount(); i < len; i++) {
    animList.add(createShowItemAnimator(arcLayout.getChildAt(i)));
  }

  AnimatorSet animSet = new AnimatorSet();
  animSet.setDuration(400);
  animSet.setInterpolator(new OvershootInterpolator());
  animSet.playTogether(animList);
  animSet.start();
}
SkyLayout.java 文件源码 项目:PlainFly 阅读 32 收藏 0 点赞 0 评论 0
public void releaseView() {
    if (mAnimator==null){
        final ValueAnimator valAnimator=ValueAnimator.ofFloat(mPercent,0f);
        valAnimator.setDuration(500);
        valAnimator.setInterpolator(new OvershootInterpolator());
        valAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {

               float animValue= (float) valAnimator.getAnimatedValue();
                setPercent(animValue);

            }
        });
        this.mAnimator=valAnimator;
    }else {
        mAnimator.cancel();
        mAnimator.setFloatValues(mPercent,0f);
    }
    mAnimator.start();
}
MicrophoneRecorderView.java 文件源码 项目:PeSanKita-android 阅读 37 收藏 0 点赞 0 评论 0
public void display(float x) {
  this.startPositionX = x;
  this.lastPositionX  = x;

  recordButtonFab.setVisibility(View.VISIBLE);

  float translation = ViewCompat.getLayoutDirection(recordButtonFab) ==
      ViewCompat.LAYOUT_DIRECTION_LTR ? -.25f : .25f;

  AnimationSet animation = new AnimationSet(true);
  animation.addAnimation(new TranslateAnimation(Animation.RELATIVE_TO_SELF, translation,
                                                Animation.RELATIVE_TO_SELF, translation,
                                                Animation.RELATIVE_TO_SELF, -.25f,
                                                Animation.RELATIVE_TO_SELF, -.25f));

  animation.addAnimation(new ScaleAnimation(.5f, 1f, .5f, 1f,
                                            Animation.RELATIVE_TO_SELF, .5f,
                                            Animation.RELATIVE_TO_SELF, .5f));

  animation.setFillBefore(true);
  animation.setFillAfter(true);
  animation.setDuration(ANIMATION_DURATION);
  animation.setInterpolator(new OvershootInterpolator());

  recordButtonFab.startAnimation(animation);
}
EdSliderView.java 文件源码 项目:edslider 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Animate the views too look more lively
 */
public void show()
{
    LinearLayout layout = (LinearLayout) getChildAt(0);
    layout.setScaleY(0);
    layout.animate().scaleY(1).setDuration(150).start();

    for (int i = 0; i < layout.getChildCount(); i++)
    {
        View v = layout.getChildAt(i);
        v.setScaleX(0);
        v.setScaleY(0);
        v.animate().scaleX(1).scaleY(1).setDuration(100)
                .setStartDelay((80 * i) + 150)
                .setInterpolator(new OvershootInterpolator())
                .start();
    }
}
PublishActivity.java 文件源码 项目:instamaterial 阅读 34 收藏 0 点赞 0 评论 0
private void loadThumbnailPhoto() {
  ivPhoto.setScaleX(0);
  ivPhoto.setScaleY(0);
  Picasso.with(this)
      .load(photoUri)
      .centerCrop()
      .resize(photoSize, photoSize)
      .into(ivPhoto, new Callback() {
        @Override
        public void onSuccess() {
          ivPhoto.animate()
              .scaleX(1.f).scaleY(1.f)
              .setInterpolator(new OvershootInterpolator())
              .setDuration(400)
              .setStartDelay(200)
              .start();
        }

        @Override
        public void onError() {
        }
      });
}
DotsFragment.java 文件源码 项目:Material-Motion 阅读 30 收藏 0 点赞 0 评论 0
private void addScaleAnimation(int startDelay, int duration, AnimatorSet set){
    final int start=!isFolded?1:0;
    final int end =~start & 0x1;
    AnimatorSet buttonSet=new AnimatorSet();
    for(int index=0;index<dots.size();index++){
        FloatingActionButton tempDot=dots.get(index);
        if(tempDot.getId()!=lastDot.getId()){
            ObjectAnimator scaleX=ObjectAnimator.ofFloat(tempDot,View.SCALE_X,start,end);
            ObjectAnimator scaleY=ObjectAnimator.ofFloat(tempDot,View.SCALE_Y,start,end);
            ObjectAnimator fade=ObjectAnimator.ofFloat(tempDot,View.ALPHA,start,end);
            scaleX.setStartDelay(startDelay);
            scaleY.setStartDelay(startDelay);
            scaleX.setInterpolator(new OvershootInterpolator(2));
            scaleY.setInterpolator(new OvershootInterpolator(2));
            fade.setStartDelay(startDelay);
            buttonSet.playTogether(scaleX,scaleY,fade);
        }
    }
    buttonSet.setDuration(duration);
    set.playTogether(buttonSet);
}
FeedContextMenuManager.java 文件源码 项目:FirebasePost 阅读 37 收藏 0 点赞 0 评论 0
private void performShowAnimation() {
    contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
    contextMenuView.setPivotY(contextMenuView.getHeight());
    contextMenuView.setScaleX(0.1f);
    contextMenuView.setScaleY(0.1f);
    contextMenuView.animate()
            .scaleX(1f).scaleY(1f)
            .setDuration(150)
            .setInterpolator(new OvershootInterpolator())
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    isContextMenuShowing = false;
                }
            });
}
FloatingView.java 文件源码 项目:text_converter 阅读 33 收藏 0 点赞 0 评论 0
AnimationTask() {
    if (mIsAnimationLocked)
        throw new RuntimeException("Returning to user's finger. Avoid animations while mIsAnimationLocked flag is set.");
    mDestX = calculateX();
    mDestY = calculateY();
    mDynamicUpdate = null;

    setAnimationFinishedListener(new AnimationFinishedListener() {
        @Override
        public void onAnimationFinished() {
            adjustInactivePosition();
        }
    });

    float velocityX = calculateVelocityX();
    float velocityY = calculateVelocityY();
    mTension += Math.sqrt(sqr(velocityX) + sqr(velocityY)) / 200;
    mInterpolator = new OvershootInterpolator(mTension);

    mCurrentPosX = mDestX;
    mCurrentPosY = mDestY;
}
OverScrollLayout.java 文件源码 项目:Hitalk 阅读 35 收藏 0 点赞 0 评论 0
private void init() {
        configuration = ViewConfiguration.get(getContext());
        mScroller = new Scroller(getContext(), new OvershootInterpolator(0.75f));
        flingRunnable = new FlingRunnable();
        overScrollRunnable = new OverScrollRunnable();
        flingScroller = new OverScroller(getContext());
        detector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
            @Override
            public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
                if (isOverScrollTop || isOverScrollBottom || isOverScrollLeft || isOverScrollRight) {
                    return false;
                }
//
                flingRunnable.start(velocityX, velocityY);
                return false;
            }
        });
    }
HotMovieViewHolder.java 文件源码 项目:qvod 阅读 28 收藏 0 点赞 0 评论 0
@Override
public void setData(HotMovieBean.SubjectsBean data) {
    super.setData(data);
    ImageLoader.load(data.getImages().getLarge(), ivRanking, 200);
    tvRankingTitle.setText(data.getTitle());
    tvDirectContent.setText(StringFormatUtil.formatName(data.getDirectors()));
    tvActorContent.setText(StringFormatUtil.formatName(data.getCasts(), true));
    tvTypeContent.setText(StringFormatUtil.formatGenres(data.getGenres()));
    tvScoreContent.setText(String.valueOf(data.getRating().getAverage()));
    //动画
    itemView.setScaleX(0.8f);
    itemView.setScaleY(0.8f);
    itemView.animate().scaleX(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();
    itemView.animate().scaleY(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();
    //
    itemView.setOnClickListener(view -> MovieDetailsActivity.startAction((Activity) getContext(), data, ivRanking));
}
ProfileAnimatedMenu.java 文件源码 项目:ModesoActionOverlay-Android 阅读 28 收藏 0 点赞 0 评论 0
/**
 * Animates the passed view as following :scale downed to 0 ,
 * reduced alpha to 0 and a 360 degree rotation if allowed
 * @param view the view to animate
 * @param delay delay before starting the animation
 */
void animateMenuItemClose(View view,long delay){
    ObjectAnimator animScaleX = ObjectAnimator.ofFloat(view,"scaleX",1.0f,0.2f);
    ObjectAnimator animScaleY = ObjectAnimator.ofFloat(view,"scaleY",1.0f,0.2f);
    ObjectAnimator animAlpha = ObjectAnimator.ofFloat(view,"alpha",ITEM_FINAL_ALPHA,0.0f);
    ObjectAnimator animRotation = ObjectAnimator.ofFloat(view,"rotation",360.0f,0);

    final int X_SCALE_ANIMATION_DURATION = 400;
    final int Y_SCALE_ANIMATION_DURATION = 400;
    final int ALPHA_ANIMATION_DURATION = 300;

    animScaleX.setDuration(X_SCALE_ANIMATION_DURATION);
    animScaleY.setDuration(Y_SCALE_ANIMATION_DURATION);
    animAlpha.setDuration(ALPHA_ANIMATION_DURATION);

    animRotation.setDuration(500);

    AnimatorSet animSet = new AnimatorSet();
    if(allowItemRotationAnim)
        animSet.playTogether(animScaleX,animScaleY,animAlpha,animRotation);
    else
        animSet.playTogether(animScaleX,animScaleY,animAlpha);
    animSet.setInterpolator(new OvershootInterpolator(2));
    animSet.setStartDelay(delay);
    animSet.start();
}
HazeType.java 文件源码 项目:FakeWeather 阅读 30 收藏 0 点赞 0 评论 0
@Override
public void startAnimation(final DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator1 = ValueAnimator.ofFloat(0, 1);
    animator1.setInterpolator(new OvershootInterpolator());
    animator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            speed = (float) animation.getAnimatedValue() * 32;
            rotate = (float) animation.getAnimatedValue();
        }
    });

    AnimatorSet animSet = new AnimatorSet();
    animSet.play(animator1);
    animSet.setDuration(1000);
    animSet.start();

}
HailType.java 文件源码 项目:FakeWeather 阅读 33 收藏 0 点赞 0 评论 0
@Override
public void startAnimation(DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator = ValueAnimator.ofFloat(-bitmap.getWidth() * 0.25f, getWidth() - bitmap.getWidth() * 0.25f);
    animator.setDuration(1000);
    animator.setRepeatCount(0);
    animator.setInterpolator(new OvershootInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            transFactor = (float) animation.getAnimatedValue();
        }
    });

    animator.start();
}
SnowType.java 文件源码 项目:FakeWeather 阅读 27 收藏 0 点赞 0 评论 0
@Override
public void startAnimation(DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator = ValueAnimator.ofFloat(-bitmap.getWidth() * 0.25f, getWidth() - bitmap.getWidth() * 0.25f);
    animator.setDuration(1000);
    animator.setRepeatCount(0);
    animator.setInterpolator(new OvershootInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            transFactor = (float) animation.getAnimatedValue();
        }
    });

    animator.start();
}
MultiSelectView.java 文件源码 项目:MultiSelecter 阅读 26 收藏 0 点赞 0 评论 0
private void animator(final View itemView, final Filter item, final FloatImgBean floatImg, int startX, int startY, int endX, int endY) {
    ObjectAnimator animatorX = ObjectAnimator.ofFloat(floatImg.mImageView, "translationX", startX - mStartX, endX - mStartX);
    ObjectAnimator animatorY = ObjectAnimator.ofFloat(floatImg.mImageView, "translationY", startY - mStartY, endY - mStartY);
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(animatorX, animatorY);
    animatorSet.setDuration(calcDuration(startX - endX, startY - endY));
    animatorSet.setInterpolator(new OvershootInterpolator(1.1f));
    animatorSet.start();
    animatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            floatImg.mImageView.setVisibility(View.GONE);
            floatImg.mIsAnimator = false;
            mIconListRvAdapter.add(item);
            mIconRecyclerView.smoothScrollToPosition(mIconListRvAdapter.getItemCount());
            mPlaceHolder.setVisibility(View.GONE);
            refreshLayout(false);
            itemView.setClickable(true);
        }
    });
}
BookResultsHeaderViewHolder.java 文件源码 项目:IslamicLibraryAndroid 阅读 30 收藏 0 点赞 0 评论 0
@Override
public void onExpansionToggled(boolean expanded) {
    super.onExpansionToggled(expanded);
    ObjectAnimator imageViewObjectAnimator;
    if (expanded) { // rotate clockwise
         imageViewObjectAnimator = ObjectAnimator.ofFloat(mArrowExpandImageView ,
                View.ROTATION, ROTATED_POSITION,INITIAL_POSITION);

    } else { // rotate counterclockwise
         imageViewObjectAnimator = ObjectAnimator.ofFloat(mArrowExpandImageView ,
                View.ROTATION,INITIAL_POSITION, ROTATED_POSITION);
    }

    imageViewObjectAnimator.setDuration(1000);
    imageViewObjectAnimator.setInterpolator(new OvershootInterpolator());
    imageViewObjectAnimator.start();
}
MainActivity.java 文件源码 项目:fastindex-master 阅读 25 收藏 0 点赞 0 评论 0
protected void showCurrentWord(String letter) {
        currentWord.setText(letter);
        if(!isScale){
            isScale = true;
            ViewPropertyAnimator.animate(currentWord).scaleX(1f)
                    .setInterpolator(new OvershootInterpolator())
                    .setDuration(450).start();
            ViewPropertyAnimator.animate(currentWord).scaleY(1f)
                    .setInterpolator(new OvershootInterpolator())
                    .setDuration(450).start();
        }

        //先移除之前的任务
        handler.removeCallbacksAndMessages(null);

        //延时隐藏currentWord
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
//              currentWord.setVisibility(View.INVISIBLE);
                ViewPropertyAnimator.animate(currentWord).scaleX(0f).setDuration(450).start();
                ViewPropertyAnimator.animate(currentWord).scaleY(0f).setDuration(450).start();
                isScale = false;
            }
        }, 1500);
    }
PublishActivity.java 文件源码 项目:FirebasePost 阅读 35 收藏 0 点赞 0 评论 0
private void loadThumbnailPhoto() {
    ivPhoto.setScaleX(0);
    ivPhoto.setScaleY(0);
    Picasso.with(this)
            .load(photoUri)
            .centerCrop()
            .resize(photoSize, photoSize)
            .into(ivPhoto, new Callback() {
                @Override
                public void onSuccess() {
                    ivPhoto.animate()
                            .scaleX(1.f).scaleY(1.f)
                            .setInterpolator(new OvershootInterpolator())
                            .setDuration(400)
                            .setStartDelay(200)
                            .start();
                }

                @Override
                public void onError() {

                    Toast.makeText(getApplicationContext(), "error", Toast.LENGTH_LONG).show();
                }
            });
}
TrashView.java 文件源码 项目:FLFloatingButton 阅读 25 收藏 0 点赞 0 评论 0
/**
 * アクションする削除アイコンの設定を更新します。
 *
 * @param width  対象となるViewの幅
 * @param height 対象となるViewの高さ
 * @param shape  対象となるViewの形状
 */
void updateActionTrashIcon(float width, float height, float shape) {
    // アクションする削除アイコンが設定されていない場合は何もしない
    if (!hasActionTrashIcon()) {
        return;
    }
    // 拡大率の設定
    mAnimationHandler.mTargetWidth = width;
    mAnimationHandler.mTargetHeight = height;
    final float newWidthScale = width / mActionTrashIconBaseWidth * shape;
    final float newHeightScale = height / mActionTrashIconBaseHeight * shape;
    mActionTrashIconMaxScale = Math.max(newWidthScale, newHeightScale);
    // ENTERアニメーション作成
    mEnterScaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mActionTrashIconView, PropertyValuesHolder.ofFloat(ImageView.SCALE_X, mActionTrashIconMaxScale), PropertyValuesHolder.ofFloat(ImageView.SCALE_Y, mActionTrashIconMaxScale));
    mEnterScaleAnimator.setInterpolator(new OvershootInterpolator());
    mEnterScaleAnimator.setDuration(TRASH_ICON_SCALE_DURATION_MILLIS);
    // Exitアニメーション作成
    mExitScaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mActionTrashIconView, PropertyValuesHolder.ofFloat(ImageView.SCALE_X, 1.0f), PropertyValuesHolder.ofFloat(ImageView.SCALE_Y, 1.0f));
    mExitScaleAnimator.setInterpolator(new OvershootInterpolator());
    mExitScaleAnimator.setDuration(TRASH_ICON_SCALE_DURATION_MILLIS);
}
ParallaxListView.java 文件源码 项目:CustomWeight 阅读 33 收藏 0 点赞 0 评论 0
@Override
public boolean onTouchEvent(MotionEvent ev) {
    if (ev.getAction() == MotionEvent.ACTION_UP) {
        // 恢复高度
        final ValueAnimator animator = ValueAnimator.ofInt(parallaxImageView.getHeight(), originalHeight);
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                Integer animateValue = (Integer) animator.getAnimatedValue();
                // 给 ImageView 设置值
                parallaxImageView.getLayoutParams().height = animateValue;
                parallaxImageView.requestLayout();
            }
        });
        animator.setInterpolator(new OvershootInterpolator()); // 弹性差值器
        animator.setDuration(450);
        animator.start();
    }
    return super.onTouchEvent(ev);
}
MicrophoneRecorderView.java 文件源码 项目:Cable-Android 阅读 28 收藏 0 点赞 0 评论 0
public void display(float x) {
  this.startPositionX = x;
  this.lastPositionX  = x;

  recordButtonFab.setVisibility(View.VISIBLE);

  float translation = ViewCompat.getLayoutDirection(recordButtonFab) ==
      ViewCompat.LAYOUT_DIRECTION_LTR ? -.25f : .25f;

  AnimationSet animation = new AnimationSet(true);
  animation.addAnimation(new TranslateAnimation(Animation.RELATIVE_TO_SELF, translation,
                                                Animation.RELATIVE_TO_SELF, translation,
                                                Animation.RELATIVE_TO_SELF, -.25f,
                                                Animation.RELATIVE_TO_SELF, -.25f));

  animation.addAnimation(new ScaleAnimation(.5f, 1f, .5f, 1f,
                                            Animation.RELATIVE_TO_SELF, .5f,
                                            Animation.RELATIVE_TO_SELF, .5f));

  animation.setFillBefore(true);
  animation.setFillAfter(true);
  animation.setDuration(ANIMATION_DURATION);
  animation.setInterpolator(new OvershootInterpolator());

  recordButtonFab.startAnimation(animation);
}
MainActivity.java 文件源码 项目:android-banklink 阅读 34 收藏 0 点赞 0 评论 0
private void animateResult(boolean success, @Nullable String extraMsg) {
  mainContainer.setVisibility(View.GONE);
  loadingContainer.setVisibility(View.GONE);
  resultContainer.setVisibility(View.VISIBLE);

  resultText.setText(success ? R.string.result_success : R.string.result_fail);
  resultExtraMsg.setText(extraMsg);

  resultContainer.setAlpha(0f);
  resultContainer.animate()
      .setDuration(100)
      .alpha(1f);

  resultIcon.setImageResource(success ? R.drawable.ic_check : R.drawable.ic_clear);
  resultIcon.setScaleX(0f);
  resultIcon.setScaleY(0f);
  resultIcon.animate()
      .scaleX(1f)
      .scaleY(1f)
      .setInterpolator(new OvershootInterpolator());
}
WelcomeActivity.java 文件源码 项目:Pocket-Plays-for-Twitch 阅读 32 收藏 0 点赞 0 评论 0
private AnimationSet startShowContinueIconAnimations() {
    Animation mScaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    Animation mRotateAnimation = new RotateAnimation(
                0, 360,
                Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f
    );
    mRotateAnimation.setRepeatCount(0);

    AnimationSet mAnimations = new AnimationSet(true);
    mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
    mAnimations.setFillAfter(true);
    mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
    mAnimations.addAnimation(mScaleAnimation);
    mAnimations.addAnimation(mRotateAnimation);

    mContinueIcon.startAnimation(mAnimations);
    return mAnimations;
}
ConfigView.java 文件源码 项目:bigjpg-app 阅读 38 收藏 0 点赞 0 评论 0
public void setChecked(boolean checked) {
    if (checked == isChecked()) {
        return;
    }

    if (checked) {
        viewDot.setScaleX(0);
        viewDot.setScaleY(0);
        viewDot.setVisibility(View.VISIBLE);
        viewDot.animate()
                .scaleX(1.0f)
                .scaleY(1.0f)
                .setInterpolator(new OvershootInterpolator())
                .start();
    } else {
        viewDot.setVisibility(View.GONE);
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号