本文整理匯總了Java中io.codetail.animation.SupportAnimator.addListener方法的典型用法代碼示例。如果您正苦於以下問題:Java SupportAnimator.addListener方法的具體用法?Java SupportAnimator.addListener怎麽用?Java SupportAnimator.addListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.codetail.animation.SupportAnimator
的用法示例。
在下文中一共展示了SupportAnimator.addListener方法的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: animateBg
import io.codetail.animation.SupportAnimator; //導入方法依賴的package包/類
public void animateBg() {
mImage.setVisibility(INVISIBLE);
int cx = mImage.getWidth();
int cy = mImage.getHeight();
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mImage, cx, cy, 0, Math.max(cx, cy));
animator.addListener(new SupportAnimator.SimpleAnimatorListener() {
@Override
public void onAnimationStart() {
super.onAnimationStart();
mImage.setVisibility(VISIBLE);
}
});
animator.setStartDelay(500);
animator.start();
}
示例3: quitWithAnimation
import io.codetail.animation.SupportAnimator; //導入方法依賴的package包/類
private void quitWithAnimation() {
SupportAnimator animator = revealTransition.reverse();
if (animator == null) {
super.onBackPressed();
return;
}
animator.setDuration(1000);
animator.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {}
@Override
public void onAnimationEnd() {
mainContentLayout.setVisibility(View.INVISIBLE);
finish();
}
@Override
public void onAnimationCancel() {}
@Override
public void onAnimationRepeat() {}
});
animator.start();
}
示例4: createReverseReveal
import io.codetail.animation.SupportAnimator; //導入方法依賴的package包/類
private void createReverseReveal() {
SupportAnimator reverseMenuAnimator = mMenuAnimator.reverse();
mMenuAnimator = null;
reverseMenuAnimator.setDuration(700);
reverseMenuAnimator.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {
translateFabToBottom();
}
@Override
public void onAnimationEnd() {
mMenu.setVisibility(View.GONE);
}
@Override
public void onAnimationCancel() {
}
@Override
public void onAnimationRepeat() {
}
});
reverseMenuAnimator.start();
}
示例5: 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();
}
示例6: 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();
}
示例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: 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();
}
示例9: 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();
}
示例10: 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();
}
示例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: 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();
}
示例13: 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;
}
示例14: 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();
}
示例15: expandPreLollipop
import io.codetail.animation.SupportAnimator; //導入方法依賴的package包/類
private void expandPreLollipop(int x, int y, float startRadius, float endRadius) {
SupportAnimator toolbarExpandAnim = io.codetail.animation.ViewAnimationUtils
.createCircularReveal(
mFabExpandLayout, x, y, startRadius, endRadius);
toolbarExpandAnim.setDuration(animationDuration);
toolbarExpandAnim.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {
mFabExpandLayout.setAlpha(1f);
}
@Override
public void onAnimationEnd() {
//mFab.setAlpha(1f);
expandAnimationEnd();
}
@Override
public void onAnimationCancel() {
}
@Override
public void onAnimationRepeat() {
}
});
toolbarExpandAnim.start();
}