bignerdranch / recyclerview-multiselect

DNA - An open-source library that we should likely deprecate. Unarchiving this repo will give us a chance to tie up any loose ends and deprecate it.
http://bignerdranch.github.io/recyclerview-multiselect
MIT License
415 stars 82 forks source link

Support per-item selectability #22

Open ened opened 8 years ago

ened commented 8 years ago

Right now, only all or none items can be set as selectable.

The MultiSelector should not use it's own "mIsSelectable" flag, but the SwappingHolder#isSelectable to decide what happens on a click.

jingibus commented 8 years ago

This behavior is supported right now by using a different MultiSelector for each selection set you want to configure.

On Mon, Mar 28, 2016 at 3:34 AM, Sebastian Roth notifications@github.com wrote:

Right now, only all or none items can be set as selectable.

The MultiSelector should not use it's own "mIsSelectable" flag, but the SwappingHolder#isSelectable to decide what happens on a click.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/bignerdranch/recyclerview-multiselect/issues/22

ened commented 8 years ago

Perhaps not. I'm looking for that behavior within a set.

Example: File browser lists files in a folder, and only the writable files can be marked for deletion.

jingibus commented 8 years ago

That can be accomplished by having a different ViewHolder type for writable files. Writable files are hooked up to the "deletion" MultiSelector, and non-writeable files aren't hooked up to it at all.

ened commented 8 years ago

Staying at the file manager example:

Ok but what if the same set SHOULD be selectable if the users wants to select for something beside deletion (like sharing).

I would probably refresh all items then and reload with new item types but that doesn't seem as efficient. Plus the viewHolder interface does provide a "isSelectable" method which does not seem used in the Selector.

jingibus commented 8 years ago

Then share would have a separate MultiSelector. On Mar 28, 2016 11:17 AM, "Sebastian Roth" notifications@github.com wrote:

Staying at the file manager example:

Ok but what if the same set SHOULD be selectable if the users wants to select for something beside deletion (like sharing).

I would probably refresh all items then and reload with new item types but that doesn't seem as efficient. Plus the viewHolder interface does provide a "isSelectable" method which does not seem used in the Selector.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/bignerdranch/recyclerview-multiselect/issues/22#issuecomment-202434185