mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 01:59:19 +01:00
Fix emoji going crazy and fix tabs being visible when library is empty (#7811)
fixes #7792 fixes #7791
This commit is contained in:
parent
301cae13f0
commit
47b56644de
@ -38,12 +38,11 @@ fun EmptyScreen(
|
|||||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
)
|
)
|
||||||
|
show(message, actions)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.Center),
|
.align(Alignment.Center),
|
||||||
) { view ->
|
)
|
||||||
view.show(message, actions)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ fun LibraryScreen(
|
|||||||
state = presenter,
|
state = presenter,
|
||||||
contentPadding = paddingValues,
|
contentPadding = paddingValues,
|
||||||
currentPage = { presenter.activeCategory },
|
currentPage = { presenter.activeCategory },
|
||||||
isLibraryEmpty = { presenter.loadedManga.isEmpty() },
|
isLibraryEmpty = presenter.isLibraryEmpty,
|
||||||
showPageTabs = presenter.tabVisibility,
|
showPageTabs = presenter.tabVisibility,
|
||||||
showMangaCount = presenter.mangaCountVisibility,
|
showMangaCount = presenter.mangaCountVisibility,
|
||||||
onChangeCurrentPage = { presenter.activeCategory = it },
|
onChangeCurrentPage = { presenter.activeCategory = it },
|
||||||
|
@ -34,7 +34,7 @@ fun LibraryContent(
|
|||||||
state: LibraryState,
|
state: LibraryState,
|
||||||
contentPadding: PaddingValues,
|
contentPadding: PaddingValues,
|
||||||
currentPage: () -> Int,
|
currentPage: () -> Int,
|
||||||
isLibraryEmpty: () -> Boolean,
|
isLibraryEmpty: Boolean,
|
||||||
isDownloadOnly: Boolean,
|
isDownloadOnly: Boolean,
|
||||||
isIncognitoMode: Boolean,
|
isIncognitoMode: Boolean,
|
||||||
showPageTabs: Boolean,
|
showPageTabs: Boolean,
|
||||||
@ -59,7 +59,7 @@ fun LibraryContent(
|
|||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
var isRefreshing by remember(pagerState.currentPage) { mutableStateOf(false) }
|
var isRefreshing by remember(pagerState.currentPage) { mutableStateOf(false) }
|
||||||
|
|
||||||
if (showPageTabs && categories.size > 1) {
|
if (isLibraryEmpty.not() && showPageTabs && categories.size > 1) {
|
||||||
LibraryTabs(
|
LibraryTabs(
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
categories = categories,
|
categories = categories,
|
||||||
@ -100,7 +100,7 @@ fun LibraryContent(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
if (state.searchQuery.isNullOrEmpty() && isLibraryEmpty()) {
|
if (state.searchQuery.isNullOrEmpty() && isLibraryEmpty) {
|
||||||
val handler = LocalUriHandler.current
|
val handler = LocalUriHandler.current
|
||||||
EmptyScreen(
|
EmptyScreen(
|
||||||
R.string.information_empty_library,
|
R.string.information_empty_library,
|
||||||
|
@ -98,6 +98,8 @@ class LibraryPresenter(
|
|||||||
var loadedManga by mutableStateOf(emptyMap<Long, List<LibraryItem>>())
|
var loadedManga by mutableStateOf(emptyMap<Long, List<LibraryItem>>())
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
val isLibraryEmpty by derivedStateOf { loadedManga.isEmpty() }
|
||||||
|
|
||||||
val tabVisibility by preferences.categoryTabs().asState()
|
val tabVisibility by preferences.categoryTabs().asState()
|
||||||
|
|
||||||
val mangaCountVisibility by preferences.categoryNumberOfItems().asState()
|
val mangaCountVisibility by preferences.categoryNumberOfItems().asState()
|
||||||
|
Loading…
Reference in New Issue
Block a user