类 | |
| interface | AbOnItemClickListener |
Public 成员函数 | |
| String[] | getTitles () |
| void | setTitles (String[] titles) |
| List< String[]> | getContents () |
| void | setContents (List< String[]> contents) |
| int[] | getCellTypes () |
| void | setCellTypes (int[] cellTypes) |
| int[] | getCellWidth () |
| void | setCellWidth (int[] cellWidth) |
| int[] | getRowHeight () |
| void | setRowHeight (int[] rowHeight) |
| int[] | getRowTextSize () |
| void | setRowTextSize (int[] rowTextSize) |
| int[] | getRowTextColor () |
| void | setRowTextColor (int[] rowTextColor) |
| int[] | getTableResource () |
| void | setTableResource (int[] tableResource) |
| AbOnItemClickListener | getItemCellTouchListener () |
| void | setItemCellTouchListener (AbOnItemClickListener itemCellTouchListener) |
| AbOnItemClickListener | getItemCellCheckListener () |
| void | setItemCellCheckListener (AbOnItemClickListener itemCellCheckListener) |
静态 Public 成员函数 | |
| static AbTable | newAbTable (Context context, int columnSize) |
Private 属性 | |
| String[] | titles |
| List< String[]> | contents |
| int[] | cellTypes |
| int[] | cellWidth |
| int[] | rowHeight |
| int[] | rowTextSize |
| int[] | rowTextColor |
| int[] | tableResource |
| AbOnItemClickListener | itemCellTouchListener |
| AbOnItemClickListener | itemCellCheckListener |
静态 Private 属性 | |
| static AbTable | mAbTable = null |
| static int | mScreenWidth = 0 |
| static int | mScreenHeight = 0 |
© 2012 amsoft.cn 名称:AbCellType.java 描述:表格控件实体类
(1)标题配置
titles = new String[] { "标题1", "标题2", "标题3", "标题4","标题5"};
(2)内容列表配置(初始为空的)
contents = new ArrayList<String[]>();
(3)列类型配置(参照AbCellType)
cellTypes = new int[] { AbCellType.STRING, AbCellType.STRING, AbCellType.STRING, AbCellType.STRING,AbCellType.STRING};
(4)列宽配置(%) 超过100% 可以横向滑动
cellWidth = new int[] {20,50,10,20,50};
(5)行高(索引0:标题高,1:内容列表高)
rowHeight = new int[] { 35, 35 };
(6)行文字大小(索引0标题,1内容列表)
rowTextSize = new int[] { 15, 12};
(7)行文字颜色(索引0标题,1内容列表)
rowTextColor = new int[] {Color.rgb(255, 255, 255),Color.rgb(113, 113, 113) };
(8)背景资源(索引0标题行背景,1标题单元格背景,2内容列表行背景。3表格内容单元格背景)
tableResource = new int[] {android.R.color.transparent,R.drawable.title_cell,android.R.color.transparent,R.drawable.content_cell};
(9)表格实体(通过newAbTable实例化并初始化列数,可自动完成AbTable的配置)
table = AbTable.newAbTable(this,5);
table.setTitles(titles);
table.setContents(contents);
table.setCellTypes(cellTypes);
table.setCellWidth(cellWidth);
table.setRowHeight(rowHeight);
table.setRowTextSize(rowTextSize);
table.setTableResource(tableResource);
table.setRowTextColor(rowTextColor);
(10)AbTableArrayAdapter对象
mAbTableArrayAdapter = new AbTableArrayAdapter(this, table);
(12)ListView(布局参照):
< HorizontalScrollView
android:id="@+id/horView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="@+id/mListView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:divider="@android:color/transparent"
android:dividerHeight="0dip" >
< /ListView>
< /HorizontalScrollView>
mListView = (ListView)findViewById(R.id.mListView);
(11)设置Adapter
mListView.setAdapter(tableAdapter);
|
inline |
Gets the cell types.
|
inline |
Gets the cell width.
|
inline |
Gets the contents.
|
inline |
Gets the item cell check listener.
|
inline |
Gets the item cell touch listener.
|
inline |
Gets the row height.
|
inline |
Gets the row text color.
|
inline |
Gets the row text size.
|
inline |
Gets the table resource.
|
inline |
描述:获取表格的标题.
|
inlinestatic |
描述:表格对象构造.
| context | context对象 |
| columnSize | 列数 |
|
inline |
描述:列类型配置(参照AbCellType).
| cellTypes | 列类型 |
|
inline |
描述:列宽配置(%) 超过100% 可以横向滑动.
| cellWidth | 列宽的百分比 |
|
inline |
描述:设置列表内容的数据.
| contents | 列表内容的数据 |
|
inline |
描述:复选框cell,一行中的某一个cell被点击.
| itemCellCheckListener | the new item cell check listener |
|
inline |
描述:图片cell,一行中的某一个cell被点击.
| itemCellTouchListener | the new item cell touch listener |
|
inline |
描述:设置行高(索引0:标题高,1:内容列表高).
| rowHeight | 行高 |
|
inline |
描述:设置行文字的颜色.
| rowTextColor | 行文字的颜色 |
|
inline |
描述:设置行文字的大小(索引0标题,1内容列表).
| rowTextSize | 行文字的大小 |
|
inline |
描述:表格的背景资源(索引0标题行背景,1标题单元格背景,2内容列表行背景。3表格内容单元格背景).
| tableResource | the new table resource |
|
inline |
描述:设置表格的标题.
| titles | 表格的标题数组 |
|
private |
单元格类型数组.
|
private |
单元格宽度数组.
|
private |
内容列表数组.
|
private |
The item cell check listener.
|
private |
The item cell touch listener.
|
staticprivate |
AbTable实例.
|
staticprivate |
屏幕的高.
|
staticprivate |
屏幕的宽.
|
private |
行高度数组(索引0标题,1内容列表).
|
private |
行文字颜色数组(索引0标题,1内容列表).
|
private |
行文字大小数组(索引0标题,1内容列表).
|
private |
表格资源数组(索引0标题行背景,1标题单元格背景,2内容列表行背景。3表格内容单元格背景).
|
private |
标题数组.
1.8.8