Skip to content
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

Feature/multi selection support + selection handler refacoring #50

Open
wants to merge 71 commits into
base: master
Choose a base branch
from

Conversation

sonique6784
Copy link
Contributor

  • introduced a new ISelectableModel interface to store selection state, that need to be implemented by Cell, RH and CH in order to get a selection state
  • now selection state sit in each Cell, which prevent rendering issues.
  • introduced multiple selection
  • restored shadow selection display

Note: previous implementation was storing selection state into [Cell|RowHeader|ColumnHeader]ViewRecycler, which leaded to inconsistency in rendering (because RecyclerViews are re-used).

Cedric Ferry added 4 commits February 12, 2018 12:07
 - now selection state sit in each Cell (instead of the CellRecyclerView, so the recycler doesn't get confuse)
 - introduced a new ISelectableModel interface, that need to be implemented by Cell, RH and CH in order to get a selection state
 - introduced multiple selection
fixed multi-selection clear when change between cell , row or column selection
introduced multiselection in tableview sample
@sonique6784 sonique6784 force-pushed the feature/multiSelectionSupport branch 3 times, most recently from 6c8362a to 543ccea Compare February 12, 2018 22:30
Copy link
Contributor Author

@sonique6784 sonique6784 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed conflict with README, ready to review

@@ -49,8 +49,8 @@ protected boolean clickAction(RecyclerView view, MotionEvent e) {
int row = holder.getAdapterPosition();

// Control to ignore selection color
if (!mTableView.isIgnoreSelectionColors()) {
mSelectionHandler.setSelectedRowPosition(holder, row);
if (!mTableView.isIgnoreSelectionColors() && mTableView.isSelectable()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove "isIgnoreSelectionColors()" and keep "isSelectable()", I've the feeling it's accomplishing the same purpose.

@evrencoskun
Copy link
Owner

Hi @sonique6784

These days, I am pretty busy. So, I haven't reviewed your codes. That's why I didn't approve it yet. I just want to evaluate your approach by a cup of coffee at a more relaxed time.

After the reviewing process, I'll give you feedback.

Thank you very much for your collaboration. 👍

@sonique6784
Copy link
Contributor Author

No worries, it's a big chunk of code, take your time. thanks

@sonique6784
Copy link
Contributor Author

fixed conflict, ready to merge

@10erlosh
Copy link

10erlosh commented Dec 2, 2019

Hi @evrencoskun
any news on this?

@MGaetan89 MGaetan89 mentioned this pull request Apr 9, 2020
Copy link
Contributor

@MGaetan89 MGaetan89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some wording/code style comments. Feel free to take them into account if you wish.
I didn't really look at the logic itself.
You also have some conflicts to solve.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
/**
* Created by cedricferry on 8/2/18.
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line


public interface ISelectableModel {
AbstractViewHolder.SelectionState getSelectionState();
void setSelectionState(AbstractViewHolder.SelectionState selectionState);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line before the method

* Created by cedricferry on 8/2/18.
*/

public interface ISelectableModel {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can, it'd be nice to have the method of this interface annotated with @NonNull/@Nullable, based on your needs.

sonique6784 and others added 9 commits April 19, 2020 17:41
Co-Authored-By: Gaëtan Muller <[email protected]>
Co-Authored-By: Gaëtan Muller <[email protected]>
Co-Authored-By: Gaëtan Muller <[email protected]>
Co-Authored-By: Gaëtan Muller <[email protected]>
suggestion from MGaetan89

Co-Authored-By: Gaëtan Muller <[email protected]>
thanks to MGaetan89

Co-Authored-By: Gaëtan Muller <[email protected]>
moved the vertical detection AFTER checking if it the same RV. else it could set the mCurrentRVTouched to null and lead to unsync scrolling.
evrencoskun and others added 26 commits April 19, 2020 18:45
# Conflicts:
#	README.md
#	app/src/main/java/com/evrencoskun/tableviewsample/MainFragment.java
#	app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/Cell.java
#	tableview/src/main/java/com/evrencoskun/tableview/ITableView.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRowRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/ColumnHeaderRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/RowHeaderRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/handler/SelectionHandler.java
#	tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/CellRecyclerViewItemClickListener.java
# Conflicts:
#	README.md
#	app/src/main/java/com/evrencoskun/tableviewsample/MainFragment.java
#	app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/Cell.java
#	tableview/src/main/java/com/evrencoskun/tableview/ITableView.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRowRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/ColumnHeaderRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/RowHeaderRecyclerViewAdapter.java
#	tableview/src/main/java/com/evrencoskun/tableview/handler/SelectionHandler.java
#	tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/CellRecyclerViewItemClickListener.java
@sonique6784
Copy link
Contributor Author

@MGaetan89 @evrencoskun , I've fixed the conflicts and rested, it looks fine now.

@sonique6784
Copy link
Contributor Author

Screenshot_1587385425

@YoavSl
Copy link

YoavSl commented May 2, 2022

@sonique6784 @evrencoskun
Hey guys, any update on this? I really need the multiple row selection feature.
Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants