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


Java LayoutParams.getViewLayoutPosition方法代码示例

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


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

示例1: nextViewFromScrapList

import org.telegram.messenger.support.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
/**
 * Returns the next item from the scrap list.
 * <p>
 * Upon finding a valid VH, sets current item position to VH.itemPosition + mItemDirection
 *
 * @return View if an item in the current position or direction exists if not null.
 */
private View nextViewFromScrapList() {
    final int size = mScrapList.size();
    for (int i = 0; i < size; i++) {
        final View view = mScrapList.get(i).itemView;
        final LayoutParams lp = (LayoutParams) view.getLayoutParams();
        if (lp.isItemRemoved()) {
            continue;
        }
        if (mCurrentPosition == lp.getViewLayoutPosition()) {
            assignPositionFromScrapList(view);
            return view;
        }
    }
    return null;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:23,代码来源:LinearLayoutManager.java

示例2: nextViewInLimitedList

import org.telegram.messenger.support.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
public View nextViewInLimitedList(View ignore) {
    int size = mScrapList.size();
    View closest = null;
    int closestDistance = Integer.MAX_VALUE;
    if (DEBUG && mIsPreLayout) {
        throw new IllegalStateException("Scrap list cannot be used in pre layout");
    }
    for (int i = 0; i < size; i++) {
        View view = mScrapList.get(i).itemView;
        final LayoutParams lp = (LayoutParams) view.getLayoutParams();
        if (view == ignore || lp.isItemRemoved()) {
            continue;
        }
        final int distance = (lp.getViewLayoutPosition() - mCurrentPosition) *
                mItemDirection;
        if (distance < 0) {
            continue; // item is not in current direction
        }
        if (distance < closestDistance) {
            closest = view;
            closestDistance = distance;
            if (distance == 0) {
                break;
            }
        }
    }
    return closest;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:29,代码来源:LinearLayoutManager.java

示例3: isViewValidAsAnchor

import org.telegram.messenger.support.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
private boolean isViewValidAsAnchor(View child, RecyclerView.State state) {
    LayoutParams lp = (LayoutParams) child.getLayoutParams();
    return !lp.isItemRemoved() && lp.getViewLayoutPosition() >= 0
            && lp.getViewLayoutPosition() < state.getItemCount();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:6,代码来源:LinearLayoutManager.java

示例4: isViewValidAsAnchor

import org.telegram.messenger.support.widget.RecyclerView.LayoutParams; //导入方法依赖的package包/类
boolean isViewValidAsAnchor(View child, RecyclerView.State state) {
    LayoutParams lp = (LayoutParams) child.getLayoutParams();
    return !lp.isItemRemoved() && lp.getViewLayoutPosition() >= 0
            && lp.getViewLayoutPosition() < state.getItemCount();
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:6,代码来源:LinearLayoutManager.java


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