本文整理汇总了Java中io.codetail.animation.SupportAnimator.setInterpolator方法的典型用法代码示例。如果您正苦于以下问题:Java SupportAnimator.setInterpolator方法的具体用法?Java SupportAnimator.setInterpolator怎么用?Java SupportAnimator.setInterpolator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.codetail.animation.SupportAnimator
的用法示例。
在下文中一共展示了SupportAnimator.setInterpolator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: revealOff
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
@Override
final void revealOff(final View fab, final View transformView, final RevealCallback callback) {
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
transformView,
getCenterX(fab),
getCenterY(fab),
(float) Math.hypot(transformView.getWidth(), transformView.getHeight()) / 2,
fab.getWidth() / 2);
animator.setInterpolator(REVEAL_INTERPOLATOR);
animator.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {
callback.onRevealStart();
}
@Override
public void onAnimationEnd() {
transformView.setVisibility(View.INVISIBLE);
callback.onRevealEnd();
}
@Override
public void onAnimationCancel() {
//
}
@Override
public void onAnimationRepeat() {
//
}
});
if (transformView.getVisibility() == View.VISIBLE) {
animator.setDuration((int) getRevealAnimationDuration());
animator.start();
transformView.setEnabled(true);
}
}
示例2: circularDismissView
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
private void circularDismissView(final View view) {
final int DURATION = 600;
// Get the center for the FAB
int cx = (int) view.getX() + view.getMeasuredHeight() / 2;
int cy = (int) view.getY() + view.getMeasuredWidth() / 2;
// get the final radius for the clipping circle
int dx = Math.max(cx, view.getWidth() - cx);
int dy = Math.max(cy, view.getHeight() - cy);
float finalRadius = (float) Math.hypot(dx, dy);
final SupportAnimator dismissAnimation = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius).reverse();
dismissAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
dismissAnimation.setDuration(DURATION);
dismissAnimation.start();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mSuperContainer.setVisibility(View.GONE);
}
}, DURATION);
}
示例3: appearRed
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
void appearRed() {
mRed.setVisibility(View.VISIBLE);
int cx = mRed.getWidth() / 2;
int cy = mRed.getHeight() / 2;
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mRed, cx, cy, 0, mRed.getWidth() / 2);
animator.addListener(new SimpleListener() {
@Override
public void onAnimationEnd() {
upRed();
}
});
animator.setInterpolator(ACCELERATE);
animator.start();
}
示例4: disappearBluePair
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
void disappearBluePair()
{
float finalRadius = Math.max(mBluePair.getWidth(), mBluePair.getHeight()) * 1.5f;
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mBluePair, endBlueX, endBlueY,
finalRadius, mBlue.getWidth() / 2f);
animator.setDuration(500);
animator.addListener(new SimpleListener()
{
@Override
public void onAnimationEnd()
{
mBluePair.setVisibility(View.INVISIBLE);
returnBlue();
}
});
animator.setInterpolator(DECELERATE);
animator.start();
}
示例5: disappearBluePair
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
void disappearBluePair() {
float finalRadius = Math.max(mBluePair.getWidth(), mBluePair.getHeight()) * 1.5f;
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mBluePair, endBlueX, endBlueY,
finalRadius, mBlue.getWidth() / 2f);
animator.setDuration(500);
animator.addListener(new SimpleListener() {
@Override
public void onAnimationEnd() {
mBluePair.setVisibility(View.INVISIBLE);
returnBlue();
}
});
animator.setInterpolator(DECELERATE);
animator.start();
}
示例6: appearRed
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
void appearRed()
{
mRed.setVisibility(View.VISIBLE);
int cx = mRed.getWidth() / 2;
int cy = mRed.getHeight() / 2;
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mRed, cx, cy, 0, mRed.getWidth() / 2);
animator.addListener(new SimpleListener()
{
@Override
public void onAnimationEnd()
{
upRed();
}
});
animator.setInterpolator(ACCELERATE);
animator.start();
}
示例7: disappearRed
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
void disappearRed()
{
int cx = mRed.getWidth() / 2;
int cy = mRed.getHeight() / 2;
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mRed, cx, cy, mRed.getWidth() / 2, 0);
animator.addListener(new SimpleListener()
{
@Override
public void onAnimationEnd()
{
mRed.setVisibility(View.INVISIBLE);
ViewHelper.setX(mRed, startRedX);
ViewHelper.setY(mRed, startRedY);
release();
}
});
animator.setInterpolator(DECELERATE);
animator.start();
}
示例8: appearBluePair
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
void appearBluePair() {
mBluePair.setVisibility(View.VISIBLE);
float finalRadius = Math.max(mBluePair.getWidth(), mBluePair.getHeight()) * 1.5f;
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mBluePair, endBlueX, endBlueY, mBlue.getWidth() / 2f,
finalRadius);
animator.setDuration(500);
animator.setInterpolator(ACCELERATE);
animator.addListener(new SimpleListener() {
@Override
public void onAnimationEnd() {
raise();
}
});
animator.start();
}
示例9: disappearRed
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
void disappearRed() {
int cx = mRed.getWidth() / 2;
int cy = mRed.getHeight() / 2;
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mRed, cx, cy, mRed.getWidth() / 2, 0);
animator.addListener(new SimpleListener() {
@Override
public void onAnimationEnd() {
mRed.setVisibility(View.INVISIBLE);
mRed.setX(startRedX);
mRed.setY(startRedY);
release();
}
});
animator.setInterpolator(DECELERATE);
animator.start();
}
示例10: replaceFragment
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
/**
* 切换item点击,CIrcularReveal视图效果
* @param screenShotable
* @param topPosition
* @return
*/
private ScreenShotable replaceFragment(ScreenShotable screenShotable, int topPosition) {
this.res = this.res == R.drawable.content_music ? R.drawable.content_films : R.drawable.content_music;
View view = findViewById(R.id.content_frame);
int finalRadius = Math.max(view.getWidth(), view.getHeight());
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius);
animator.setInterpolator(new AccelerateInterpolator());
animator.setDuration(ViewAnimator.CIRCULAR_REVEAL_ANIMATION_DURATION);
//设置背景!
findViewById(R.id.content_overlay).setBackgroundDrawable(new BitmapDrawable(getResources(), screenShotable.getBitmap()));
animator.start();
ContentFragment contentFragment = ContentFragment.newInstance(this.res);
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit();
return contentFragment;
}
示例11: revealOn
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
@Override
final void revealOn(final View fab, final View transformView, final RevealCallback callback) {
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
transformView,
getCenterX(fab),
getCenterY(fab),
fab.getWidth() / 2,
(float) Math.hypot(transformView.getWidth(), transformView.getHeight()) / 2);
transformView.setVisibility(View.VISIBLE);
animator.setInterpolator(FAB_INTERPOLATOR);
animator.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {
callback.onRevealStart();
}
@Override
public void onAnimationEnd() {
callback.onRevealEnd();
}
@Override
public void onAnimationCancel() {
//
}
@Override
public void onAnimationRepeat() {
//
}
});
if (transformView.getVisibility() == View.VISIBLE) {
animator.setDuration((int) getRevealAnimationDuration());
animator.start();
transformView.setEnabled(true);
}
}
示例12: replaceFragment
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
private ScreenShotable replaceFragment(ScreenShotable screenShotable, int topPosition) {
this.res = this.res == R.drawable.home_bg1 ? R.drawable.home_bg2 : R.drawable.home_bg1;
View view = findViewById(R.id.content_frame);
int finalRadius = Math.max(view.getWidth(), view.getHeight());
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius);
animator.setInterpolator(new AccelerateInterpolator());
animator.setDuration(ViewAnimator.CIRCULAR_REVEAL_ANIMATION_DURATION);
findViewById(R.id.content_overlay).setBackgroundDrawable(new BitmapDrawable(getResources(), screenShotable.getBitmap()));
animator.start();
MainContentFragment contentFragment = MainContentFragment.newInstance(this.res);
fragmentManager.beginTransaction().replace(R.id.content_frame, contentFragment).commit();
return contentFragment;
}
示例13: startReveal
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
private void startReveal(final RelativeLayout view, boolean reverse){
//Change statusbar color
if(!reverse) WindowUtil.changeStatusBarColor(LoginActivity.this, "#E91E63"); //Need to put string because resource link doesn't work
else WindowUtil.changeStatusBarColor(LoginActivity.this, "#1976D2");
// Get the center for the clipping circle
int cx = (view.getLeft() + view.getRight()) / 2;
int cy = view.getBottom() - 60;
// Get the final radius for the clipping circle
int dx = Math.max(cx, view.getWidth() - cx);
int dy = Math.max(cy, view.getHeight() - cy);
float finalRadius = (float) Math.hypot(dx, dy);
view.setVisibility(View.VISIBLE);
SupportAnimator animator =
ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.setDuration(500);
if(reverse) {
animator = animator.reverse();
animator.addListener(new SupportAnimator.AnimatorListener() {
@Override public void onAnimationEnd() { view.setVisibility(View.INVISIBLE); }
@Override public void onAnimationCancel() {}
@Override public void onAnimationRepeat() {}
@Override public void onAnimationStart() {}
});
}
animator.start();
}
示例14: revealFrom
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
public static SupportAnimator revealFrom(int x, int y, View target, int duration, final AnimationListener callback) {
int radius = Math.max(target.getWidth(), target.getHeight());
SupportAnimator animator2 = ViewAnimationUtils.createCircularReveal(target, x, y, 0, radius);
if (duration > 0)
animator2.setDuration(duration);
animator2.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {
}
@Override
public void onAnimationEnd() {
if (callback != null)
callback.onAnimEnd();
}
@Override
public void onAnimationCancel() {
}
@Override
public void onAnimationRepeat() {
}
});
animator2.setInterpolator(new AccelerateDecelerateInterpolator());
target.setVisibility(View.VISIBLE);
animator2.start();
return animator2;
}
示例15: collapseTo
import io.codetail.animation.SupportAnimator; //导入方法依赖的package包/类
public static void collapseTo(int x, int y, final View target, int duration, final AnimationListener callback) {
int radius = Math.max(target.getWidth(), target.getHeight());
SupportAnimator animator2 = ViewAnimationUtils.createCircularReveal(target, x, y, radius, 0);
if (duration > 0)
animator2.setDuration(duration);
target.setVisibility(View.VISIBLE);
animator2.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {
}
@Override
public void onAnimationEnd() {
target.setVisibility(View.GONE);
if (callback != null) callback.onAnimEnd();
}
@Override
public void onAnimationCancel() {
}
@Override
public void onAnimationRepeat() {
}
});
animator2.setInterpolator(new AccelerateDecelerateInterpolator());
animator2.start();
}