question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[PopupMenu] Apply a shapeAppearance style to a PopupMenu

See original GitHub issue

I am using the latest version

com.google.android.material:material:1.1.0-alpha09

According to documentation it is possible to customize the component shapes using the shapeAppearanceOverlay attribute in the style.
These components should be supported:

  • Bottom Sheet
  • Button
  • Floating Action Button
  • Card
  • Chip
  • Dialog
  • Menu
  • Text Field

I am able to apply the attribute to these components except the Menu, in particular PopupMenu. I was looking for it in the material themes but I didn’t find it.
I tried something like that, but it doesn’t work:

  <!-- Popup Menu -->
  <style name="Widget.MyApp.PopupMenu" parent="@style/Widget.MaterialComponents.PopupMenu">
    <item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.MyApp.PopupMenu</item>   
  </style>

  <style name="ShapeAppearanceOverlay.MyApp.PopupMenu" parent="">
    <item name="cornerFamily">cut</item>
    <item name="cornerSize">32dp</item>
  </style>

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ghostcommented, Nov 22, 2019

Please support this. I am using the Solid Explorer and they customized it. It looks is so nice.

image image

0reactions
MuntashirAkoncommented, Jan 27, 2022

Just a side note: As expected, setting custom popup background (AKA the “hack”) no longer works with M3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Apply a shapeAppearance style to a PopupMenu
I am able to apply the attribute to these components except the Menu, in particular PopupMenu . I was looking for it in...
Read more >
PopupMenu - Android Developers
A PopupMenu displays a Menu in a modal popup window anchored to a View . The popup will appear below the anchor view...
Read more >
Migrating to Material Components for Android
This guide will show you how to migrate your codebase so you can make use of the new attributes, styles, and widgets.
Read more >
Change how graphs look in Grapher on Mac - Apple Support
Click the Coloring pop-up menu, choose a coloring style, then click the ... To change the shape's appearance, select the shape, then click...
Read more >
Popup Menu in Android With Example - GeeksforGeeks
In android, Menu is an important part of the UI component which is used to provide some common functionality around the application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found