From e1b4fd39ce55c65b0b36f1aa97a258d4e6058d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Zago=C5=BCd=C5=BCon?= Date: Sat, 9 Jul 2022 16:39:52 +0200 Subject: [PATCH] Fix for unwanted behavior for some screen resolutions. https://github.com/Ramotion/navigation-toolbar-android/issues/13 --- .../com/ramotion/navigationtoolbar/DefaultItemTransformer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/navigation-toolbar/src/main/kotlin/com/ramotion/navigationtoolbar/DefaultItemTransformer.kt b/navigation-toolbar/src/main/kotlin/com/ramotion/navigationtoolbar/DefaultItemTransformer.kt index 10b6b93..0df35c9 100644 --- a/navigation-toolbar/src/main/kotlin/com/ramotion/navigationtoolbar/DefaultItemTransformer.kt +++ b/navigation-toolbar/src/main/kotlin/com/ramotion/navigationtoolbar/DefaultItemTransformer.kt @@ -140,7 +140,7 @@ open class DefaultItemTransformer currentRatio = max(0f, headerBottom / lm.workBottom.toFloat()) currentRatioWork = max(0f, (headerBottom - lm.workTop) / lm.workHeight.toFloat()) currentRatioTopHalf = max(0f, 1 - (ratioBottomHalf - min(max(currentRatio, ratioTopHalf), ratioBottomHalf)) / (ratioBottomHalf - ratioTopHalf)) - currentRatioBottomHalf = max(0f, (currentRatio - ratioBottomHalf) / ratioBottomHalf) + currentRatioBottomHalf = max(0f, min(1f,(currentRatio - ratioBottomHalf) / ratioBottomHalf)) } private fun updatePoints(lm: HeaderLayoutManager, header: HeaderLayout, up: Boolean) {