本文整理汇总了Java中android.support.v7.widget.RecyclerView.LayoutParams.getViewLayoutPosition方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutParams.getViewLayoutPosition方法的具体用法?Java LayoutParams.getViewLayoutPosition怎么用?Java LayoutParams.getViewLayoutPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.RecyclerView.LayoutParams
的用法示例。
在下文中一共展示了LayoutParams.getViewLayoutPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例4: 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();
}