Skip to content

Commit d7978ff

Browse files
committed
Improve README
1 parent 565ea24 commit d7978ff

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ModalBottomSheetDialogFragment
22
Modal bottom sheet dialog based on the [Material Guidelines](https://material.io/components/sheets-bottom)
3+
34
[![](https://jitpack.io/v/Commit451/ModalBottomSheetDialogFragment.svg)](https://jitpack.io/#Commit451/ModalBottomSheetDialogFragment)
45

56
<img src="/art/simple.png?raw=true" width="200px"> <img src="/art/header.png?raw=true" width="200px"> <img src="/art/custom.png?raw=true" width="200px">
@@ -53,9 +54,17 @@ ModalBottomSheetDialogFragment.Builder()
5354
.add(R.menu.options)
5455
.show(supportFragmentManager, "options")
5556
```
56-
Make sure that your activity or fragment implements `ModalBottomSheetDialogFragment.Listener`. For example:
57+
Make sure that your `Activity` or `Fragment` implements `ModalBottomSheetDialogFragment.Listener`. For example:
5758
```kotlin
5859
override fun onModalOptionSelected(tag: String?, option: Option) {
60+
when (option.id) {
61+
R.id.action_edit -> {
62+
// edit something
63+
}
64+
R.id.action_delete -> {
65+
// delete something
66+
}
67+
}
5968
Snackbar.make(root, "Selected option ${option.title} from fragment with tag $tag", Snackbar.LENGTH_SHORT)
6069
.show()
6170
}

0 commit comments

Comments
 (0)