일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- kotlin list
- ExoPlayer
- list map
- android
- android custom view
- doc2vec
- ChatGPT
- 유튜브 요약
- 유튜브
- getChangePayload
- AWS EC2
- FastAPI
- ktor client
- Python
- ktor api call
- map
- DiffUtil.ItemCallback
- 시행착오
- 안드로이드
- exoplayer cache
- llm
- android ktor
- build with ai
- kotlin collection
- Zsh
- ListAdapter
- ListAdapter DiffUtil
- android exoplayer
- video caching
- 스피너
- Today
- Total
목록안드로이드 (6)
버튼 수집상

기본적인 건데 까먹는 바람에 스크롤 리스너 달아서 오프셋 값 저장하기 등등 쌩 난리를 쳤었다.. 다시 잊지 않도록 기록해둔다. 문제는 onBindViewHolder 가 호출되는 시점에 매번 RecylerView.Adapter를 세팅해주고 있었던 것. adapter를 최초 한 번만 세팅하면 전체 세로 스크롤을 오르내리면서 onBindViewHolder()를 부르더라도 뷰홀더 안 쪽의 가로 스크롤 위치가 유지된다. 수정 전 (제대로 안 돌아감) private val mAdapter = GoodsAdapter() override fun onBind(data: Any?, position: Int) { initUI(data) } private fun initUI(data: ModuleData) = with(bin..

배경 리사이클러뷰 안에서 다른 뷰홀더를 덮으면서 펼쳐지는 두 줄짜리 리스트를 구현해야 했다. 그래서 드롭다운 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...
배경 같은 종류의 데이터가 각기 다른 json 키 이름으로 들어오는 api 가 있었다. 구글의 gson 라이브러리는 json 키와 데이터 클래스 변수명을 1:1로 매핑시키므로 별도의 처리가 필요했다. 예시 데이터 클래스 data class TestResponse( // 키 이름이 다른 json 값들을 읽어서 List에 add. val areaList: List? ) { data class AreaData( @SerializedName("itemType") val itemType: String?, @SerializedName("imagePath") val imagePath: String? ) } 응답값 json { "banner1" : { "itemType" : "banner1", "imagePath" :..

themes.xml 파일에서 windowIsTranslucent=true 옵션을 지우고 앱을 다시 설치하니까 해결됐다. 관련 스택오버플로우 번역
배경 인트로에서 메인으로 넘어간 후, 웹뷰가 그려지기 전까지 하얀 화면이 비치는게 거슬렸다. 메인 액티비티 위에서 프래그먼트를 띄우는 방법밖엔 떠오르지가 않는다. 인트로 화면을 액티비티로 가져가면서 메인 액티비티에 웹뷰를 미리 그릴 수는 없는지 알아보면서 서치. Preloading an activity before displaying it? I am developing a game for android, it takes a few seconds of time to load everything before you can play. During this time or the splash screen, I would like to display a progress bar to show the ... stack..
스피너 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..