일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- room
- Coroutine
- CoordinatorLayout
- CustomView
- activity
- lifecycle
- Algorithm
- BOJ
- LiveData
- DataBinding
- Navigation
- HTTP
- Behavior
- AppBarLayout
- onMeasure
- sqlite
- 코틀린
- 백준
- kotlin
- 안드로이드
- recyclerview
- 알고리즘
- CollapsingToolbarLayout
- 알림
- notification
- ViewModel
- Android
- hilt
- View
- onLayout
- Today
- Total
목록ItemDetailsLookup (2)
개발일지

SelectionObserver Selection에 Observer을 통해 콜백 함수를 작성할 수 있다. Selection이 되면 Delete Option Menu가 생기는 예제이다. addObserver(object : SelectionTracker.SelectionObserver() { override fun onSelectionChanged() { super.onSelectionChanged() val tracker = this@apply if (tracker.hasSelection() && menu.findItem(MENU_DELETE) == null) { menu.add(Menu.NONE, MENU_DELETE, Menu.NONE, "Delete") .setIcon(R.drawable.ic_de..

Selection Tracker RecyclerView에서 Item을 선택하는 기능을 제공한다. ex) 갤러리에서 사진 여러개 선택 Dependency dependencies { implementation "androidx.recyclerview:recyclerview:1.1.0" // For control over item selection of both touch and mouse driven selection implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc03" } 기본구조 RecyclerView에서 Select이 발생하면 Select된 ViewHolder의 Id를 Selection에 기록하고, onBindViewHolde..