Skip to content

Releases: saket/cascade

2.3.0

08 Oct 06:57
Compare
Choose a tag to compare

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 to MaterialTheme.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

19 Jun 17:56
Compare
Choose a tag to compare

Update compose-ui to 1.5.0-beta02

2.1.0

27 May 13:34
Compare
Choose a tag to compare

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

24 May 05:02
Compare
Choose a tag to compare

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

17 Feb 06:49
Compare
Choose a tag to compare

Correctly publish sources

2.0.0-rc01

12 Feb 19:22
Compare
Choose a tag to compare

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

04 May 03:05
Compare
Choose a tag to compare

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

01 Feb 01:52
Compare
Choose a tag to compare

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

25 Nov 07:20
Compare
Choose a tag to compare
  • Fixes a critical bug that was causing cascade to crash on API 21 devices.
  • Works around a bug with PopupWindow, where the internal paddings set by the default popup background aren’t reset even if the background is changed (79ace48).

1.1.0

16 Oct 08:30
Compare
Choose a tag to compare
  • 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.