本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
}
示例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() {
}
});
}
示例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);
}
示例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;
}
});
}
示例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;
}
示例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;
}
});
}
示例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));
}