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

performClick() doesn't show Dropdown, Dialog or BottomSheet #24

Open
Daphne-CoffeeIT opened this issue Apr 9, 2020 · 6 comments
Open
Labels
bug Something isn't working

Comments

@Daphne-CoffeeIT
Copy link

Daphne-CoffeeIT commented Apr 9, 2020

Summary: performClick() doesn't work on MaterialSpinner: Dropdown, Dialog or BottomSheet doesn't show.

In my application, there is a holder around the Spinner. When this holder is clicked, the Spinner should show a Dropdown or Dialog. This works for the normal Spinner. Instead of a Dropdown or Dialog I need a BottomSheet and that's why I started using MaterialSpinner. Unfortunately, performClick() doesn't work for MaterialSpinner. No Dropdown, Dialog or BottomSheet is shown. I was wondering if there's a workaround for this or if this can be fixed.

holder.mStateSpinnerHolder.setOnClickListener(new View.OnClickListener() {
@Override
    public void onClick(View v) {
        holder.mStateSpinner.performClick();
    }
});

Edit: I extracted the code of this library to a project class and I added this method as a temporary workaround:

override fun performClick(): Boolean {
    popup.show(0)
    return super.performClick()
}

This shows the expected behaviour. Next to this method, maybe another method performClick(position: Int) should be added too to maintain the position, but this is not needed in all cases. Could this be updated in the library?

@tiper tiper added the bug Something isn't working label Apr 15, 2020
@tiper
Copy link
Owner

tiper commented Apr 17, 2020

Hi @DaphnevdVeeke can you try version master-3acdbe1cc8-1?

@Daphne-CoffeeIT
Copy link
Author

Hi @tiper, it seems that I cannot implement 'com.github.tiper:MaterialSpinner:1.4.2' yet, it fails to resolve. Since I don't have too much time today, I won't be able to manually add the entire library to the project before Thursday. I'll get back with you on Thursday or Friday (or earlier if 1.4.2 is released).

@tiper
Copy link
Owner

tiper commented Apr 20, 2020

Hi @DaphnevdVeeke you do not need to add the lib manually to your project, just use implementation 'com.github.tiper:MaterialSpinner:master-3acdbe1cc8-1'.

Cheers.

@Daphne-CoffeeIT
Copy link
Author

Still gives me errors.

image

@tiper
Copy link
Owner

tiper commented Apr 20, 2020

@DaphnevdVeeke sorry for the inconvenience if you still can, please try implementation 'com.github.tiper:MaterialSpinner:master-SNAPSHOT

@Daphne-CoffeeIT
Copy link
Author

@tiper No problem. That one works indeed. Unfortunately, performClick() is still not working. The BottomSheet is not showing up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants