VerticalGridViewpublic class VerticalGridView extends BaseGridView A view that shows items in a vertically scrolling list. The items come from
the {@link RecyclerView.Adapter} associated with this view. |
Methods Summary |
---|
protected void | initAttributes(android.content.Context context, android.util.AttributeSet attrs)
initBaseGridViewAttributes(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.lbVerticalGridView);
setColumnWidth(a);
setNumColumns(a.getInt(R.styleable.lbVerticalGridView_numberOfColumns, 1));
a.recycle();
| void | setColumnWidth(android.content.res.TypedArray array)
TypedValue typedValue = array.peekValue(R.styleable.lbVerticalGridView_columnWidth);
int size;
if (typedValue != null && typedValue.type == TypedValue.TYPE_DIMENSION) {
size = array.getDimensionPixelSize(R.styleable.lbVerticalGridView_columnWidth, 0);
} else {
size = array.getInt(R.styleable.lbVerticalGridView_columnWidth, 0);
}
setColumnWidth(size);
| public void | setColumnWidth(int width)Set the column width.
mLayoutManager.setRowHeight(width);
requestLayout();
| public void | setNumColumns(int numColumns)Set the number of columns. Defaults to one.
mLayoutManager.setNumRows(numColumns);
requestLayout();
|
|