本文整理汇总了Java中android.support.v7.widget.RecyclerView.LayoutParams.isItemRemoved方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutParams.isItemRemoved方法的具体用法?Java LayoutParams.isItemRemoved怎么用?Java LayoutParams.isItemRemoved使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.RecyclerView.LayoutParams
的用法示例。
在下文中一共展示了LayoutParams.isItemRemoved方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nextViewInLimitedList
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
public View nextViewInLimitedList(View ignore) {
int size = this.mScrapList.size();
View closest = null;
int closestDistance = Integer.MAX_VALUE;
for (int i = 0; i < size; i++) {
View view = ((ViewHolder) this.mScrapList.get(i)).itemView;
LayoutParams lp = (LayoutParams) view.getLayoutParams();
if (!(view == ignore || lp.isItemRemoved())) {
int distance = (lp.getViewLayoutPosition() - this.mCurrentPosition) * this.mItemDirection;
if (distance >= 0 && distance < closestDistance) {
closest = view;
closestDistance = distance;
if (distance == 0) {
break;
}
}
}
}
return closest;
}
示例2: nextViewInLimitedList
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
public View nextViewInLimitedList(View ignore) {
int size = this.mScrapList.size();
View closest = null;
int closestDistance = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
for (int i = 0; i < size; i++) {
View view = ((ViewHolder) this.mScrapList.get(i)).itemView;
LayoutParams lp = (LayoutParams) view.getLayoutParams();
if (!(view == ignore || lp.isItemRemoved())) {
int distance = (lp.getViewLayoutPosition() - this.mCurrentPosition) * this.mItemDirection;
if (distance >= 0 && distance < closestDistance) {
closest = view;
closestDistance = distance;
if (distance == 0) {
break;
}
}
}
}
return closest;
}
示例3: layoutChild
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
@Override
protected void layoutChild(View child, Direction direction) {
getLaneForChild(mTempLaneInfo, child, direction);
mLanes.getChildFrame(mChildFrame, getDecoratedMeasuredWidth(child),
getDecoratedMeasuredHeight(child), mTempLaneInfo, direction);
final ItemEntry entry = cacheChildFrame(child, mChildFrame);
layoutDecorated(child, mChildFrame.left, mChildFrame.top, mChildFrame.right,
mChildFrame.bottom);
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
if (!lp.isItemRemoved()) {
pushChildFrame(entry, mChildFrame, mTempLaneInfo.startLane,
getLaneSpanForChild(child), direction);
}
}
示例4: prependToSpan
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void prependToSpan(View view, OrientationHelper helper) {
LayoutParams lp = getLayoutParams(view);
mViews.add(0, view);
mCachedStart = INVALID_LINE;
if (mViews.size() == 1) {
mCachedEnd = INVALID_LINE;
}
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize += helper.getDecoratedMeasurement(view);
}
}
示例5: appendToSpan
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void appendToSpan(View view, OrientationHelper helper) {
LayoutParams lp = getLayoutParams(view);
mViews.add(view);
mCachedEnd = INVALID_LINE;
if (mViews.size() == 1) {
mCachedStart = INVALID_LINE;
}
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize += helper.getDecoratedMeasurement(view);
}
}
示例6: popEnd
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void popEnd(OrientationHelper helper) {
final int size = mViews.size();
View end = mViews.remove(size - 1);
final LayoutParams lp = getLayoutParams(end);
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize -= helper.getDecoratedMeasurement(end);
}
if (size == 1) {
mCachedStart = INVALID_LINE;
}
mCachedEnd = INVALID_LINE;
}
示例7: popStart
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void popStart(OrientationHelper helper) {
View start = mViews.remove(0);
final LayoutParams lp = getLayoutParams(start);
if (mViews.size() == 0) {
mCachedEnd = INVALID_LINE;
}
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize -= helper.getDecoratedMeasurement(start);
}
mCachedStart = INVALID_LINE;
}
示例8: prependToSpan
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void prependToSpan(View view, OrientationHelperEx helper) {
LayoutParams lp = getLayoutParams(view);
mViews.add(0, view);
mCachedStart = INVALID_LINE;
if (mViews.size() == 1) {
mCachedEnd = INVALID_LINE;
}
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize += helper.getDecoratedMeasurement(view);
}
}
示例9: appendToSpan
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void appendToSpan(View view, OrientationHelperEx helper) {
LayoutParams lp = getLayoutParams(view);
mViews.add(view);
mCachedEnd = INVALID_LINE;
if (mViews.size() == 1) {
mCachedStart = INVALID_LINE;
}
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize += helper.getDecoratedMeasurement(view);
}
}
示例10: popEnd
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void popEnd(OrientationHelperEx helper) {
final int size = mViews.size();
View end = mViews.remove(size - 1);
final LayoutParams lp = getLayoutParams(end);
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize -= helper.getDecoratedMeasurement(end);
}
if (size == 1) {
mCachedStart = INVALID_LINE;
}
mCachedEnd = INVALID_LINE;
}
示例11: popStart
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void popStart(OrientationHelperEx helper) {
View start = mViews.remove(0);
final LayoutParams lp = getLayoutParams(start);
if (mViews.size() == 0) {
mCachedEnd = INVALID_LINE;
}
if (lp.isItemRemoved() || lp.isItemChanged()) {
mDeletedSize -= helper.getDecoratedMeasurement(start);
}
mCachedStart = INVALID_LINE;
}
示例12: nextViewFromScrapList
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
private View nextViewFromScrapList() {
int size = this.mScrapList.size();
for (int i = 0; i < size; i++) {
View view = ((ViewHolder) this.mScrapList.get(i)).itemView;
LayoutParams lp = (LayoutParams) view.getLayoutParams();
if (!lp.isItemRemoved() && this.mCurrentPosition == lp.getViewLayoutPosition()) {
assignPositionFromScrapList(view);
return view;
}
}
return null;
}
示例13: layoutChunk
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
void layoutChunk(Recycler recycler, State state, LayoutState layoutState, LayoutChunkResult result) {
View view = layoutState.next(recycler);
if (view == null) {
result.mFinished = true;
return;
}
int right;
int left;
int bottom;
int top;
LayoutParams params = (LayoutParams) view.getLayoutParams();
if (layoutState.mScrapList == null) {
if (this.mShouldReverseLayout == (layoutState.mLayoutDirection == -1)) {
addView(view);
} else {
addView(view, 0);
}
} else {
if (this.mShouldReverseLayout == (layoutState.mLayoutDirection == -1)) {
addDisappearingView(view);
} else {
addDisappearingView(view, 0);
}
}
measureChildWithMargins(view, 0, 0);
result.mConsumed = this.mOrientationHelper.getDecoratedMeasurement(view);
if (this.mOrientation == 1) {
if (isLayoutRTL()) {
right = getWidth() - getPaddingRight();
left = right - this.mOrientationHelper.getDecoratedMeasurementInOther(view);
} else {
left = getPaddingLeft();
right = left + this.mOrientationHelper.getDecoratedMeasurementInOther(view);
}
if (layoutState.mLayoutDirection == -1) {
bottom = layoutState.mOffset;
top = layoutState.mOffset - result.mConsumed;
} else {
top = layoutState.mOffset;
bottom = layoutState.mOffset + result.mConsumed;
}
} else {
top = getPaddingTop();
bottom = top + this.mOrientationHelper.getDecoratedMeasurementInOther(view);
if (layoutState.mLayoutDirection == -1) {
right = layoutState.mOffset;
left = layoutState.mOffset - result.mConsumed;
} else {
left = layoutState.mOffset;
right = layoutState.mOffset + result.mConsumed;
}
}
layoutDecorated(view, left + params.leftMargin, top + params.topMargin, right - params.rightMargin, bottom - params.bottomMargin);
if (params.isItemRemoved() || params.isItemChanged()) {
result.mIgnoreConsumed = true;
}
result.mFocusable = view.isFocusable();
}
示例14: isViewValidAsAnchor
import android.support.v7.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
private boolean isViewValidAsAnchor(View child, State state) {
LayoutParams lp = (LayoutParams) child.getLayoutParams();
return !lp.isItemRemoved() && lp.getViewLayoutPosition() >= 0 && lp.getViewLayoutPosition() < state.getItemCount();
}