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


Java OvershootInterpolator類代碼示例

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


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

示例1: startShowContinueIconAnimations

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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;
}
 
開發者ID:SebastianRask,項目名稱:Pocket-Plays-for-Twitch,代碼行數:20,代碼來源:WelcomeActivity.java

示例2: startHideContinueIconAnimations

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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;
}
 
開發者ID:SebastianRask,項目名稱:Pocket-Plays-for-Twitch,代碼行數:20,代碼來源:WelcomeActivity.java

示例3: animateAddImpl

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
@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();
}
 
開發者ID:scwang90,項目名稱:SmartRefreshLayout,代碼行數:18,代碼來源:FlyRefreshStyleActivity.java

示例4: setData

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
@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();
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:27,代碼來源:DetailsFragment.java

示例5: onFocusChanged

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
@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();
}
 
開發者ID:paradoxie,項目名稱:DizzyPassword,代碼行數:17,代碼來源:PswInputView.java

示例6: showMenu

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
@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();
}
 
開發者ID:xzg8023,項目名稱:ArcLayout-master,代碼行數:17,代碼來源:DemoLikePathActivity.java

示例7: releaseView

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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();
}
 
開發者ID:RuanXiaoHui,項目名稱:PlainFly,代碼行數:22,代碼來源:SkyLayout.java

示例8: display

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:27,代碼來源:MicrophoneRecorderView.java

示例9: show

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
/**
 * 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();
    }
}
 
開發者ID:Emadoki,項目名稱:edslider,代碼行數:21,代碼來源:EdSliderView.java

示例10: loadThumbnailPhoto

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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() {
        }
      });
}
 
開發者ID:softonic,項目名稱:instamaterial,代碼行數:24,代碼來源:PublishActivity.java

示例11: addScaleAnimation

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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);
}
 
開發者ID:vpaliyX,項目名稱:Material-Motion,代碼行數:22,代碼來源:DotsFragment.java

示例12: performShowAnimation

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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;
                }
            });
}
 
開發者ID:NarendraSickarwar,項目名稱:FirebasePost,代碼行數:17,代碼來源:FeedContextMenuManager.java

示例13: AnimationTask

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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;
}
 
開發者ID:tranleduy2000,項目名稱:text_converter,代碼行數:23,代碼來源:FloatingView.java

示例14: init

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
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;
            }
        });
    }
 
開發者ID:zuoweitan,項目名稱:Hitalk,代碼行數:19,代碼來源:OverScrollLayout.java

示例15: setData

import android.view.animation.OvershootInterpolator; //導入依賴的package包/類
@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));
}
 
開發者ID:zhao-mingjian,項目名稱:qvod,代碼行數:18,代碼來源:HotMovieViewHolder.java


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