Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Popup Menu Option] #751

Closed
PartapSBimrah opened this issue Nov 10, 2019 · 12 comments
Closed

[Popup Menu Option] #751

PartapSBimrah opened this issue Nov 10, 2019 · 12 comments

Comments

@PartapSBimrah
Copy link

Description: I got an issue in the alpha version especially when we use the dark theme in an Android application. Please let me know and see the bug in the screenshot. Everywhere is black but only the popup menu shows some extra width around the menu.

Material Library version: Material Android Library version currently am using here ( implementation 'com.google.android.material:material:1.2.0-alpha01'`)

Device: Samsung Galaxy J6 Infinity

ScreenShot:
Screenshot_20191110-183124_Ai

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

@leticiarossi
Copy link
Contributor

Could you provide the source code/a sample app where the issue happens?

@PartapSBimrah
Copy link
Author

PartapSBimrah commented Nov 12, 2019

You can see the popup white color where the word is written Settings in the above screenshot. There is background white and black. Also, its height isn't less. Its height is more. Have any solution

Source:

override fun onCreateOptionsMenu(menu: Menu): Boolean {
        val inflater: MenuInflater = menuInflater
        inflater.inflate(R.menu.main_menu_activity, menu)
        return true
    }
override fun onOptionsItemSelected(item: MenuItem): Boolean {
        return when (item.itemId) {
            R.id.settings -> {
                this.startActivity(Intent(this, SettingsActivity::class.java))
                return true
            }
            else -> super.onOptionsItemSelected(item)
        }
    }

@hunterstich
Copy link
Contributor

Hey there. It would be great to get a complete, minimal sample app (including themes, styles, etc) that reproduces this issue so we can investigate where this is coming from.

@PartapSBimrah
Copy link
Author

PartapSBimrah commented Nov 13, 2019

@hunterstich Thanks for writing to me. Sure Everything I had complete write on the above message. Now I will be writing the theme or style code which is using for dark mode.


<style name="DarkModeTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="colorPrimary">#212121</item>
        <item name="colorPrimaryDark">#FC031113</item>
        <item name="colorAccent">#2196F3</item>
        <item name="backgroundColor">#F3020202</item>
        <item name="cardBackground">#FC1B1B1B</item>
        <item name="textColor">#ffffff</item>
        <item name="tintColor">#E9000000</item>
        <item name="buttonColor">#2196F3</item>
        <item name="viewColor">#3A3A3A</item>
        <item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
        <item name="iconTint">#ffffff</item>
        <item name="android:itemBackground">#F2000000</item>
        <item name="android:textColor">#ffffff</item>
        <item name="popupMenuStyle">@style/Widget.MaterialComponents.PopupMenu</item>
        <item name="actionOverflowMenuStyle">@style/Widget.MaterialComponents.PopupMenu.Overflow</item>
    </style>

Other rest of the code I already mentioned above including the dependency any other let me know.

implementation 'com.google.android.material:material:1.2.0-alpha01'

Menu.xml code is

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item android:id="@+id/settings"
        android:title="@string/settings"
        app:showAsAction="never"/>
</menu>

@iamAliRaza
Copy link

Hy i am also facing exact same issue ... in my case library version is stable
implementation 'com.google.android.material:material:1.0.0'

@leonardosibela
Copy link

I'm also facing the same problem. In my case the stable library version is
also 1.0.0

@UserGhost411
Copy link

try using
<item name="popupMenuBackground">#F2000000</item>
on your style

@sictiru
Copy link

sictiru commented Nov 16, 2020

On material 1.2.1 I could solve this problem only with

<item name="actionBarPopupTheme">@style/actionBarPopup</item>

<style name="actionBarPopup" parent="Widget.MaterialComponents.PopupMenu">
<item name="android:background">@color/transparent</item> (needed for smooth animation, otherwise it draws the view before populating the menu with items)
<item name="popupMenuBackground">@color/{color}</item>
</style>

@wcshi
Copy link
Contributor

wcshi commented Nov 16, 2020

Could someone please confirm whether the bug is in the latest 1.3.x version of the lib? Thanks!

@PartapSBimrah
Copy link
Author

try using
<item name="popupMenuBackground">#F2000000</item>
on your style

I have tried then asking you

@drchen
Copy link
Contributor

drchen commented Nov 5, 2021

Is this still reproducible with the latest library version? If so, can you please provide a minimal example app so we can reproduce the issue on our end?

@drchen
Copy link
Contributor

drchen commented Nov 23, 2021

I'll close the issue for now due to no further info available. Feel free to reopen it if you have more details to provide. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants