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


Java PtrCLog.i方法代码示例

本文整理汇总了Java中in.srain.cube.views.ptr.util.PtrCLog.i方法的典型用法代码示例。如果您正苦于以下问题:Java PtrCLog.i方法的具体用法?Java PtrCLog.i怎么用?Java PtrCLog.i使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在in.srain.cube.views.ptr.util.PtrCLog的用法示例。


在下文中一共展示了PtrCLog.i方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: performRefresh

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void performRefresh() {
    mLoadingStartTime = System.currentTimeMillis();
    if (mPtrUIHandlerHolder.hasHandler()) {
        mPtrUIHandlerHolder.onUIRefreshBegin(this);
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshBegin");
        }
    }
    if (mPtrHandler != null) {
        if (mPtrIndicator.isHeader()) {
            mPtrHandler.onRefreshBegin(this);
        } else {
            if (mPtrHandler instanceof PtrHandler2) {
                ((PtrHandler2) mPtrHandler).onLoadMoreBegin(this);
            }
        }
    }
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:19,代码来源:PtrFrameLayout.java

示例2: refreshComplete

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
/**
 * Call this when data is loaded.
 * The UI will perform complete at once or after a delay, depends on the time elapsed is greater then {@link #mLoadingMinTime} or not.
 */
final public void refreshComplete() {
    if (DEBUG) {
        PtrCLog.i(LOG_TAG, "refreshComplete");
    }

    if (mRefreshCompleteHook != null) {
        mRefreshCompleteHook.reset();
    }

    int delay = (int) (mLoadingMinTime - (System.currentTimeMillis() - mLoadingStartTime));
    if (delay <= 0) {
        if (DEBUG) {
            PtrCLog.d(LOG_TAG, "performRefreshComplete at once");
        }
        performRefreshComplete();
    } else {
        postDelayed(mPerformRefreshCompleteDelay, delay);
        if (DEBUG) {
            PtrCLog.d(LOG_TAG, "performRefreshComplete after delay: %s", delay);
        }
    }
}
 
开发者ID:sathishmscict,项目名称:android-Ultra-Pull-To-Refresh,代码行数:27,代码来源:PtrFrameLayout.java

示例3: autoRefresh

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
public void autoRefresh(boolean atOnce, boolean isHeader) {

        if (mStatus != PTR_STATUS_INIT) {
            return;
        }

        mFlag |= atOnce ? FLAG_AUTO_REFRESH_AT_ONCE : FLAG_AUTO_REFRESH_BUT_LATER;

        mStatus = PTR_STATUS_PREPARE;
        if (mPtrUIHandlerHolder.hasHandler()) {
            mPtrUIHandlerHolder.onUIRefreshPrepare(this);
            if (DEBUG) {
                PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshPrepare, mFlag %s", mFlag);
            }
        }
        mPtrIndicator.setIsHeader(isHeader);

        mScrollChecker.tryToScrollTo(mPtrIndicator.getOffsetToRefresh(), isHeader ? mDurationToCloseHeader : mDurationToCloseFooter);
        if (atOnce) {
            mStatus = PTR_STATUS_LOADING;
            performRefresh();
        }
    }
 
开发者ID:yinyiliang,项目名称:RabbitCloud,代码行数:24,代码来源:PtrFrameLayout.java

示例4: notifyUIRefreshComplete

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
/**
 * Do real refresh work. If there is a hook, execute the hook first.
 *
 * @param ignoreHook
 */
private void notifyUIRefreshComplete(boolean ignoreHook) {
    /**
     * After hook operation is done, {@link #notifyUIRefreshComplete} will be call in resume action to ignore hook.
     */
    if (mPtrIndicator.hasLeftStartPosition() && !ignoreHook && mRefreshCompleteHook != null) {
        if (DEBUG) {
            PtrCLog.d(LOG_TAG, "notifyUIRefreshComplete mRefreshCompleteHook run.");
        }

        mRefreshCompleteHook.takeOver();
        return;
    }
    if (mPtrUIHandlerHolder.hasHandler()) {
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshComplete");
        }
        mPtrUIHandlerHolder.onUIRefreshComplete(this);
    }
    mPtrIndicator.onUIRefreshComplete();
    tryScrollBackToTopAfterComplete();
    tryToNotifyReset();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:PtrFrameLayout.java

示例5: notifyUIRefreshComplete

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
/**
 * Do real refresh work. If there is a hook, execute the hook first.
 *
 * @param ignoreHook
 */
private void notifyUIRefreshComplete(boolean ignoreHook) {
    /**
     * After hook operation is done, {@link #notifyUIRefreshComplete} will be call in resume action to ignore hook.
     */
    if (mPtrIndicator.hasLeftStartPosition() && !ignoreHook && mRefreshCompleteHook != null) {
        if (DEBUG) {
            PtrCLog.d(LOG_TAG, "notifyUIRefreshComplete mRefreshCompleteHook run.");
        }

        mRefreshCompleteHook.takeOver();
        return;
    }
    if (mPtrUIHandlerHolder.hasHandler()) {
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshComplete");
        }
        mPtrUIHandlerHolder.onUIRefreshComplete(this, mPtrIndicator.isHeader());
    }
    mPtrIndicator.onUIRefreshComplete();
    tryScrollBackToTopAfterComplete();
    tryToNotifyReset();
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:28,代码来源:PtrFrameLayout.java

示例6: autoRefresh

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
public void autoRefresh(boolean atOnce, int duration) {

        if (mStatus != PTR_STATUS_INIT) {
            return;
        }

        mFlag |= atOnce ? FLAG_AUTO_REFRESH_AT_ONCE : FLAG_AUTO_REFRESH_BUT_LATER;

        mStatus = PTR_STATUS_PREPARE;
        if (mPtrUIHandlerHolder.hasHandler()) {
            mPtrUIHandlerHolder.onUIRefreshPrepare(this);
            if (DEBUG) {
                PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshPrepare, mFlag %s", mFlag);
            }
        }
        mScrollChecker.tryToScrollTo(mPtrIndicator.getOffsetToRefresh(), duration);
        if (atOnce) {
            mStatus = PTR_STATUS_LOADING;
            performRefresh();
        }
    }
 
开发者ID:sathishmscict,项目名称:android-Ultra-Pull-To-Refresh,代码行数:22,代码来源:PtrFrameLayout.java

示例7: refreshComplete

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
/**
 * Call this when data is loaded.
 * The UI will perform complete at once or after a delay, depends on the time elapsed is greater then {@link #mLoadingMinTime} or not.
 */
final public void refreshComplete() {
    int mStart = mPtrIndicator.getCurrentPosY();
    if (mStart < PtrIndicator.POS_START)
        return;
    if (DEBUG) {
        PtrCLog.i(LOG_TAG, "refreshComplete");
    }
    if (mRefreshCompleteHook != null) {
        mRefreshCompleteHook.reset();
    }
    int delay = (int) (mLoadingMinTime - (System.currentTimeMillis() - mLoadingStartTime));
    if (delay <= 0) {
        if (DEBUG) {
            PtrCLog.d(LOG_TAG, "performRefreshComplete at once");
        }
        performRefreshComplete();
    } else {
        postDelayed(mPerformRefreshCompleteDelay, delay);
        if (DEBUG) {
            PtrCLog.d(LOG_TAG, "performRefreshComplete after delay: %s", delay);
        }
    }
}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:28,代码来源:PtrFrameLayout.java

示例8: performRefresh

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void performRefresh() {
    mLoadingStartTime = System.currentTimeMillis();
    if (mPtrUIHandlerHolder.hasHandler()) {
        mPtrUIHandlerHolder.onUIRefreshBegin(this);
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshBegin");
        }
    }
    if (mPtrHandler != null) {
        mPtrHandler.onRefreshBegin(this);
    }
}
 
开发者ID:sathishmscict,项目名称:android-Ultra-Pull-To-Refresh,代码行数:13,代码来源:PtrFrameLayout.java

示例9: tryToNotifyReset

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
/**
 * If at the top and not in loading, reset
 */
private boolean tryToNotifyReset() {
    if ((mStatus == PTR_STATUS_COMPLETE || mStatus == PTR_STATUS_PREPARE) && mPtrIndicator.isInStartPosition()) {
        if (mPtrUIHandlerHolder.hasHandler()) {
            mPtrUIHandlerHolder.onUIReset(this);
            if (DEBUG) {
                PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIReset");
            }
        }
        mStatus = PTR_STATUS_INIT;
        clearFlag();
        return true;
    }
    return false;
}
 
开发者ID:yinyiliang,项目名称:RabbitCloud,代码行数:18,代码来源:PtrFrameLayout.java

示例10: performRefresh

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void performRefresh() {
    mLoadingStartTime = System.currentTimeMillis();
    if (mPtrUIHeaderHolder.hasHandler()) {
        mPtrUIHeaderHolder.onUIRefreshBegin(this);
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHeader: onUIRefreshBegin");
        }
    }
    if (mPtrRefreshHandler != null) {
        mPtrRefreshHandler.onRefreshBegin(this);
    }

}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:14,代码来源:PtrFrameLayout.java

示例11: performLoad

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void performLoad() {
    mLoadingStartTime = System.currentTimeMillis();
    if (mPtrUIFooterHolder.hasHandler()) {
        mPtrUIFooterHolder.onUIRefreshBegin(this);
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHeader: onUIRefreshBegin");
        }
    }
    if (mPtrLoadHandler != null && !mClickToLoad && !mLoadFinishComplete) {
        mPtrLoadHandler.onLoadBegin(this);
    }
}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:13,代码来源:PtrFrameLayout.java

示例12: tryToNotifyReset

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
/**
 * If at the top and not in loading, reset
 */
private boolean tryToNotifyReset() {
    boolean isClear = false;
    if ((mStatus == PTR_STATUS_COMPLETE || mStatus == PTR_STATUS_PREPARE) && mPtrIndicator.isInStartPosition()) {
        if (mPtrUIHeaderHolder.hasHandler()) {
            mPtrUIHeaderHolder.onUIReset(this);
            if (DEBUG) {
                PtrCLog.i(LOG_TAG, "PtrUIHeader: onUIReset");
            }
        }
        mStatus = PTR_STATUS_INIT;
        clearFlag();
        isClear = true;
    }
    if ((mStatus == PTR_STATUS_COMPLETE || mStatus == PTR_STATUS_PREPARE) && mPtrIndicator.isInBottomPosition()) {//判断是否到底尾部《有毛病》
        if (mPtrUIFooterHolder.hasHandler()) {
            mPtrUIFooterHolder.onUIReset(this);
            if (DEBUG) {
                PtrCLog.i(LOG_TAG, "PtrUIHeader: onUIReset");
            }
        }
        mStatus = PTR_STATUS_INIT;
        clearFlag();
        isClear = true;
    }
    return isClear;
}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:30,代码来源:PtrFrameLayout.java

示例13: updatePos

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void updatePos(int change) {
    if (change == 0) {
        return;
    }

    boolean isUnderTouch = mPtrIndicator.isUnderTouch();

    // once moved, cancel event will be sent to child
    if (isUnderTouch && !mHasSendCancelEvent && mPtrIndicator.hasMovedAfterPressedDown()) {
        mHasSendCancelEvent = true;
        sendCancelEvent();
    }

    // leave initiated position or just refresh complete
    if ((mPtrIndicator.hasJustLeftStartPosition() && mStatus == PTR_STATUS_INIT) ||
            (mPtrIndicator.goDownCrossFinishPosition() && mStatus == PTR_STATUS_COMPLETE && isEnabledNextPtrAtOnce())) {

        mStatus = PTR_STATUS_PREPARE;
        mPtrUIHandlerHolder.onUIRefreshPrepare(this);
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshPrepare, mFlag %s", mFlag);
        }
    }

    // back to initiated position
    if (mPtrIndicator.hasJustBackToStartPosition()) {
        tryToNotifyReset();

        // recover event to children
        if (isUnderTouch) {
            sendDownEvent();
        }
    }

    // Pull to Refresh
    if (mStatus == PTR_STATUS_PREPARE) {
        // reach fresh height while moving from top to bottom
        if (isUnderTouch && !isAutoRefresh() && mPullToRefresh
                && mPtrIndicator.crossRefreshLineFromTopToBottom()) {
            tryToPerformRefresh();
        }
        // reach header height while auto refresh
        if (performAutoRefreshButLater() && mPtrIndicator.hasJustReachedHeaderHeightFromTopToBottom()) {
            tryToPerformRefresh();
        }
    }

    if (DEBUG) {
        PtrCLog.v(LOG_TAG, "updatePos: change: %s, current: %s last: %s, top: %s, headerHeight: %s",
                change, mPtrIndicator.getCurrentPosY(), mPtrIndicator.getLastPosY(), mContent.getTop(), mHeaderHeight);
    }

    mHeaderView.offsetTopAndBottom(change);
    if (!isPinContent()) {
        mContent.offsetTopAndBottom(change);
    }
    invalidate();

    if (mPtrUIHandlerHolder.hasHandler()) {
        mPtrUIHandlerHolder.onUIPositionChange(this, isUnderTouch, mStatus, mPtrIndicator);
    }
    onPositionChange(isUnderTouch, mStatus, mPtrIndicator);
}
 
开发者ID:tony-Shx,项目名称:Swface,代码行数:64,代码来源:PtrFrameLayout.java

示例14: updatePos

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void updatePos(int change) {
    if (change == 0) {
        return;
    }

    boolean isUnderTouch = mPtrIndicator.isUnderTouch();

    // once moved, cancel event will be sent to child
    if (isUnderTouch && !mHasSendCancelEvent && mPtrIndicator.hasMovedAfterPressedDown()) {
        mHasSendCancelEvent = true;
        sendCancelEvent();
    }

    // leave initiated position or just refresh complete
    if ((mPtrIndicator.hasJustLeftStartPosition() && mStatus == PTR_STATUS_INIT) ||
            (mPtrIndicator.goDownCrossFinishPosition() && mStatus == PTR_STATUS_COMPLETE && isEnabledNextPtrAtOnce())) {

        mStatus = PTR_STATUS_PREPARE;
        mPtrUIHandlerHolder.onUIRefreshPrepare(this);
        if (DEBUG) {
            PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshPrepare, mFlag %s", mFlag);
        }
    }

    // back to initiated position
    if (mPtrIndicator.hasJustBackToStartPosition()) {
        tryToNotifyReset();

        // recover event to children
        if (isUnderTouch) {
            sendDownEvent();
        }
    }

    // Pull to Refresh
    if (mStatus == PTR_STATUS_PREPARE) {
        // reach fresh height while moving from top to bottom
        if (isUnderTouch && !isAutoRefresh() && mPullToRefresh
                && mPtrIndicator.crossRefreshLineFromTopToBottom()) {
            tryToPerformRefresh();
        }
        // reach header height while auto refresh
        if (performAutoRefreshButLater() && mPtrIndicator.hasJustReachedHeaderHeightFromTopToBottom()) {
            tryToPerformRefresh();
        }
    }

    if (DEBUG) {
        PtrCLog.v(LOG_TAG, "updatePos: change: %s, current: %s last: %s, top: %s, headerHeight: %s",
                change, mPtrIndicator.getCurrentPosY(), mPtrIndicator.getLastPosY(), mContent.getTop(), mHeaderHeight);
    }

    if (mPtrIndicator.isHeader()) {
        mHeaderView.offsetTopAndBottom(change);
    } else {
        mFooterView.offsetTopAndBottom(change);
    }
    if (!isPinContent()) {
        mContent.offsetTopAndBottom(change);
    }
    invalidate();

    if (mPtrUIHandlerHolder.hasHandler()) {
        mPtrUIHandlerHolder.onUIPositionChange(this, isUnderTouch, mStatus, mPtrIndicator);
    }
    onPositionChange(isUnderTouch, mStatus, mPtrIndicator);
}
 
开发者ID:yinyiliang,项目名称:RabbitCloud,代码行数:68,代码来源:PtrFrameLayout.java

示例15: updatePos2

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void updatePos2(int change) {
        if (change == 0) return;
        boolean isUnderTouch = mPtrIndicator.isUnderTouch();
        // once moved, cancel event will be sent to child
        if (isUnderTouch && !mHasSendCancelEvent && mPtrIndicator.hasMovedAfterPressedDown()) {
            mHasSendCancelEvent = true;
            sendCancelEvent();
        }
        //点击加载判断
        if (mPtrIndicator.getCurrentPosY() <= -mFooterHeight && (mClickToLoad && !mLoadFinishComplete || mLoadFinishComplete)) {  //// TODO: 2017/9/5 点击加载判断
            mFooterView.offsetTopAndBottom(change);
            if (!isPinContent()) {
                mContent.offsetTopAndBottom(change);
            }
            invalidate();
            return;
        }

        // leave initiated position or just refresh complete  刚刚离开,UI进行准备显示阶段
        if ((mPtrIndicator.hasJustLeftBottomPosition() && mStatus == PTR_STATUS_INIT) ||
                (mPtrIndicator.goUpCrossFinishPosition() && mStatus == PTR_STATUS_COMPLETE && isEnabledNextPtrAtOnce()) ||
                (mStatus == PTR_STATUS_COMPLETE && isEnabledNextPtrAtOnce() && mClickToLoad)) {
            mStatus = PTR_STATUS_PREPARE;
            mPtrUIFooterHolder.onUIRefreshPrepare(this);
            if (DEBUG) {
                PtrCLog.i(LOG_TAG, "PtrUIHeader: onUIRefreshPrepare, mFlag %s", mFlag);
            }
        }

        // back to initiated position
        if (mPtrIndicator.hasJustBackToBottomPosition()) {
            tryToNotifyReset(false);
            // recover event to children
            if (isUnderTouch) {
                sendDownEvent();
            }
        }

        // Pull to Refresh<pull to load>
        if (mStatus == PTR_STATUS_PREPARE && !mClickToLoad && !mLoadFinishComplete) {
            // reach fresh height while moving from top to bottom
            if (isUnderTouch && mPullToLoad && mPtrIndicator.crossLoadLineFromTopToBottom()) {
                tryToPerformLoad();
            }
//            // reach header height while auto refresh
//            if (performAutoRefreshButLater() && mPtrIndicator.hasJustReachedHeaderHeightFromTopToBottom()) {
//                tryToPerformLoad();
//            }
        }

        if (DEBUG) {
            PtrCLog.v(LOG_TAG, "updatePos: change: %s, current: %s last: %s, top: %s, headerHeight: %s",
                    change, mPtrIndicator.getCurrentPosY(), mPtrIndicator.getLastPosY(), mContent.getTop(), mHeaderHeight);
        }

        mFooterView.offsetTopAndBottom(change);
        if (!isPinContent()) {
            mContent.offsetTopAndBottom(change);
        }
        invalidate();

        if (mPtrUIFooterHolder.hasHandler()) {
            mPtrUIFooterHolder.onUIPositionChange(this, isUnderTouch, mStatus, mPtrIndicator);
        }
        onPositionChange(isUnderTouch, mStatus, mPtrIndicator);
    }
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:67,代码来源:PtrFrameLayout.java


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