일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 알림
- sqlite
- kotlin
- 백준
- Algorithm
- 코틀린
- ViewModel
- notification
- Android
- lifecycle
- CollapsingToolbarLayout
- 안드로이드
- recyclerview
- CustomView
- onLayout
- Behavior
- BOJ
- AppBarLayout
- Navigation
- hilt
- activity
- LiveData
- HTTP
- Coroutine
- CoordinatorLayout
- 알고리즘
- onMeasure
- View
- room
- DataBinding
- Today
- Total
목록@InstallIn (2)
개발일지
Hilt Component 삽입을 실행할 때 @InstallIn 주석을 사용하여 참조할 수 있는 구성요소를 설정하고 구성요소에 맞는 대상에서만 삽입할 수 있다. Hilt Component 인젝터 대상 ApplicationComponent Application ActivityRetainedComponent ViewModel ActivityComponent Activity FragmentComponent Fragment ViewComponent View ViewWithFragmentComponent @WithFragmentBindings 주석이 지정된 View ServiceComponent Service Hilt Component Lifetimes Hilt는 Hilt Component별 Android Cla..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/E1KyE/btq0pwR9ZJp/wbM7sITvyOnCGBbpkqj8HK/img.png)
Hilt Module 생성자를 사용할 수 없는 Class를 주입해야 하는 경우 @Inject 생성자를 정의할 수 없습니다. (Interface, Builder를 통해 생성되는 Class, 외부 라이브러리 클래스 등) => Hilt Module을 통해 Class를 어떻게 얻는지 정의하여 의존성을 주입할 수 있습니다. @Module, @Installin @Module로 지정된 Class는 Hilt에게 인스턴스를 제공하는 방법을 알려줍니다. @Module로 지정된 Class는 @Installin을 지정하여 각 모듈이 어떤 Scope에서 사용되는지 알려야 합니다. @Provides 외부 라이브러리에서 제공되거나 Builder 패턴으로 제공되는 경우 @Provides를 통해 인스턴스를 제공하는 방법을 알려줄 수 ..