Cascade Versions Save

Nested popup menus with smooth height animations for Android

2.3.0

6 months ago

cascade-compose:

2.2.0

10 months ago

Update compose-ui to 1.5.0-beta02

2.1.0

10 months ago

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

10 months ago

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

1 year ago

Correctly publish sources

2.0.0-rc01

1 year ago

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 use CascadeState#isBackStackEmpty() instead.

2.0.0-beta1

1 year ago

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

3 years ago

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 by appcompat or MaterialComponents. If paddings are really desired, a custom CascadePopupMenu.Styler.background will have to be provided with paddings.

cascade_popup_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 ~steal~ override all popup menus of a Toolbar with cascade. This will override both overflow menu and sub menus for action items.
toolbar.overrideAllPopupMenus(with = ::CascadePopupMenu)

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

3 years ago

1.1.0

3 years ago
  • 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.