當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。