本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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);
}