Skip to content

Commit

Permalink
Merge pull request #87 from sonique6784/patch-5
Browse files Browse the repository at this point in the history
Fixed cell mis-aligned with column headers
  • Loading branch information
evrencoskun committed Apr 29, 2018
2 parents 3980304 + 0cececd commit ea26c2d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.evrencoskun.tableview.filter.Filter;
import com.evrencoskun.tableview.handler.ColumnSortHandler;
import com.evrencoskun.tableview.handler.FilterHandler;
import com.evrencoskun.tableview.handler.ScrollHandler;
import com.evrencoskun.tableview.handler.SelectionHandler;
import com.evrencoskun.tableview.layoutmanager.CellLayoutManager;
import com.evrencoskun.tableview.layoutmanager.ColumnHeaderLayoutManager;
Expand Down Expand Up @@ -142,4 +143,11 @@ public interface ITableView {
* @return The FilterHandler of the TableView.
*/
FilterHandler getFilterHandler();

/**
* Retrieves the ScrollHandler of the TableView.
*
* @return The ScrollHandler of the TableView.
*/
ScrollHandler getScrollHandler();
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {

// The below code helps to display a new attached recyclerView on exact scrolled position.
CellRowViewHolder viewHolder = (CellRowViewHolder) holder;

int colpos = mTableAdapter.getTableView().getScrollHandler().getColumnPosition();
int colposoffset = mTableAdapter.getTableView().getScrollHandler().getColumnPositionOffset();

((ColumnLayoutManager) viewHolder.m_jRecyclerView.getLayoutManager())
.scrollToPositionWithOffset(mHorizontalListener.getScrollPosition(),
mHorizontalListener.getScrollPositionOffset());
.scrollToPositionWithOffset(colpos, colposoffset);

SelectionHandler selectionHandler = mTableAdapter.getTableView().getSelectionHandler();

Expand Down

0 comments on commit ea26c2d

Please sign in to comment.