zawadz88 / MaterialPopupMenu

Shows Material popup menus grouped in sections & more
Apache License 2.0
646 stars 57 forks source link

Add option to keep popup open after clicking on item #45

Closed Tunous closed 5 years ago

Tunous commented 5 years ago

Adds a way to specify for each item whether clicking on it should dismiss the popup or keep it visible. It can be specified by setting the dismissOnSelect property.

Example

val popupMenu = popupMenu {
     section {
        /* ... */
        item {
            label = "Stay open when clicked"
            dismissOnSelect = false
            callback = {
                Toast.makeText(this@LightActivity, "Clicked!", Toast.LENGTH_SHORT).show()
            }
        }
    }
}

2019-04-14_13-15-39