當前位置: 首頁>>代碼示例>>Java>>正文


Java View.forceLayout方法代碼示例

本文整理匯總了Java中android.view.View.forceLayout方法的典型用法代碼示例。如果您正苦於以下問題:Java View.forceLayout方法的具體用法?Java View.forceLayout怎麽用?Java View.forceLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.View的用法示例。


在下文中一共展示了View.forceLayout方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setIViewNeedLayout

import android.view.View; //導入方法依賴的package包/類
/**
 * 清除已經布局的flag
 */
public void setIViewNeedLayout(View view, boolean layout) {
    view.setTag(R.id.tag_need_layout, layout ? "true" : "false");
    if (layout) {
        view.forceLayout();
    }
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:10,代碼來源:UILayoutImpl.java

示例2: requestLayout

import android.view.View; //導入方法依賴的package包/類
public void requestLayout() {
    for (View dragView : mSwipeViewLayouter.getViews().values()) {
        dragView.forceLayout();
    }
}
 
開發者ID:Kaufland,項目名稱:andswipeframework,代碼行數:6,代碼來源:DraggingProxy.java

示例3: measureHeightOfChildrenCompat

import android.view.View; //導入方法依賴的package包/類
public int measureHeightOfChildrenCompat(int widthMeasureSpec, int startPosition, int endPosition, int maxHeight, int disallowPartialChildPosition) {
    int paddingTop = getListPaddingTop();
    int paddingBottom = getListPaddingBottom();
    int paddingLeft = getListPaddingLeft();
    int paddingRight = getListPaddingRight();
    int reportedDividerHeight = getDividerHeight();
    Drawable divider = getDivider();
    ListAdapter adapter = getAdapter();
    if (adapter == null) {
        return paddingTop + paddingBottom;
    }
    int returnedHeight = paddingTop + paddingBottom;
    int dividerHeight = (reportedDividerHeight <= 0 || divider == null) ? 0 : reportedDividerHeight;
    int prevHeightWithoutPartialChild = 0;
    View child = null;
    int viewType = 0;
    int count = adapter.getCount();
    int i = 0;
    while (i < count) {
        int heightMeasureSpec;
        int newType = adapter.getItemViewType(i);
        if (newType != viewType) {
            child = null;
            viewType = newType;
        }
        child = adapter.getView(i, child, this);
        LayoutParams childLp = child.getLayoutParams();
        if (childLp == null) {
            childLp = generateDefaultLayoutParams();
            child.setLayoutParams(childLp);
        }
        if (childLp.height > 0) {
            heightMeasureSpec = MeasureSpec.makeMeasureSpec(childLp.height, 1073741824);
        } else {
            heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, 0);
        }
        child.measure(widthMeasureSpec, heightMeasureSpec);
        child.forceLayout();
        if (i > 0) {
            returnedHeight += dividerHeight;
        }
        returnedHeight += child.getMeasuredHeight();
        if (returnedHeight < maxHeight) {
            if (disallowPartialChildPosition >= 0 && i >= disallowPartialChildPosition) {
                prevHeightWithoutPartialChild = returnedHeight;
            }
            i++;
        } else if (disallowPartialChildPosition < 0 || i <= disallowPartialChildPosition || prevHeightWithoutPartialChild <= 0 || returnedHeight == maxHeight) {
            return maxHeight;
        } else {
            return prevHeightWithoutPartialChild;
        }
    }
    return returnedHeight;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:56,代碼來源:ListViewCompat.java


注:本文中的android.view.View.forceLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。