本文整理汇总了Java中android.animation.AnimatorListenerAdapter.onAnimationEnd方法的典型用法代码示例。如果您正苦于以下问题:Java AnimatorListenerAdapter.onAnimationEnd方法的具体用法?Java AnimatorListenerAdapter.onAnimationEnd怎么用?Java AnimatorListenerAdapter.onAnimationEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.AnimatorListenerAdapter
的用法示例。
在下文中一共展示了AnimatorListenerAdapter.onAnimationEnd方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStateLoding
import android.animation.AnimatorListenerAdapter; //导入方法依赖的package包/类
protected void setStateLoding() {
AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
setStateDirectLoding();
}
};
notifyStateChanged(RefreshState.LoadReleased);
ValueAnimator animator = animSpinner(-mFooterHeight);
if (mRefreshFooter != null) {
mRefreshFooter.onLoadmoreReleased(this, mFooterHeight, mFooterExtendHeight);
}
if (animator != null && animator == reboundAnimator) {
animator.addListener(listener);
} else {
listener.onAnimationEnd(null);
}
}
示例2: dismissDialog
import android.animation.AnimatorListenerAdapter; //导入方法依赖的package包/类
@UiThread public static void dismissDialog(@NonNull DialogFragment dialogFragment, int duration, AnimatorListenerAdapter listenerAdapter) {
Dialog dialog = dialogFragment.getDialog();
if (dialog != null) {
if (dialog.getWindow() != null) {
View view = dialog.getWindow().getDecorView();
if (view != null) {
int centerX = view.getWidth() / 2;
int centerY = view.getHeight() / 2;
float radius = (float) Math.sqrt(view.getWidth() * view.getWidth() / 4 + view.getHeight() * view.getHeight() / 4);
view.post(() -> {
if (ViewCompat.isAttachedToWindow(view)) {
Animator animator = ViewAnimationUtils.createCircularReveal(view, centerX, centerY, radius, 0);
animator.setDuration(duration);
animator.addListener(listenerAdapter);
animator.start();
} else {
listenerAdapter.onAnimationEnd(null);
}
});
}
}
} else {
listenerAdapter.onAnimationEnd(null);
}
}
示例3: setStateLoding
import android.animation.AnimatorListenerAdapter; //导入方法依赖的package包/类
protected void setStateLoding() {
AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
setStateDirectLoading();
}
};
notifyStateChanged(RefreshState.LoadReleased);
ValueAnimator animator = animSpinner(-mFooterHeight);
if (animator != null) {
animator.addListener(listener);
}
if (mRefreshFooter != null) {
//onLoadmoreReleased 的执行顺序定在 animSpinner 之后 onAnimationEnd 之前
// 这样 onLoadmoreReleased 内部 可以做出 对 前面 animSpinner 的覆盖 操作
mRefreshFooter.onLoadmoreReleased(this, mFooterHeight, mFooterExtendHeight);
}
if (mOnMultiPurposeListener != null) {
//同 mRefreshFooter.onLoadmoreReleased 一致
mOnMultiPurposeListener.onFooterReleased(mRefreshFooter, mFooterHeight, mFooterExtendHeight);
}
if (animator == null) {
//onAnimationEnd 会改变状态为 loading 必须在 onLoadmoreReleased 之后调用
listener.onAnimationEnd(null);
}
}
示例4: startTwoLevel
import android.animation.AnimatorListenerAdapter; //导入方法依赖的package包/类
@Override
public RefreshKernel startTwoLevel(boolean open) {
if (open) {
AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
SmartRefreshLayout.this.notifyStateChanged(RefreshState.TwoLevel);
}
};
ValueAnimator animator = SmartRefreshLayout.this.animSpinner(SmartRefreshLayout.this.getMeasuredHeight());
if (animator != null && animator == SmartRefreshLayout.this.reboundAnimator) {
animator.setDuration(SmartRefreshLayout.this.mFloorDuration);
animator.addListener(listener);
} else {
listener.onAnimationEnd(null);
}
} else {
if (animSpinner(0) == null) {
SmartRefreshLayout.this.notifyStateChanged(RefreshState.None);
}
}
return this;
}
示例5: setStateLoding
import android.animation.AnimatorListenerAdapter; //导入方法依赖的package包/类
protected void setStateLoding() {
AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mLastLoadingTime = currentTimeMillis();
notifyStateChanged(RefreshState.Loading);
if (mRefreshFooter != null) {
mRefreshFooter.onStartAnimator(SmartRefreshLayout.this, mFooterHeight, mFooterExtendHeight);
}
if (mLoadmoreListener != null) {
mLoadmoreListener.onLoadmore(SmartRefreshLayout.this);
}
if (mOnMultiPurposeListener != null) {
mOnMultiPurposeListener.onLoadmore(SmartRefreshLayout.this);
mOnMultiPurposeListener.onFooterStartAnimator(mRefreshFooter, mFooterHeight, mFooterExtendHeight);
}
}
};
notifyStateChanged(RefreshState.LoadReleased);
ValueAnimator animator = animSpinner(-mFooterHeight);
if (mRefreshFooter != null) {
mRefreshFooter.onLoadmoreReleased(this, mFooterHeight, mFooterExtendHeight);
}
if (animator != null && animator == reboundAnimator) {
animator.addListener(listener);
} else {
listener.onAnimationEnd(null);
}
}
示例6: setStateRefresing
import android.animation.AnimatorListenerAdapter; //导入方法依赖的package包/类
protected void setStateRefresing() {
AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mLastRefreshingTime = currentTimeMillis();
notifyStateChanged(RefreshState.Refreshing);
if (mRefreshListener != null) {
mRefreshListener.onRefresh(SmartRefreshLayout.this);
}
if (mRefreshHeader != null) {
mRefreshHeader.onStartAnimator(SmartRefreshLayout.this, mHeaderHeight, mHeaderExtendHeight);
}
if (mOnMultiPurposeListener != null) {
mOnMultiPurposeListener.onRefresh(SmartRefreshLayout.this);
mOnMultiPurposeListener.onHeaderStartAnimator(mRefreshHeader, mHeaderHeight, mHeaderExtendHeight);
}
}
};
notifyStateChanged(RefreshState.RefreshReleased);
ValueAnimator animator = animSpinner(mHeaderHeight);
if (mRefreshHeader != null) {
mRefreshHeader.onRefreshReleased(this, mHeaderHeight, mHeaderExtendHeight);
}
if (animator != null && animator == reboundAnimator) {
animator.addListener(listener);
} else {
listener.onAnimationEnd(null);
}
}
示例7: setStateRefreshing
import android.animation.AnimatorListenerAdapter; //导入方法依赖的package包/类
protected void setStateRefreshing() {
AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mLastRefreshingTime = currentTimeMillis();
notifyStateChanged(RefreshState.Refreshing);
if (mRefreshListener != null) {
mRefreshListener.onRefresh(SmartRefreshLayout.this);
}
if (mRefreshHeader != null) {
mRefreshHeader.onStartAnimator(SmartRefreshLayout.this, mHeaderHeight, mHeaderExtendHeight);
}
if (mOnMultiPurposeListener != null) {
mOnMultiPurposeListener.onRefresh(SmartRefreshLayout.this);
mOnMultiPurposeListener.onHeaderStartAnimator(mRefreshHeader, mHeaderHeight, mHeaderExtendHeight);
}
}
};
notifyStateChanged(RefreshState.RefreshReleased);
ValueAnimator animator = animSpinner(mHeaderHeight);
if (animator != null) {
animator.addListener(listener);
}
if (mRefreshHeader != null) {
//onRefreshReleased 的执行顺序定在 animSpinner 之后 onAnimationEnd 之前
// 这样 onRefreshReleased内部 可以做出 对 前面 animSpinner 的覆盖 操作
mRefreshHeader.onRefreshReleased(this, mHeaderHeight, mHeaderExtendHeight);
}
if (mOnMultiPurposeListener != null) {
//同 mRefreshHeader.onRefreshReleased 一致
mOnMultiPurposeListener.onHeaderReleased(mRefreshHeader, mHeaderHeight, mHeaderExtendHeight);
}
if (animator == null) {
//onAnimationEnd 会改变状态为 Refreshing 必须在 onRefreshReleased 之后调用
listener.onAnimationEnd(null);
}
}