Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

列表长度为0时,会出现adapter.getCount()为null(when the list's size equal 0, the project throw a exception that means adapter.getCount() is null) #162

Open
zhushenwudi opened this issue Apr 6, 2020 · 3 comments

Comments

@zhushenwudi
Copy link

modify the NiceSpinner.java:
@OverRide
public boolean onTouchEvent(MotionEvent event) {
if (isEnabled() && event.getAction() == MotionEvent.ACTION_UP && adapter != null) {
if (!popupWindow.isShowing() && adapter.getCount() > 0) {
showDropDown();
} else {
dismissDropDown();
}
}
return super.onTouchEvent(event);
}

@luncang
Copy link

luncang commented Jul 3, 2020

当列表是空列表时,各种bug,我在自己修改

@zhushenwudi
Copy link
Author

各位,推荐用这个
https://github.com/jaredrummler/MaterialSpinner
暂时没有发现大问题

@NicodeLee
Copy link

@zhushenwudi 这个自定义数据的List列表比较繁琐。需要自定义Adapter

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

No branches or pull requests

3 participants