What is the modal selection selection mode?

后端 未结 1 627
南旧
南旧 2021-02-05 16:33

When setting the selection mode of my ListView to multiple, I came across this constant introduced in Android API level 11: CHOICE_MODE_MULTIPLE_MODAL. The JavaDoc

相关标签:
1条回答
  • 2021-02-05 17:01

    This is used to bring up an action mode (a.k.a., contextual action bar) when using action bars. You will see it in apps like Gmail: as you start checking items in the list, the action bar changes from generic activity-level actions to operations to be performed on the list (e.g., change labels, trash).

    Like CHOICE_MODE_MULTIPLE, you need your ListView to be populated by Checkable items. Then, though, once one or more items are checked, Android will automatically pop up your chosen action mode, which you can configure with your own actions.

    Here is a sample project that demonstrates this: https://github.com/commonsguy/cw-omnibus/tree/master/ActionMode/ActionModeMC

    0 讨论(0)
提交回复
热议问题