Skip to content

Commit

Permalink
Prepare to release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saket committed Oct 16, 2020
1 parent 28f8367 commit e266649
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`cascade` builds nested popup menus with smooth height animations. It is designed to be a *drop-in* replacement for [PopupMenu](https://developer.android.com/reference/androidx/appcompat/widget/PopupMenu) so using it in your project is beautifully only a word away. Try out the [sample app](https://github.com/saket/cascade/releases/download/1.0.0/cascade_v1.0.0_sample.apk) to see it in action.

```groovy
implementation "me.saket.cascade:cascade:1.0.0"
implementation "me.saket.cascade:cascade:1.1.0"
```

```diff
Expand All @@ -15,6 +15,18 @@ implementation "me.saket.cascade:cascade:1.0.0"
popup.show()
```

#### Use as Toolbar's overflow menu

```kotlin
toolbar.overrideOverflowMenu { context, anchor ->
CascadePopupMenu(context, anchor)
}

// The lambda can be collapsed into a reference
// if you're only using the two-param constructor.
toolbar.overrideOverflowMenu(with = ::CascadePopupMenu)
```

### Customization

`cascade` is great for apps that prefer applying dynamic themes at runtime, which `PopupMenu` makes it extremely hard to do so. By providing a `CascadePopupMenu.Styler` object, you can adjust colors, spacings and text styles from Kotlin ([example](https://github.com/saket/cascade/blob/038bbf054657c243ae62f2d780e5488ed54fcafb/sample/src/main/java/me/saket/cascade/sample/MainActivity.kt#L93-L111)).
Expand Down Expand Up @@ -60,8 +72,8 @@ popup.menu.addSubMenu("Remove").also {

```kotlin
val popup = CascadePopupWindow(context)
popup.contentView.goForward(CustomMenuView(context)) // Also see goBack().
popup.showAsDropdown(anchor, ...)
popup.contentView.addView(CustomMenuView(context)) // Also see goBack().
popup.show(anchor)
```

## License
Expand Down
2 changes: 1 addition & 1 deletion cascade/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GROUP=me.saket.cascade
POM_ARTIFACT_ID=cascade
VERSION_NAME=1.1.0-SNAPSHOT
VERSION_NAME=1.1.0

POM_NAME=cascade
POM_PACKAGING=aar
Expand Down

0 comments on commit e266649

Please sign in to comment.