Skip to content

Commit

Permalink
NewFeature: TableView columns can be sorted ascendingly or descendingly.
Browse files Browse the repository at this point in the history
  • Loading branch information
evrencoskun committed Nov 26, 2017
1 parent 9ecc0a8 commit 1a4649f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.evrencoskun.tableview.listener.ITableViewListener;
import com.evrencoskun.tableview.listener.scroll.HorizontalRecyclerViewListener;
import com.evrencoskun.tableview.listener.scroll.VerticalRecyclerViewListener;
import com.evrencoskun.tableview.sort.SortOrder;

/**
* Created by evrencoskun on 19/06/2017.
Expand Down Expand Up @@ -49,4 +50,6 @@ public interface ITableView {
int getSelectedColor();

int getUnSelectedColor();

void sortColumn(int p_nColumnPosition, SortOrder p_eSortOrder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ private void initialize() {
addView(m_jRowHeaderRecyclerView);
addView(m_jCellRecyclerView);

// Create Handlers
// Create Selection Handler
m_iSelectionHandler = new SelectionHandler(this);
m_iColumnSortHandler = new ColumnSortHandler(this);

initializeListeners();
}
Expand Down Expand Up @@ -237,6 +236,9 @@ public void setAdapter(AbstractTableAdapter p_iTableAdapter) {
}
if (m_jCellRecyclerView != null) {
m_jCellRecyclerView.setAdapter(m_iTableAdapter.getCellRecyclerViewAdapter());

// Create Sort Handler
m_iColumnSortHandler = new ColumnSortHandler(this);
}
}
}
Expand Down Expand Up @@ -349,7 +351,6 @@ public void sortColumn(int p_nColumnPosition, SortOrder p_eSortOrder) {
m_iColumnSortHandler.sort(p_nColumnPosition, p_eSortOrder);
}


/**
* Returns the index of the selected row, -1 if no row is selected.
*/
Expand Down

0 comments on commit 1a4649f

Please sign in to comment.