skydoves / PowerMenu

:fire: Powerful and modernized popup menu with fully customizable animations.
Apache License 2.0
1.19k stars 174 forks source link

Incorrect item index with header #72

Closed khoben closed 3 years ago

khoben commented 3 years ago

Please complete the following information:

Describe the Bug:

createPowerMenu(this) {
    setHeaderView(R.layout.power_menu_header)
    ...
}.apply {
   setOnMenuItemClickListener { position, item ->
        position // incremented by one
   }
}

The item index is incremented by one if the headerView is set.

Expected Behavior:

Getting actual item index.