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

Pop-up not shown when used in a DrawerLayout/NavigationView #128

Open
HughJeffner opened this issue Oct 24, 2019 · 2 comments
Open

Pop-up not shown when used in a DrawerLayout/NavigationView #128

HughJeffner opened this issue Oct 24, 2019 · 2 comments

Comments

@HughJeffner
Copy link

I am using the spinner in the header layout of a NavigationView used in a DrawerLayout

When the app starts up everything works normally, but after selecting a navigation item in the NavigationView and re-opening the drawer the pop-up no longer shows when clicking on the spinner.

I traced back the problem to this line:

For some reason isLaidOut() returns false at that point socanShowPopup returns false. Not sure if this is some kind of interaction with the support libraries (I am using androidX) when running on newer API devices. I tested this on a few API levels and the problem seems to be happening on Nougat (API 24)+

As a work-around I added a listener to the drawer opened event and called requestLayout() on the spinner.

@AshutoshChakraborty
Copy link

Yes In my case also, I am using Spinner inside a RecyclerView as a child, the specified issue occurred.
I have also use the solution suggested @HughJeffner and use requestLayout() in My ViewHolder when i initialise the Spinner, and it works fine.

@eygraber
Copy link

eygraber commented Aug 14, 2020

Same problem here. Kinda gross to have to requestLayout in the ViewHolder, especially since the width and height are set correctly.

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

No branches or pull requests

3 participants