当前位置: 首页>>代码示例>>Java>>正文


Java AnimatorListenerAdapter.onAnimationEnd方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:penghuanliang,项目名称:Rxjava2.0Demo,代码行数:19,代码来源:SmartRefreshLayout.java

示例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);
    }
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:26,代码来源:AnimHelper.java

示例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);
    }
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:27,代码来源:SmartRefreshLayout.java

示例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;
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:24,代码来源:SmartRefreshLayout.java

示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:30,代码来源:SmartRefreshLayout.java

示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:30,代码来源:SmartRefreshLayout.java

示例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);
    }
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:38,代码来源:SmartRefreshLayout.java


注:本文中的android.animation.AnimatorListenerAdapter.onAnimationEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。