0

My application uses only one Activity globally, and all the navigation components are in this Activity.

I have such a requirement that after selecting an item in ListFragment, Toolbar should enter selected mode. as follows:

enter image description here

enter image description here

How to achieve this mode switch?

excing
  • 55
  • 6

1 Answers1

0

We can use ActionMode, the guide: https://developer.android.com/guide/topics/ui/menus.html#CAB

If you use startActionMode to use ActionMode in the Fragment, and close it in Activity, you can override onActionModeStarted function in Activity and get ActionMode.

Mofity ActionMode style: How to specify dark action mode with my theme

Thank you for @DarShan

excing
  • 55
  • 6