일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
- 유튜브
- ansi2html
- FastAPI
- DiffUtil.ItemCallback
- getChangePayload
- llm
- map
- ktor client
- 독서
- ChatGPT
- android custom view
- 시행착오
- list map
- android exoplayer
- Python
- exoplayer cache
- ListAdapter
- doc2vec
- android ktor
- 안드로이드
- kotlin collection
- video caching
- 스피너
- build with ai
- ListAdapter DiffUtil
- ktor api call
- kotlin list
- AWS EC2
- android
- ExoPlayer
- Today
- Total
목록스피너 (2)
버튼 수집상
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bbUDBp/btsdi17o2Vl/Jnm9wkuRrZvvk5RRUPGxck/img.png)
배경 리사이클러뷰 안에서 다른 뷰홀더를 덮으면서 펼쳐지는 두 줄짜리 리스트를 구현해야 했다. 그래서 드롭다운 UI가 액티비티 최상위에 그려지는 스피너 Spinner 를 선택했다. (참고 PopUpWindow) 과제1 드롭다운 리스트가 펼쳐지고 닫히는 시점을 알기 위해 AppCompatSpinner를 상속하는 커스텀뷰를 만들고 리스너 인터페이스를 달았다. 참고한 스택오버플로우 답변 Spinner: get state or get notified when opens Is it possible to know whether a Spinner is open or closed? It would even be better if there was some sort of onOpenListener for Spinners...
스피너 Spinner 를 열지도 않았는데 뷰를 초기화하자마자 디폴트값으로 onItemSelectedListener를 탔다. 검색해보니, 아이템을 선택한 건지 아닌지 판별하기 위해서는 터치리스너를 빼서 플래그를 켜야하는 것 같았다. Android Spinner OnItemSelected ONLY on User Interaction I know that this question has been answered multiple times, but I have not found any of them satisfactory and certainly not elegant. The issue is that OnItemSelected gets fired not only when the u... stackoverflow..