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

Commit

Permalink
Minor bottom nav tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tunjid committed May 29, 2021
1 parent e38881a commit 3614302
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ private val Context.slices
) {
copy(statusBarColor = it)
},
Slice(
name = "Is immersive",
options = listOf(true, false),
getter = UiState::isImmersive
) {
copy(isImmersive = it)
},
Slice(
name = "Has light status bar icons",
options = listOf(true, false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.core.view.WindowInsetsControllerCompat
import androidx.core.view.doOnLayout
import androidx.core.view.isVisible
import androidx.core.view.updateLayoutParams
import androidx.core.view.updatePadding
import androidx.dynamicanimation.animation.FloatPropertyCompat
import androidx.dynamicanimation.animation.SpringAnimation
import androidx.dynamicanimation.animation.SpringForce
Expand Down Expand Up @@ -194,7 +193,8 @@ class GlobalUiDriver(
}

private fun updateBottomNav(state: BottomNavPositionalState) {
binding.bottomNavigation.updatePadding(bottom = state.navBarSize)
binding.bottomNavigation.softSpring(PaddingProperty.BOTTOM)
.animateToFinalPosition(state.navBarSize.toFloat())
binding.bottomNavigation.softSpring(SpringAnimation.TRANSLATION_Y)
.animateToFinalPosition(if (state.bottomNavVisible) 0F else uiSizes.bottomNavSize.plus(state.navBarSize).toFloat())
}
Expand Down

0 comments on commit 3614302

Please sign in to comment.