gabrielemariotti / cardslib

Android Library to build a UI Card
4.66k stars 1.19k forks source link

MultiChoice with Toolbar (AppCompat 21) results in "double" ActionMode #387

Open mkosik opened 9 years ago

mkosik commented 9 years ago

As described here: https://code.google.com/p/android/issues/detail?id=58321 The ActionMode of the ActionBarCompat is being constructed twice. I use Toolbar with AppCompat v21 build 21.0.3 and since 21.0.2 this issue should be resovled in support lib (as described here: http://stackoverflow.com/questions/26472469/appcompat-v21-throws-java-lang-unsupportedoperationexception ). So why it doesn't work with my GridView MultiChoice and still causes this problem? It's implemented exactly based on: https://github.com/gabrielemariotti/cardslib/blob/master/doc/CARDGRID.md#using-a-cardgrid-in-multichoicemode and before using Toolbar and AppCompat v21, everything worked fine. Yes you mention there that: "don't use with CardViewNative and/or Toolbar (not yet supported)" but why? What needs to be modified to make this multiselect work properly? I'm using the latest v1 stable: com.github.gabrielemariotti.cards:library:1.9.1

AkshayChordiya commented 9 years ago

@mkosik The developer of this library has said that he will be fixing it soon.

bignadad commented 9 years ago

I am having same issue and using latest 2.0.1

StudioEleven commented 9 years ago

I have the same problem .. something most likely related to the call of onItemLongClick in MultiChoiceAdapterHelperBase.onItemClick(AdapterView<?> parent, View view, int position, long id) . The long click triggers the display of a second action bar!

StudioEleven commented 9 years ago

It's the same as #376

darienalvarez commented 9 years ago

I am facing problems using your library cuz i can attach the ActionMode to the ToolBar (ActionBar is not enought for me).

I think that you just add a new method in the MultiChoiceAdapterHelperBase, where you attach the actionMode to a ToolBar.

And in the CardArrayMultiChoiceAdapter add a method that receive a toolbar instead of an Activity.

Thanks in advance, let me know if i can help.