Library category page performance fixes (#7650)

* Don't compose category page unnecessarily

* Remove unnecessary library pager recompose

Defer and remember the "currentPage" state read since it's only needed when the
pager is composed for the first time.

* Badge opts

* Sync text style with previous impl

Also avoid reallocating by using copy
This commit is contained in:
Ivan Iskandar
2022-07-30 22:47:27 +07:00
committed by GitHub
parent f90e1b935c
commit d49ec41f3a
7 changed files with 68 additions and 63 deletions
@@ -61,8 +61,8 @@ fun LibraryScreen(
LibraryContent(
state = presenter,
contentPadding = paddingValues,
currentPage = presenter.activeCategory,
isLibraryEmpty = presenter.loadedManga.isEmpty(),
currentPage = { presenter.activeCategory },
isLibraryEmpty = { presenter.loadedManga.isEmpty() },
showPageTabs = presenter.tabVisibility,
showMangaCount = presenter.mangaCountVisibility,
onChangeCurrentPage = { presenter.activeCategory = it },