티스토리 뷰
From the previous blog, how can we dismiss loadin spinner after data has been loaded.
SectionLifecycle.dispatchLoadingEvent
We can send loading event to GroupSection
to stop loading. We can simple add one line of code to onDataLoaded()
.
HeroesComponent.dispatchLoadingEvent(c, false, LoadingEvent.LoadingState.SUCCEEDED, null)
Your onDataLoaded()
will look like following now.
@OnEvent(HeroModel::class)
fun onDataLoaded(c: SectionContext, @FromEvent heroes: List<Hero>) {
HeroesComponent.onUpdateData(c, heroes)
HeroesComponent.dispatchLoadingEvent(c, false, LoadingEvent.LoadingState.SUCCEEDED, null)
}
Now, it's working fine.
'Android > Litho' 카테고리의 다른 글
6. StateValue (0) | 2019.11.10 |
---|---|
5. HeroItemSpec (0) | 2019.11.10 |
4. GroupSection Spec LifeCycle (0) | 2019.11.09 |
3. Sample Application - HeroesComponentSpec (0) | 2019.11.09 |
2. Sample Application - Intialisation (0) | 2019.11.09 |
댓글