-
-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll TableView programmatically by the desired column position #21
Comments
I have added above 2 methods in AbstractTableAdapter class of library and calling both method in Fragment onCreateView() after setting Adapter. In my case scrollColumnHeader(position) scrolls header to specific position, but scrollCell(position) does not scroll cell columns to specific position. Can you tell me what I am doing wrong? |
Hi @gmcodebuster, The reason is TableView stores scroll position for Cell columns. In CellRecyclerViewAdapter, TableView sets each cell column scroll position when before each cell row is getting visible. See below code @Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
super.onViewAttachedToWindow(holder);
// The below code helps to display a new attached recyclerView on exact scrolled position.
CellRowViewHolder viewHolder = (CellRowViewHolder) holder;
((ColumnLayoutManager) viewHolder.m_jRecyclerView.getLayoutManager())
.scrollToPositionWithOffset(m_iHorizontalListener.getScrollPosition(),
m_iHorizontalListener.getScrollPositionOffset()); So, below functions don't work before TableView cell is not visible on screen. scrollCell(position);
scrollColumnHeader(position); You can say "What is the solution on my case ?" You need to find a way to call above codes after when all cell is visible. or You need to hack TableView source to change default values of or wait the newest version! See you |
Hi @gmcodebuster @sidharthshah, 0.8.5.4 version has been just released. With this version there are 2 helper method in TableView. These are ; tableView.scrollToColumnPosition(int column)
tableView.scrollToRowPosition(int row) These methods will help your request. Please test your issue with the newest version and let me know the result. |
Thanks for adding scroll to position in recent release. I will integrate it in code and inform you about result. |
@evrencoskun, |
Hi @sidharthshah,
It is actually pretty simple. If you checked the source code, you can see TableView occurs from 3 Skilled RecyclerViews.
If you want to scroll horizontally, you can use
scrollToPosition
method of LayoutManager.For example:
Below helper methods will be on the new version too. For now, you can insert them on your project.
The text was updated successfully, but these errors were encountered: