Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Commit 3614302

Browse files
committed
Minor bottom nav tweaks
1 parent e38881a commit 3614302

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/src/main/java/com/tunjid/androidx/tabmisc/UiStatePlaygroundFragment.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ private val Context.slices
119119
) {
120120
copy(statusBarColor = it)
121121
},
122+
Slice(
123+
name = "Is immersive",
124+
options = listOf(true, false),
125+
getter = UiState::isImmersive
126+
) {
127+
copy(isImmersive = it)
128+
},
122129
Slice(
123130
name = "Has light status bar icons",
124131
options = listOf(true, false),

app/src/main/java/com/tunjid/androidx/uidrivers/GlobalUiDriver.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import androidx.core.view.WindowInsetsControllerCompat
2121
import androidx.core.view.doOnLayout
2222
import androidx.core.view.isVisible
2323
import androidx.core.view.updateLayoutParams
24-
import androidx.core.view.updatePadding
2524
import androidx.dynamicanimation.animation.FloatPropertyCompat
2625
import androidx.dynamicanimation.animation.SpringAnimation
2726
import androidx.dynamicanimation.animation.SpringForce
@@ -194,7 +193,8 @@ class GlobalUiDriver(
194193
}
195194

196195
private fun updateBottomNav(state: BottomNavPositionalState) {
197-
binding.bottomNavigation.updatePadding(bottom = state.navBarSize)
196+
binding.bottomNavigation.softSpring(PaddingProperty.BOTTOM)
197+
.animateToFinalPosition(state.navBarSize.toFloat())
198198
binding.bottomNavigation.softSpring(SpringAnimation.TRANSLATION_Y)
199199
.animateToFinalPosition(if (state.bottomNavVisible) 0F else uiSizes.bottomNavSize.plus(state.navBarSize).toFloat())
200200
}

0 commit comments

Comments
 (0)