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


Java LayoutParams.getViewLayoutPosition方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:21,代码来源:LinearLayoutManager.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:LinearLayoutManager.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:LinearLayoutManager.java

示例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();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:LinearLayoutManager.java


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