Releases: saket/cascade
2.3.0
cascade-compose:
- Improve positioning of cascade menus, especially under Robolectric tests.
- Prevent cascade from covering the soft keyboard.
- Allow usages of
DropdownMenuHeader()
in root menus. - Add a shape parameter to
CascadeDropdownMenu()
as an alternative toMaterialTheme.shapes.extraSmall
. - #41: Ignore duplicate navigations.
- #43: Avoid limiting drop shadows to
8dp
if minSdk >= 31. - #39: Correctly set the tonal elevation for menu backgrounds. Thanks @MV-GH!
- Update
compose-ui
to 1.5.2.
2.2.0
2.1.0
This release depends on an alpha version of compose-ui
to fix a crash when cascade
is used with androidx.compose.ui:ui:1.5.0-alpha01
or newer versions.
2.0.0
This release promotes 2.0.0-rc02
to stable.
cascade
2.0.0 brings support for Compose UI. As usual, it is offering a a drop-in replacement for Material Design's DropdownMenu() composable with support for nested menus.
- DropdownMenu(
+ CascadeDropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false }
)
See project website for full documentation.
2.0.0-rc02
Correctly publish sources
2.0.0-rc01
New project website: https://saket.github.io/cascade
Compose UI
- Significant improvement in performance
- Nicer entry & exit animations than material3
0dp
vertical content paddings- Customizable shadow elevation (up to
8dp
)
Breaking changes
minSdk = 23
DropdownMenuHeader()
is no longer an extension function.CascadeState#navigateBack()
no longer returns a boolean. You can useCascadeState#isBackStackEmpty()
instead.
2.0.0-beta1
cascade
is getting ready for Compose UI. As usual, it is offering a a drop-in replacement for Material Design's DropdownMenu()
composable with support for nested menus.
- DropdownMenu(
+ CascadeDropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false }
)
implementation "me.saket.cascade:cascade-compose:2.0.0-beta1"
implementation "androidx.compose.material3:material3:..." // https://developer.android.com/jetpack/androidx/releases/compose-material3
Sample code
var expanded by rememberSaveable { mutableStateOf(false) }
CascadeDropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false }
) {
DropdownMenuItem(
text = { Text("Horizon") },
children = {
DropdownMenuItem(
text = { Text("Zero Dawn") },
onClick = { … }
)
DropdownMenuItem(
text = { Text("Forbidden West") },
onClick = { … }
)
}
)
}
1.3.0
New features
- Support for group dividers (thanks @waseefakhtar!).
- Internal paddings in the popup's background are trimmed automatically if they were picked up from the app's (XML) theme.
cascade
assumes that they were supplied byappcompat
orMaterialComponents
. If paddings are really desired, a customCascadePopupMenu.Styler.background
will have to be provided with paddings.
- Injectable back navigator:
// A "back" navigator can be used for setting up a menu's navigation before an instance of
// CascadePopupMenu can be created. This is especially useful for overriding Toolbar's popup
// menus where a CascadePopupMenu can only be created AFTER a menu item is clicked
// (to maintain backwards compatibility with PopupMenu).
val navigator = CascadeBackNavigator()
toolbar.menu.addSubMenu("Are you sure?").apply {
add("Cancel").setOnMenuItemClickListener {
backNavigator.navigateBack()
}
}
toolbar.overrideOverflowMenu { context, anchor ->
CascadePopupMenu(context, anchor, backNavigator = navigator)
}
- Experimental API to
stealoverride all popup menus of a Toolbar withcascade
. This will override both overflow menu and sub menus for action items.
toolbar.overrideAllPopupMenus(with = ::CascadePopupMenu)
- Ktx style extensions:
Fixes
- Prevent keyboard from getting recreated when cascade is shown.
- Disable drag-to-show gesture when overflow menu is overridden.
- Fix incorrect left spacing of menu items with
MaterialComponents
theme. - #23: Handle touch and key events on API 22 (thanks @kizitonwose!).
1.2.0
1.1.0
- Fixes a visual bug that many devices were facing with sub-menu transitions (#4)
- Adds a new API for using cascade as
Toolbar
’s overflow menu (instructions) - Filters out invisible menu items (#13, thanks @waseefakhtar!)
This release also adds a shared ViewPool for list items across sub-menus. This will benefit performance of popups with more than one sub-menus.