-
-
Notifications
You must be signed in to change notification settings - Fork 458
1.6. Creating a ClickListener
Evren Coskun edited this page Apr 11, 2020
·
2 revisions
To handle click actions of your TableView, you need to create a Class which implements ITableViewListener
interface.
ITableViewListener supports the following actions for Cell, ColumnHeader and RowHeader;
- Click
- Double Click
- Long Press
For example;
public class MyTableViewListener implements ITableViewListener {
/**
* Called when user click any cell item.
*
* @param cellView : Clicked Cell ViewHolder.
* @param columnPosition : X (Column) position of Clicked Cell item.
* @param rowPosition : Y (Row) position of Clicked Cell item.
*/
@Override
public void onCellClicked(@NonNull RecyclerView.ViewHolder cellView, int columnPosition, int
rowPosition) {
// Do what you want.
}
/**
* Called when user doubleclick any cell item.
*
* @param cellView : Clicked Cell ViewHolder.
* @param columnPosition : X (Column) position of Clicked Cell item.
* @param rowPosition : Y (Row) position of Clicked Cell item.
*/
@Override
public void onCellDoubleClicked(@NonNull RecyclerView.ViewHolder cellView, int columnPosition, int
rowPosition) {
// Do what you want.
}
/**
* Called when user long press any cell item.
*
* @param cellView : Long Pressed Cell ViewHolder.
* @param column : X (Column) position of Long Pressed Cell item.
* @param row : Y (Row) position of Long Pressed Cell item.
*/
@Override
public void onCellLongPressed(@NonNull RecyclerView.ViewHolder cellView, int column, int row) {
// Do What you want
}
/**
* Called when user click any column header item.
*
* @param columnHeaderView : Clicked Column Header ViewHolder.
* @param columnPosition : X (Column) position of Clicked Column Header item.
*/
@Override
public void onColumnHeaderClicked(@NonNull RecyclerView.ViewHolder columnHeaderView, int
columnPosition) {
// Do what you want.
}
/**
* Called when user doubleclick any column header item.
*
* @param columnHeaderView : Clicked Column Header ViewHolder.
* @param columnPosition : X (Column) position of Clicked Column Header item.
*/
@Override
public void onColumnHeaderDoubleClicked(@NonNull RecyclerView.ViewHolder columnHeaderView, int
columnPosition) {
// Do what you want.
}
/**
* Called when user click any column header item.
*
* @param columnHeaderView : Long pressed Column Header ViewHolder.
* @param columnPosition : X (Column) position of Clicked Column Header item.
* @version 0.8.5.1
*/
@Override
public void onColumnHeaderLongPressed(@NonNull RecyclerView.ViewHolder columnHeaderView, int
columnPosition) {
// Do what you want.
}
/**
* Called when user click any Row Header item.
*
* @param rowHeaderView : Clicked Row Header ViewHolder.
* @param rowPosition : Y (Row) position of Clicked Row Header item.
*/
@Override
public void onRowHeaderClicked(@NonNull RecyclerView.ViewHolder rowHeaderView, int
rowPosition) {
// Do what you want.
}
/**
* Called when user doubleclick any Row Header item.
*
* @param rowHeaderView : Clicked Row Header ViewHolder.
* @param rowPosition : Y (Row) position of Clicked Row Header item.
*/
@Override
public void onRowHeaderDoubleClicked(@NonNull RecyclerView.ViewHolder rowHeaderView, int
rowPosition) {
// Do what you want.
}
/**
* Called when user click any Row Header item.
*
* @param rowHeaderView : Long pressed Row Header ViewHolder.
* @param rowPosition : Y (Row) position of Clicked Row Header item.
* @version 0.8.5.1
*/
@Override
public void onRowHeaderLongPressed(@NonNull RecyclerView.ViewHolder rowHeaderView, int
rowPosition) {
// Do what you want.
}
}