当前位置: 首页>>代码示例>>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;未经允许,请勿转载。