mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fixed missing search bar on library
very specific use case of " in landscape, go to a tab, come back to library tab, rotate to portrait"
This commit is contained in:
parent
c99ea17249
commit
9cea16a34e
2 changed files with 5 additions and 3 deletions
|
@ -283,7 +283,7 @@ class ExpandedAppBarLayout@JvmOverloads constructor(context: Context, attrs: Att
|
||||||
val smallHeight = -realHeight + shortH + tabHeight
|
val smallHeight = -realHeight + shortH + tabHeight
|
||||||
val newY = when {
|
val newY = when {
|
||||||
// for smaller devices, when search is active, we want to shrink the app bar and never
|
// for smaller devices, when search is active, we want to shrink the app bar and never
|
||||||
// extend it pass the compact state
|
// extend it pass the compact state
|
||||||
toolbarMode == ToolbarState.EXPANDED && compactSearchMode -> {
|
toolbarMode == ToolbarState.EXPANDED && compactSearchMode -> {
|
||||||
MathUtils.clamp(
|
MathUtils.clamp(
|
||||||
translationY,
|
translationY,
|
||||||
|
|
|
@ -526,7 +526,7 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||||
val isAppBarVisible = binding.appBar.isVisible
|
val isAppBarVisible = binding.appBar.isVisible
|
||||||
val needsAnim = if (showSearchBar) !binding.cardFrame.isVisible || binding.cardFrame.alpha < 1f
|
val needsAnim = if (showSearchBar) !binding.cardFrame.isVisible || binding.cardFrame.alpha < 1f
|
||||||
else binding.cardFrame.isVisible || binding.cardFrame.alpha > 0f
|
else binding.cardFrame.isVisible || binding.cardFrame.alpha > 0f
|
||||||
if (needsAnim && binding.appBar.useLargeToolbar && !onSmallerController &&
|
if (this::router.isInitialized && needsAnim && binding.appBar.useLargeToolbar && !onSmallerController &&
|
||||||
(showSearchAnyway || isAppBarVisible)
|
(showSearchAnyway || isAppBarVisible)
|
||||||
) {
|
) {
|
||||||
binding.appBar.background = null
|
binding.appBar.background = null
|
||||||
|
@ -542,7 +542,9 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||||
tA.duration = (abs(binding.cardFrame.alpha - endValue) * 150).roundToLong()
|
tA.duration = (abs(binding.cardFrame.alpha - endValue) * 150).roundToLong()
|
||||||
searchBarAnimation = tA
|
searchBarAnimation = tA
|
||||||
tA.start()
|
tA.start()
|
||||||
} else if (!binding.appBar.useLargeToolbar || onSmallerController || !isAppBarVisible) {
|
} else if (this::router.isInitialized &&
|
||||||
|
(!binding.appBar.useLargeToolbar || onSmallerController || !isAppBarVisible)
|
||||||
|
) {
|
||||||
binding.cardFrame.alpha = 1f
|
binding.cardFrame.alpha = 1f
|
||||||
binding.cardFrame.isVisible = showSearchBar
|
binding.cardFrame.isVisible = showSearchBar
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue