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


Java RecyclerView.State方法代码示例

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


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

示例1: onDrawOver

import org.telegram.messenger.support.widget.RecyclerView; //导入方法依赖的package包/类
@Override
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
    float dx = 0, dy = 0;
    if (mSelected != null) {
        getSelectedDxDy(mTmpPosition);
        dx = mTmpPosition[0];
        dy = mTmpPosition[1];
    }
    mCallback.onDrawOver(c, parent, mSelected,
            mRecoverAnimations, mActionState, dx, dy);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:12,代码来源:ItemTouchHelper.java

示例2: onDraw

import org.telegram.messenger.support.widget.RecyclerView; //导入方法依赖的package包/类
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
    // we don't know if RV changed something so we should invalidate this index.
    mOverdrawChildPosition = -1;
    float dx = 0, dy = 0;
    if (mSelected != null) {
        getSelectedDxDy(mTmpPosition);
        dx = mTmpPosition[0];
        dy = mTmpPosition[1];
    }
    mCallback.onDraw(c, parent, mSelected,
            mRecoverAnimations, mActionState, dx, dy);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:14,代码来源:ItemTouchHelper.java

示例3: getItemOffsets

import org.telegram.messenger.support.widget.RecyclerView; //导入方法依赖的package包/类
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
        RecyclerView.State state) {
    outRect.setEmpty();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:6,代码来源:ItemTouchHelper.java

示例4: onLayoutChildren

import org.telegram.messenger.support.widget.RecyclerView; //导入方法依赖的package包/类
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
    if (getItemCount() == 0) {
        detachAndScrapAttachedViews(recycler);
        return;
    }

    int childTop;
    if (framesPos == null || framesPos.size() != getItemCount() || lastCalculatedHeight != getHeight() || lastCalculatedWidth != getWidth()) {
        prepareLayout();
        firstVisiblePosition = 0;
        childTop = 0;
    } else if (getChildCount() == 0) {
        firstVisiblePosition = 0;
        childTop = 0;
    } else if (getVisibleChildCount(0) >= state.getItemCount()) {
        firstVisiblePosition = 0;
        childTop = 0;
    } else {
        final View topChild = getChildAt(0);
        if (forceClearOffsets) {
            childTop = 0;
            forceClearOffsets = false;
        } else {
            childTop = getDecoratedTop(topChild);
        }

        Rect lastFrame = framesPos.get(getIndexOfRow(rows.size() - 1));
        if (getHeight() > lastFrame.y + lastFrame.height) {
            firstVisiblePosition = 0;
            childTop = 0;
        }

        int maxFirstRow = rows.size() - (getVisibleRowCount(0) - 1);
        boolean isOutOfRowBounds = getFirstVisibleRow() > maxFirstRow;
        if (isOutOfRowBounds) {
            int firstRow;
            if (isOutOfRowBounds) {
                firstRow = maxFirstRow;
            } else {
                firstRow = getFirstVisibleRow();
            }
            firstVisiblePosition = getIndexOfRow(firstRow);

            childTop = (int) framesPos.get(getIndexOfRow(rows.size() - 1)).y;

            if (getFirstVisibleRow() == 0) {
                childTop = Math.min(childTop, 0);
            }
        }
    }
    detachAndScrapAttachedViews(recycler);
    fillGrid(DIRECTION_NONE, childTop, 0, recycler, state);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:55,代码来源:FlowLayoutManager.java


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