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


Java LayoutParams.MATCH_PARENT属性代码示例

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


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

示例1: setEmptyView

public void setEmptyView(View emptyView) {
    boolean insert = false;
    if (mEmptyLayout == null) {
        mEmptyLayout = new FrameLayout(emptyView.getContext());
        final LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        final ViewGroup.LayoutParams lp = emptyView.getLayoutParams();
        if (lp != null) {
            layoutParams.width = lp.width;
            layoutParams.height = lp.height;
        }
        mEmptyLayout.setLayoutParams(layoutParams);
        insert = true;
    }
    mEmptyLayout.removeAllViews();
    mEmptyLayout.addView(emptyView);
    mIsUseEmpty = true;
    if (insert) {
        if (getEmptyViewCount() == 1) {
            int position = 0;
            if (mHeadAndEmptyEnable && getHeaderLayoutCount() != 0) {
                position++;
            }
            notifyItemInserted(position);
        }
    }
}
 
开发者ID:feer921,项目名称:BaseProject,代码行数:26,代码来源:BaseQuickAdapter.java

示例2: generateDefaultLayoutParams

@Override
public RecyclerView.LayoutParams generateDefaultLayoutParams() {
    if (mIsVertical) {
        return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    } else {
        return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
    }
}
 
开发者ID:lucastanziano,项目名称:Blockbuster,代码行数:8,代码来源:TwoWayLayoutManager.java

示例3: checkLayoutParams

@Override
public boolean checkLayoutParams(LayoutParams lp) {
    if (isVertical()) {
        return (lp.width == LayoutParams.MATCH_PARENT);
    } else {
        return (lp.height == LayoutParams.MATCH_PARENT);
    }
}
 
开发者ID:lucastanziano,项目名称:Blockbuster,代码行数:8,代码来源:BaseLayoutManager.java

示例4: generateDefaultLayoutParams

@Override
public LayoutParams generateDefaultLayoutParams() {
    if (isVertical()) {
        return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    } else {
        return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
    }
}
 
开发者ID:lucastanziano,项目名称:Blockbuster,代码行数:8,代码来源:BaseLayoutManager.java

示例5: generateLayoutParams

@Override
public LayoutParams generateLayoutParams(ViewGroup.LayoutParams lp) {
    final LayoutParams lanedLp = new LayoutParams((MarginLayoutParams) lp);
    if (isVertical()) {
        lanedLp.width = LayoutParams.MATCH_PARENT;
        lanedLp.height = lp.height;
    } else {
        lanedLp.width = lp.width;
        lanedLp.height = LayoutParams.MATCH_PARENT;
    }

    return lanedLp;
}
 
开发者ID:lucastanziano,项目名称:Blockbuster,代码行数:13,代码来源:BaseLayoutManager.java

示例6: generateDefaultLayoutParams

@Override
public LayoutParams generateDefaultLayoutParams() {
    if (mIsVertical) {
        return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    } else {
        return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
    }
}
 
开发者ID:cymcsg,项目名称:UltimateAndroid,代码行数:8,代码来源:TwoWayLayoutManager.java


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