本文整理汇总了Java中android.view.animation.AnticipateOvershootInterpolator类的典型用法代码示例。如果您正苦于以下问题:Java AnticipateOvershootInterpolator类的具体用法?Java AnticipateOvershootInterpolator怎么用?Java AnticipateOvershootInterpolator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnticipateOvershootInterpolator类属于android.view.animation包,在下文中一共展示了AnticipateOvershootInterpolator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: animationThree
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
private void animationThree() {
controlByFloat.setVisibility(View.VISIBLE);
controlByNotify.setVisibility(View.VISIBLE);
triggerByFloat.setVisibility(View.VISIBLE);
confirmSetting.setVisibility(View.VISIBLE);
controlByFloat.setScaleX(0.5f);
controlByFloat.setScaleY(0.5f);
controlByNotify.setScaleX(0.5f);
controlByNotify.setScaleY(0.5f);
triggerByFloat.setScaleX(0.5f);
triggerByFloat.setScaleY(0.5f);
confirmSetting.setScaleX(0.5f);
confirmSetting.setScaleY(0.5f);
controlByFloat.animate().scaleX(1).scaleY(1).setDuration(500).setInterpolator(new AnticipateOvershootInterpolator()).start();
controlByNotify.animate().scaleX(1).scaleY(1).setDuration(500).setInterpolator(new AnticipateOvershootInterpolator()).start();
triggerByFloat.animate().scaleX(1).scaleY(1).setDuration(500).setInterpolator(new AnticipateOvershootInterpolator()).start();
confirmSetting.animate().scaleX(1).scaleY(1).setDuration(500).setInterpolator(new AnticipateOvershootInterpolator()).start();
}
示例2: initInterpolations
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
private void initInterpolations() {
ArrayList<Class> interpolatorList = new ArrayList<Class>() {{
add(FastOutSlowInInterpolator.class);
add(BounceInterpolator.class);
add(LinearInterpolator.class);
add(DecelerateInterpolator.class);
add(CycleInterpolator.class);
add(AnticipateInterpolator.class);
add(AccelerateDecelerateInterpolator.class);
add(AccelerateInterpolator.class);
add(AnticipateOvershootInterpolator.class);
add(FastOutLinearInInterpolator.class);
add(LinearOutSlowInInterpolator.class);
add(OvershootInterpolator.class);
}};
try {
interpolatorSelector = (Interpolator) interpolatorList.get(animateSelector).newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
示例3: makeFirstViewReset
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
/**
* 重置第一张卡片
*/
private void makeFirstViewReset() {
CardView firstSlideView = getFirstSlideView();
firstSlideView.resetRotateType();
float rotate = firstSlideView.getCardRotation();
int startX = firstSlideView.getScrollX();
int startY = firstSlideView.getScrollY();
ValueAnimator animator = ValueAnimator.ofFloat(1, 0);
animator.setTarget(firstSlideView);
animator.setDuration(ANIM_DURATION);
animator.setInterpolator(new AnticipateOvershootInterpolator());
animator.addUpdateListener((animation) -> {
float curRate = (float) animation.getAnimatedValue();
firstSlideView.scrollTo((int) (startX * curRate), (int) (startY * curRate));
firstSlideView.setReleaseRotation(curRate * rotate);
});
animator.start();
}
示例4: makeUnderViewReplace
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
/**
* 第一张卡片滑出时,剩余卡片上浮
* @param position
*/
private void makeUnderViewReplace(int position) {
CardView underSlideView = slideViewMap.get(position);
if (underSlideView != null) {
ValueAnimator animator = ValueAnimator.ofFloat(percent, 1);
animator.setTarget(underSlideView);
animator.setDuration(ANIM_DURATION);
animator.setInterpolator(new AnticipateOvershootInterpolator());
animator.addUpdateListener(animation -> {
float curPercent = (float) animation.getAnimatedValue();
makeUnderViewInvalidate(position, curPercent);
});
animator.start();
}
}
示例5: hideInitialCallToAction
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
private void hideInitialCallToAction() {
animatorFor(generateData, getAnimatorContext())
.withInterpolator(new AnticipateOvershootInterpolator())
.alpha(0f)
.scale(0f)
.addOnAnimationCompleted(new OnAnimationCompleted() {
@Override
public void onAnimationCompleted(boolean finished) {
if (finished) {
generateData.setVisibility(View.INVISIBLE);
generateData.setScaleX(1f);
generateData.setScaleY(1f);
generateData.setAlpha(1f);
}
}
})
.start();
}
示例6: showGenerateData
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
private void showGenerateData() {
animatorFor(generateData, getAnimatorContext())
.withInterpolator(new AnticipateOvershootInterpolator())
.addOnAnimationWillStart(new MultiAnimator.WillRunListener() {
@Override
public void onMultiAnimatorWillRun(@NonNull MultiAnimator animator) {
generateData.setAlpha(0f);
generateData.setScaleX(0f);
generateData.setScaleY(0f);
generateData.setVisibility(View.VISIBLE);
}
})
.alpha(1f)
.scale(1f)
.start();
}
示例7: fillResourceAttributes
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
public void fillResourceAttributes(AnticipateOvershootInterpolator interpolator, DOMElement domElement, AttrInterpolatorContext attrCtx)
{
XMLInflaterResource xmlInflaterInterpolator = attrCtx.getXMLInflaterResource();
XMLInflaterRegistry xmlInflaterRegistry = xmlInflaterInterpolator.getInflatedXMLResource().getXMLInflaterRegistry();
DOMAttr attrTension = domElement.getDOMAttribute(NamespaceUtil.XMLNS_ANDROID, "tension");
float tension = attrTension != null ? xmlInflaterRegistry.getFloat(attrTension.getResourceDesc(),attrCtx.getXMLInflaterContext()) : 2.0f;
DOMAttr attrExtraTension = domElement.getDOMAttribute(NamespaceUtil.XMLNS_ANDROID, "extraTension");
float extraTension = attrExtraTension != null ? xmlInflaterRegistry.getFloat(attrExtraTension.getResourceDesc(),attrCtx.getXMLInflaterContext()) : 1.5f;
float totalTension = tension * extraTension;
fieldMTension.set(interpolator,totalTension);
super.fillResourceAttributes(interpolator,domElement,attrCtx);
}
示例8: onCreate
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_animation);
ImageView view = new ImageView(this);
view.setBackgroundResource(R.drawable.custom_button_selector);
view.setScaleType(ImageView.ScaleType.CENTER);
mReachability = new Reachability(this);
mReachability.canTouchableBackView(true);
mReachability.setBackImageResource(R.drawable.tiles);
// Should call before makeHoverView!
mReachability.setHoverView(view, android.R.drawable.ic_partial_secure, android.R.drawable.ic_secure);
mReachability.makeHoverView(Reachability.Position.CENTER);
mReachability.setCustomSlideInAnimation(1000, new AnticipateOvershootInterpolator(), fromLeftAnimation());
mReachability.setCustomSlideOutAnimation(1000, new AnticipateOvershootInterpolator(), toRightAnimation());
findViewById(R.id.switch_hover).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mReachability.switchHover();
}
});
}
示例9: rockBounce
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
public static void rockBounce(final View theView) {
theView.animate()
.rotationXBy(30.0f)
.setDuration(200)
.setInterpolator(new AnticipateOvershootInterpolator())
.withEndAction(new Runnable() {
@Override
public void run() {
theView.animate()
.setDuration(100)
.rotationX(0)
.setInterpolator(new AnticipateOvershootInterpolator())
.start();
}
});
}
示例10: animateRemoveImpl
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
protected ViewPropertyAnimatorCompat animateRemoveImpl(ViewHolder holder) {
final View view = holder.itemView;
ViewCompat.animate(view).cancel();
return ViewCompat.animate(view)
.translationX(Utils.getScreenDimensions(holder.itemView.getContext()).x)
.setInterpolator(new AnticipateOvershootInterpolator());
}
示例11: hide
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
public void hide(float x) {
this.lastPositionX = x;
float offset = getOffset(x);
int widthAdjustment = getWidthAdjustment();
AnimationSet animation = new AnimationSet(false);
Animation scaleAnimation = new ScaleAnimation(1, 0.5f, 1, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
Animation translateAnimation = new TranslateAnimation(Animation.ABSOLUTE, offset + widthAdjustment,
Animation.ABSOLUTE, widthAdjustment,
Animation.RELATIVE_TO_SELF, -.25f,
Animation.RELATIVE_TO_SELF, -.25f);
scaleAnimation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
translateAnimation.setInterpolator(new DecelerateInterpolator());
animation.addAnimation(scaleAnimation);
animation.addAnimation(translateAnimation);
animation.setDuration(ANIMATION_DURATION);
animation.setFillBefore(true);
animation.setFillAfter(false);
animation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
recordButtonFab.setVisibility(View.GONE);
recordButtonFab.clearAnimation();
recordButtonFab.startAnimation(animation);
}
示例12: parse
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
public static Interpolator parse(Integer type, Float cycles) {
if (type != null) {
switch (type) {
case 0:
return new AccelerateDecelerateInterpolator();
case 1:
return new AccelerateInterpolator();
case 2:
return new AnticipateInterpolator();
case 3:
return new AnticipateOvershootInterpolator();
case 4:
return new BounceInterpolator();
case 5:
return new CycleInterpolator((cycles != null && cycles > 0) ? cycles : 1f);
case 6:
return new DecelerateInterpolator();
case 7:
return new LinearInterpolator();
case 8:
return new OvershootInterpolator();
//暂时不支持的
// case 7: return new FastOutLinearInterplator();
// case 8: return new FastOutSlowInInterplator();
// case 10: return new LinearOutSlowInInterplator();
// case 12: return new PathInterplator();
default:
return new LinearInterpolator();
}
} else {
return new LinearInterpolator();
}
}
示例13: createInterpolator
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
/**
* Creates interpolator.
*
* @param interpolatorType
* @return
*/
public static TimeInterpolator createInterpolator(@IntRange(from = 0, to = 10) final int interpolatorType) {
switch (interpolatorType) {
case ACCELERATE_DECELERATE_INTERPOLATOR:
return new AccelerateDecelerateInterpolator();
case ACCELERATE_INTERPOLATOR:
return new AccelerateInterpolator();
case ANTICIPATE_INTERPOLATOR:
return new AnticipateInterpolator();
case ANTICIPATE_OVERSHOOT_INTERPOLATOR:
return new AnticipateOvershootInterpolator();
case BOUNCE_INTERPOLATOR:
return new BounceInterpolator();
case DECELERATE_INTERPOLATOR:
return new DecelerateInterpolator();
case FAST_OUT_LINEAR_IN_INTERPOLATOR:
return new FastOutLinearInInterpolator();
case FAST_OUT_SLOW_IN_INTERPOLATOR:
return new FastOutSlowInInterpolator();
case LINEAR_INTERPOLATOR:
return new LinearInterpolator();
case LINEAR_OUT_SLOW_IN_INTERPOLATOR:
return new LinearOutSlowInInterpolator();
case OVERSHOOT_INTERPOLATOR:
return new OvershootInterpolator();
default:
return new LinearInterpolator();
}
}
示例14: setEffect
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
private static void setEffect(Animation animation, int interpolatorType, long durationMillis, long delayMillis) {
switch (interpolatorType) {
case 0:
animation.setInterpolator(new LinearInterpolator());
break;
case 1:
animation.setInterpolator(new AccelerateInterpolator());
break;
case 2:
animation.setInterpolator(new DecelerateInterpolator());
break;
case 3:
animation.setInterpolator(new AccelerateDecelerateInterpolator());
break;
case 4:
animation.setInterpolator(new BounceInterpolator());
break;
case 5:
animation.setInterpolator(new OvershootInterpolator());
break;
case 6:
animation.setInterpolator(new AnticipateInterpolator());
break;
case 7:
animation.setInterpolator(new AnticipateOvershootInterpolator());
break;
default:
break;
}
animation.setDuration(durationMillis);
animation.setStartOffset(delayMillis);
}
示例15: onTabChanged
import android.view.animation.AnticipateOvershootInterpolator; //导入依赖的package包/类
/**
* NavHelper处理后,回调的方法
* @param newTab 新的Tab
* @param oldTab 旧的Tab
*/
@Override
public void onTabChanged(NavHelper.Tab<Integer> newTab, NavHelper.Tab<Integer> oldTab) {
// 从额外字段中取出我们的Title资源Id
title.setText(newTab.extra);
// 对FloatButton进行隐藏和显示动画
float transY = 0;
float rotation = 0;
// 判断所处界面
if (Objects.equals(newTab.extra, R.string.title_home)) {
transY = Ui.dipToPx(getResources(), 76);
} else {
// 此时Y默认为0===显示fb
if (Objects.equals(newTab.extra, R.string.title_group)) {
floatbutton.setImageResource(R.drawable.ic_group_add);
rotation = -360;
} else {
// 联系人
floatbutton.setImageResource(R.drawable.ic_contact_add);
rotation = 360;
}
}
// 开始动画,旋转,Y轴惟一,弹性
floatbutton.animate()
.rotation(rotation)
.setInterpolator(new AnticipateOvershootInterpolator(1))
.translationY(transY)
.setDuration(480)
.start();
}