Fix wrongful elevation on app config change for floating toolbars

This commit is contained in:
Jays2Kings 2021-05-01 22:11:23 -04:00
parent 510773fd75
commit 1ab54487d1

View File

@ -225,11 +225,7 @@ fun Controller.scrollViewWith(
liftOnScroll.invoke(el) liftOnScroll.invoke(el)
} else { } else {
elevationAnim?.cancel() elevationAnim?.cancel()
val floatingBar = val floatingBar = (this as? FloatingSearchInterface)?.showFloatingBar() == true && !includeTabView
!(
activityBinding?.toolbar?.isVisible == true ||
(activityBinding?.tabsFrameLayout?.isVisible == true && includeTabView)
)
if (floatingBar) { if (floatingBar) {
activityBinding?.appBar?.elevation = 0f activityBinding?.appBar?.elevation = 0f
return@f return@f
@ -244,12 +240,7 @@ fun Controller.scrollViewWith(
elevationAnim?.start() elevationAnim?.start()
} }
} }
val floatingBar = if ((this as? FloatingSearchInterface)?.showFloatingBar() == true && !includeTabView) {
!(
activityBinding?.toolbar?.isVisible == true ||
(activityBinding?.tabsFrameLayout?.isVisible == true && includeTabView)
)
if (floatingBar) {
activityBinding?.appBar?.elevation = 0f activityBinding?.appBar?.elevation = 0f
} }
addLifecycleListener( addLifecycleListener(