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


Java Range.contains方法代码示例

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


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

示例1: findSiblingStyleByPosition

import com.alibaba.android.vlayout.Range; //导入方法依赖的package包/类
public GridRangeStyle findSiblingStyleByPosition(int position) {
    GridRangeStyle rangeStyle = null;
    if (mParent != null) {
        ArrayMap<Range<Integer>, GridRangeStyle> siblings = mParent.mChildren;
        for (int i = 0, size = siblings.size(); i < size; i++) {
            Range range = siblings.keyAt(i);
            if (range.contains(position)) {
                GridRangeStyle childRangeStyle = siblings.valueAt(i);
                if (!childRangeStyle.equals(this)) {
                    rangeStyle = childRangeStyle;
                }
                break;
            }
        }
    }
    return rangeStyle;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:RangeGridLayoutHelper.java

示例2: isRecyclable

import com.alibaba.android.vlayout.Range; //导入方法依赖的package包/类
@Override
public boolean isRecyclable(int childPos, int startIndex, int endIndex, LayoutManagerHelper helper, boolean fromStart) {
    Range<Integer> range = getRange();
    if (range.contains(childPos)) {
        if (hasHeader && childPos == getRange().getLower()) {
            return true;
        }
        if (hasFooter && childPos == getRange().getUpper()) {
            return true;
        }
        Range<Integer> childRange = Range.create(range.getLower() + (hasHeader ? 1 : 0),
            range.getUpper() - (hasFooter ? 1 : 0));
        return Range.create(startIndex, endIndex).contains(childRange);
    } else {
        Log.w(TAG, "Child item not match");
        return true;
    }
}
 
开发者ID:alibaba,项目名称:vlayout,代码行数:19,代码来源:AbstractFullFillLayoutHelper.java

示例3: findRangeStyleByPosition

import com.alibaba.android.vlayout.Range; //导入方法依赖的package包/类
public GridRangeStyle findRangeStyleByPosition(int position) {
    GridRangeStyle rangeStyle = this;
    for (int i = 0, size = mChildren.size(); i < size; i++) {
        Range range = mChildren.keyAt(i);
        if (range.contains(position)) {
            rangeStyle = mChildren.valueAt(i);
            break;
        }
    }
    return rangeStyle;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:RangeGridLayoutHelper.java

示例4: isRecyclable

import com.alibaba.android.vlayout.Range; //导入方法依赖的package包/类
@Override
public boolean isRecyclable(int childPos, int startIndex, int endIndex, LayoutManagerHelper helper, boolean fromStart) {
    Range<Integer> range = getRange();
    if (range.contains(childPos)) {
        return Range.create(startIndex, endIndex).contains(range);
    } else {
        Log.w(TAG, "Child item not match");
        return true;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:AbstractFullFillLayoutHelper.java

示例5: findRangeStyle

import com.alibaba.android.vlayout.Range; //导入方法依赖的package包/类
private GridRangeStyle findRangeStyle(GridRangeStyle rangeStyle, int position){
    for (int i = 0, size = rangeStyle.mChildren.size(); i < size; i++) {
        GridRangeStyle childRangeStyle = rangeStyle.mChildren.valueAt(i);
        Range range = rangeStyle.mChildren.keyAt(i);
        if (!childRangeStyle.isChildrenEmpty()){
            return findRangeStyle(childRangeStyle, position);
        } else if (range.contains(position)) {
            return rangeStyle.mChildren.valueAt(i);
        }
    }
    return rangeStyle;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:RangeGridLayoutHelper.java


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