mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-18 00:39:18 +01:00
Show LibraryScreen toolbar early to match other main screens (#8285)
This commit is contained in:
parent
82b552ac9a
commit
a834ff3a44
@ -1,6 +1,5 @@
|
|||||||
package eu.kanade.presentation.library
|
package eu.kanade.presentation.library
|
||||||
|
|
||||||
import androidx.compose.animation.Crossfade
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.HelpOutline
|
import androidx.compose.material.icons.filled.HelpOutline
|
||||||
@ -38,10 +37,7 @@ fun LibraryScreen(
|
|||||||
onClickFilter: () -> Unit,
|
onClickFilter: () -> Unit,
|
||||||
onClickRefresh: (Category?) -> Boolean,
|
onClickRefresh: (Category?) -> Boolean,
|
||||||
) {
|
) {
|
||||||
Crossfade(targetState = presenter.isLoading) { state ->
|
Scaffold(
|
||||||
when (state) {
|
|
||||||
true -> LoadingScreen()
|
|
||||||
false -> Scaffold(
|
|
||||||
topBar = { scrollBehavior ->
|
topBar = { scrollBehavior ->
|
||||||
val title by presenter.getToolbarTitle()
|
val title by presenter.getToolbarTitle()
|
||||||
val tabVisible = presenter.tabVisibility && presenter.categories.size > 1
|
val tabVisible = presenter.tabVisibility && presenter.categories.size > 1
|
||||||
@ -69,6 +65,11 @@ fun LibraryScreen(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
|
if (presenter.isLoading) {
|
||||||
|
LoadingScreen()
|
||||||
|
return@Scaffold
|
||||||
|
}
|
||||||
|
|
||||||
val contentPadding = TachiyomiBottomNavigationView.withBottomNavPadding(paddingValues)
|
val contentPadding = TachiyomiBottomNavigationView.withBottomNavPadding(paddingValues)
|
||||||
if (presenter.searchQuery.isNullOrEmpty() && presenter.isLibraryEmpty) {
|
if (presenter.searchQuery.isNullOrEmpty() && presenter.isLibraryEmpty) {
|
||||||
val handler = LocalUriHandler.current
|
val handler = LocalUriHandler.current
|
||||||
@ -111,6 +112,4 @@ fun LibraryScreen(
|
|||||||
isDownloadOnly = presenter.isDownloadOnly,
|
isDownloadOnly = presenter.isDownloadOnly,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user