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


Java PtrCLog.v方法代码示例

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


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

示例1: run

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
public void run() {
    boolean finish = !mScroller.computeScrollOffset() || mScroller.isFinished();
    int curY = mScroller.getCurrY();
    int deltaY = curY - mLastFlingY;
    if (DEBUG) {
        if (deltaY != 0) {
            PtrCLog.v(LOG_TAG,
                    "scroll: %s, start: %s, to: %s, currentPos: %s, current :%s, last: %s, delta: %s",
                    finish, mStart, mTo, mPtrIndicator.getCurrentPosY(), curY, mLastFlingY, deltaY);
        }
    }
    if (!finish) {
        mLastFlingY = curY;
        movePos(deltaY);
        post(this);
    } else {
        finish();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:PtrFrameLayout.java

示例2: run

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
public void run() {
    boolean finish = !mScroller.computeScrollOffset() || mScroller.isFinished();
    int curY = mScroller.getCurrY();
    int deltaY = curY - mLastFlingY;
    if (DEBUG) {
        if (deltaY != 0) {
            PtrCLog.v(LOG_TAG,
                    "scroll: %s, start: %s, to: %s, currentPos: %s, current :%s, last: %s, delta: %s",
                    finish, mStart, mTo, mPtrIndicator.getCurrentPosY(), curY, mLastFlingY, deltaY);
        }
    }
    if (!finish) {
        mLastFlingY = curY;
        if (isPullToLoad)
            movePos2(deltaY);
        else
            movePos(deltaY);

        post(this);
    } else {
        finish();
    }
}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:24,代码来源:PtrFrameLayout.java

示例3: run

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
public void run() {
    boolean finish = !mScroller.computeScrollOffset() || mScroller.isFinished();
    int curY = mScroller.getCurrY();
    int deltaY = curY - mLastFlingY;
    if (DEBUG) {
        if (deltaY != 0) {
            PtrCLog.v(LOG_TAG,
                    "scroll: %s, start: %s, to: %s, currentPos: %s, current :%s, last: %s, delta: %s",
                    finish, mStart, mTo, mPtrIndicator.getCurrentPosY(), curY, mLastFlingY, deltaY);
        }
    }
    if (!finish) {
        mLastFlingY = curY;
        if (mPtrIndicator.isHeader()) {
            moveHeaderPos(deltaY);
        } else {
            moveFooterPos(-deltaY);
        }
        post(this);
    } else {
        finish();
    }
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:24,代码来源:PtrFrameLayout.java

示例4: finish

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
private void finish() {
    if (DEBUG) {
        PtrCLog.v(LOG_TAG, "finish, currentPos:%s", mPtrIndicator.getCurrentPosY());
    }
    reset();
    onPtrScrollFinish();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:PtrFrameLayout.java

示例5: dispatchTouchEvent

import in.srain.cube.views.ptr.util.PtrCLog; //导入方法依赖的package包/类
@Override
public boolean dispatchTouchEvent(MotionEvent e) {
    if (!isEnabled() || mContent == null || mHeaderView == null) {
        return dispatchTouchEventSupper(e);
    }
    int action = e.getAction();
    switch (action) {
        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_CANCEL:
            mPtrIndicator.onRelease();
            if (mPtrIndicator.hasLeftStartPosition()) {
                if (DEBUG) {
                    PtrCLog.d(LOG_TAG, "call onRelease when user release");
                }
                onRelease(false);
                if (mPtrIndicator.hasMovedAfterPressedDown()) {
                    sendCancelEvent();
                    return true;
                }
                return dispatchTouchEventSupper(e);
            } else {
                return dispatchTouchEventSupper(e);
            }

        case MotionEvent.ACTION_DOWN:
            mHasSendCancelEvent = false;
            mPtrIndicator.onPressDown(e.getX(), e.getY());

            mScrollChecker.abortIfWorking();

            mPreventForHorizontal = false;
            // The cancel event will be sent once the position is moved.
            // So let the event pass to children.
            // fix #93, #102
            dispatchTouchEventSupper(e);
            return true;

        case MotionEvent.ACTION_MOVE:
            mLastMoveEvent = e;
            mPtrIndicator.onMove(e.getX(), e.getY());
            float offsetX = mPtrIndicator.getOffsetX();
            float offsetY = mPtrIndicator.getOffsetY();

            if (mDisableWhenHorizontalMove && !mPreventForHorizontal && (Math.abs(offsetX) > mPagingTouchSlop && Math.abs(offsetX) > Math.abs(offsetY))) {
                if (mPtrIndicator.isInStartPosition()) {
                    mPreventForHorizontal = true;
                }
            }
            if (mPreventForHorizontal) {
                return dispatchTouchEventSupper(e);
            }

            boolean moveDown = offsetY > 0;
            boolean moveUp = !moveDown;
            boolean canMoveUp = mPtrIndicator.hasLeftStartPosition();

            if (DEBUG) {
                boolean canMoveDown = mPtrHandler != null && mPtrHandler.checkCanDoRefresh(this, mContent, mHeaderView);
                PtrCLog.v(LOG_TAG, "ACTION_MOVE: offsetY:%s, currentPos: %s, moveUp: %s, canMoveUp: %s, moveDown: %s: canMoveDown: %s", offsetY, mPtrIndicator.getCurrentPosY(), moveUp, canMoveUp, moveDown, canMoveDown);
            }

            // disable move when header not reach top
            if (moveDown && mPtrHandler != null && !mPtrHandler.checkCanDoRefresh(this, mContent, mHeaderView)) {
                return dispatchTouchEventSupper(e);
            }

            if ((moveUp && canMoveUp) || moveDown) {
                movePos(offsetY);
                return true;
            }
    }
    return dispatchTouchEventSupper(e);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:74,代码来源:PtrFrameLayout.java

示例6: 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:weiwenqiang,项目名称:GitHub,代码行数:64,代码来源:PtrFrameLayout.java

示例7: 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

示例8: 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:smartbeng,项目名称:PaoMovie,代码行数:68,代码来源:PtrFrameLayout.java


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