public class TableColumnDpWidthModel extends java.lang.Object implements TableColumnModel
TableColumnModel implementation holding absolute column widths in dp.| Constructor and Description |
|---|
TableColumnDpWidthModel(android.content.Context context,
int columnCount)
Creates a new TableColumnModel with the given number of columns.
|
TableColumnDpWidthModel(android.content.Context context,
int columnCount,
int defaultColumnWidthInDp)
Creates a new TableColumnModel with the given number of columns.
|
TableColumnDpWidthModel(android.util.DisplayMetrics displayMetrics,
int columnCount)
Creates a new TableColumnModel with the given number of columns.
|
TableColumnDpWidthModel(android.util.DisplayMetrics displayMetrics,
int columnCount,
int defaultColumnWidthInDp)
Creates a new TableColumnModel with the given number of columns.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColumnCount()
Gives the column count of this model.
|
int |
getColumnWidth(int columnIndex,
int tableWidthInPx)
Gives the column width of the given index.
|
void |
setColumnCount(int columnCount)
Sets the column count to this model.
|
void |
setColumnWidth(int columnIndex,
int columnWidthInDp)
Sets the column width for the column at the given index.
|
public TableColumnDpWidthModel(android.content.Context context,
int columnCount)
context - The Context to observe the DisplayMetrics needed for calculate the pixels from the dp.columnCount - The number of columns.public TableColumnDpWidthModel(android.util.DisplayMetrics displayMetrics,
int columnCount)
displayMetrics - The DisplayMetrics needed for calculate the pixels from the dp.columnCount - The number of columns.public TableColumnDpWidthModel(android.content.Context context,
int columnCount,
int defaultColumnWidthInDp)
context - The Context to observe the DisplayMetrics needed for calculate the pixels from the dp.columnCount - The number of columns.defaultColumnWidthInDp - The default column width in dp.public TableColumnDpWidthModel(android.util.DisplayMetrics displayMetrics,
int columnCount,
int defaultColumnWidthInDp)
displayMetrics - The DisplayMetrics needed for calculate the pixels from the dp.columnCount - The number of columns.defaultColumnWidthInDp - The default column width in dp.public void setColumnWidth(int columnIndex,
int columnWidthInDp)
columnIndex - The index of the column.columnWidthInDp - The width of the column in dp.public void setColumnCount(int columnCount)
TableColumnModelsetColumnCount in interface TableColumnModelcolumnCount - The number of columns that shall be set.public int getColumnCount()
TableColumnModelgetColumnCount in interface TableColumnModelpublic int getColumnWidth(int columnIndex,
int tableWidthInPx)
TableColumnModelgetColumnWidth in interface TableColumnModelcolumnIndex - The index of the column.tableWidthInPx - The width of the table where it should be used.