MultiChoiceRecyclerView icon indicating copy to clipboard operation
MultiChoiceRecyclerView copied to clipboard

Need a way to restore original toolbar's icon / text

Open hardysim opened this issue 8 years ago • 4 comments

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.

hardysim avatar Jan 24 '17 13:01 hardysim

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

dvdciri avatar Jan 30 '17 17:01 dvdciri

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.

hardysim avatar Jan 31 '17 09:01 hardysim

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 wms mobile 01

active state wms mobile 02

returned to deselected state wms mobile 03

the first toolbar is dynamically set and in the third picture, it is reset to initial value and color.

Parlae avatar Oct 07 '20 10:10 Parlae

Hello again, I've solved my problem by proper use of .setTitles() and .setDefaultColor in MultiChoiceToolbar.Builder

all the best :)

Parlae avatar Oct 07 '20 13:10 Parlae