MultiChoiceRecyclerView
MultiChoiceRecyclerView copied to clipboard
Need a way to restore original toolbar's icon / text
I'm using the new version 2.0.0 and MultiChoiceToolbar. Here I need to set an icon and text because it's removed otherwise when the selection is "aborted".
Because I'm using a NavigationDrawer I have the nice hamburger icon but normally it's animated when the drawer is slided. Even when setting the same icon (which I then need to include) the icon looks the same but is no longer animated.
Plus, I'm using the RecyclerView in a Fragment in an Activity and the latter is in charge of the toolbar. This works but I need to get the toolbar-title from the activity again.
It would be great, when the lib would store the previous values for icon / text before "replacing the toolbar" (change those values). When "reverting" to the normal state (not selected any more) the old values should be applied again. This would give us some kind of "toggle" like using the legacy ActionMode.
At the moment you can use the MultiChoiceToolbar.Builder to specify the icon and the click listener, it'll be restored once the state is set to NORMAL. Is that what you're saying?
https://github.com/dvdciri/MultiChoiceRecyclerView/blob/master/library/multichoicerecyclerview/src/main/java/com/davidecirillo/multichoicerecyclerview/MultiChoiceToolbar.java#L111
No, this is what I can do for now but not what I need ;-)
I want to restore the complete state before the lib modifies the toolbar. See the last paragraph in https://github.com/dvdciri/MultiChoiceRecyclerView/issues/36#issuecomment-276310356.
Hello all, I also have this issue. I need to restore the color and text of the toolbar to the previous state. Here are the screenshots which illustrate the problem:
Initial state

active state

returned to deselected state

the first toolbar is dynamically set and in the third picture, it is reset to initial value and color.
Hello again,
I've solved my problem by proper use of .setTitles() and .setDefaultColor in MultiChoiceToolbar.Builder
all the best :)