當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。