Hi is it just me? or are Jetpack Compose "Out of t...
# compose
t
Hi is it just me? or are Jetpack Compose "Out of the box" Dropdown menus "underwhelming"? shouldnt it be easier to add item dividers, ripple effect when items clicked, elevation changes etc or am i missing something? 🤔
👍🏻 1
k
Material components do not "claim" to be as configurable as some people expect them to be. They are implementing a very particular design system, and the more you depart from it, the more it nudges you towards implementing your own components.
c
☝️ And don’t forget that the Material components are usually very small, opinionated wrappers on top of more generic components. If you need to diverge from the Material spec for any given component, it’s easy enough to copy the source for the original component and tweak it to your needs. This helps keep the material components themselves from being overwhelmingly configurable, while still giving you the option to customize things as you need. This philosophy is outlined in the Architectural Layering documentation
t
points well made, however a "Ripple" effect when a menu item is clicked doesnt seem too much to ask as "default" behaviour or indeed being able to add menu item dividers. these two seem pretty basic IMHO 😄
c
There’s definitely a ripple by default on
DropdownMenuItem
, I just checked it myself. Note that the dropdown doesn’t hide itself when you click an item, so it’s probably that you’re doing something like
DropdownMenuItem(onClick = { handleClick(); dropdownIsVisible = false })
, which will hide the entire dropdown before the animation gets a chance to run. So if you want the animation there, you may need to add a delay yourself so it is visible
🙌 1
And the standard
Divider()
works perfectly fine within the dropdown content, too
t
ooh 😞 the divider was very badly aligned when i tried it 🤦‍♂️ i have the Now In Android catalog app and i cannot see a ripple, maybe its my eyesight 😉