本文整理汇总了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);
}
}
}
示例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);
}
}
示例3: checkLayoutParams
@Override
public boolean checkLayoutParams(LayoutParams lp) {
if (isVertical()) {
return (lp.width == LayoutParams.MATCH_PARENT);
} else {
return (lp.height == LayoutParams.MATCH_PARENT);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}