skydoves / PowerSpinner

🌀 A lightweight dropdown popup spinner, fully customizable with an arrow and animations for Android.
Apache License 2.0
1.2k stars 114 forks source link

The arrow toggle on empty list #16

Closed ShivamDev31 closed 4 years ago

ShivamDev31 commented 4 years ago

Please complete the following information:

Describe the Bug:

I've setup the spinner and the data has not been inflated in the spinner till now. So basically its an empty spinner till now. When I click on the spinner it toggles as per the implementation of setOnClickListener() in PowerSpinnerView. I tried to override setOnClickListener() but it did not work. So can you add a check in toggle() that it only toggles if list size > 0.

Something like this : if (adapter.getItems().isNotEmpty()) showOrDismiss() Need to add a getItems() in adapter classes which will return the list else can add a getSize() too which will return size only.

Expected Behavior:

It should not toggle the list, arrow should not animate.

ShivamDev31 commented 4 years ago

@skydoves Shall I raise a PR for the same?

skydoves commented 4 years ago

It is released on the new version 1.0.8.