전체 글
-
리사이클러뷰 해부하기(2)
※ 본 포스팅은 이 링크의 내용을 번역한 글입니다. Anatomy of RecyclerView: a Search for a ViewHolder (continued) We continue our discussion of the way RecyclerView searches for a View at given position, which was started here… medium.com 리사이클러뷰가 주어진 position 을 기준으로 뷰홀더를 탐색하는 방법에 대해 이전 글(리사이클러뷰 해부하기(1))에 이어 논의해보겠습니다. 참고하기 쉽도록 리사이클러뷰가 뷰홀더를 탐색하는 과정을 다시 한 번 나열해보겠습니다. chaged scrap 탐색 attached scrap 탐색 removed 되지 않은 hidde..
-
리사이클러뷰 해부하기(1)
※ 본 포스팅은 이 링크의 내용을 번역한 글입니다. Anatomy of RecyclerView: a Search for a ViewHolder Intro medium.com Intro 리사이클러뷰는 거의 모든 안드로이드 앱 개발에 사용되기 때문에 개발자들이 리사이클러뷰를 다루는 것은 수백만명의 사용자들에게 영향을 끼칩니다. 그러나 리사이클러뷰를 "어떻게 사용하는지"에 대한 자료는 쉽게 찾아볼 수 있지만, "어떻게 동작하는지"에 대한 자료는 비교적 적은 것 같습니다. 복잡하고 다양한 커스터마이징과 성능 이슈가 많은 기능에 대한 "블랙박스 검사(소프트웨어를 내부 구조나 작동 원리를 모르는 상태에서 소프트웨어의 동작을 검사하는 것)"는 분명 좋지 않아 보입니다. Google I/O 2016 에서 소개되었던 R..
-
RecyclerView ViewHolder position vs bindingAdapterPosition
Note that unlike {@link android.widget.ListView}, RecyclerView will not call this method again if the position of the item changes in the data set unless the item itself is invalidated or the new position cannot be determined. For this reason, you should only use the position parameter while acquiring the related data item inside this method and should not keep a copy of it. If you need the posi..
-
RecyclerView 성능 개선하기
1. 모든 아이템 뷰의 크기가 동일하다면, hasFixedSize 를 true 로 설정하기 recyclerView.setHasFixedSize(true) RecyclerView can perform several optimizations if it can know in advance that RecyclerView's size is not affected by the adapter contents. RecyclerView can still change its size based on other factors (e.g. its parent's size) but this size calculation cannot depend on the size of its children or contents of its..
-
Git 라이브러리를 프로젝트 서브모듈로 추가하기
안드로이드 개발을 하다보면 자주 사용하는 기능들을 개인 라이브러리로 따로 모아놓고 여러 프로젝트에 동일하게 사용하고 싶을 때가 있습니다. Git Submodule 을 사용하면 여러 프로젝트에서 동일한 Git 라이브러리를 사용하고, 변경사항도 서로 공유할 수 있습니다. 다음과 같이 프로젝트와 라이브러리 레포지토리가 각각 존재할 때, mango-library 를 mango-app 에 서브모듈로 추가하는 방법을 알아보겠습니다. 프로젝트 레포지토리 : {username}/mango-app 라이브러리 레포지토리 : {username}/mango-library 1. 서브모듈 추가하기 프로젝트 터미널에서 다음 명령어를 통해 mango-library 를 해당 프로젝트의 sub-module로 추가합니다. $ git su..