Fixed sidenav's padding

since google doesn't know how to
This commit is contained in:
Jays2Kings 2021-07-12 15:09:01 -04:00
parent e0e6ffb6d8
commit 72a74ea488

View File

@ -28,6 +28,7 @@ import androidx.core.content.ContextCompat
import androidx.core.graphics.ColorUtils
import androidx.core.net.toUri
import androidx.core.view.GestureDetectorCompat
import androidx.core.view.ViewCompat
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.bluelinelabs.conductor.Conductor
@ -233,18 +234,18 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
)
binding.bottomNav?.updatePadding(bottom = insets.systemWindowInsetBottom)
binding.sideNav?.updatePadding(
left = insets.systemWindowInsetLeft,
right = insets.systemWindowInsetRight
left = 0,
right = 0,
bottom = insets.systemWindowInsetBottom,
top = insets.systemWindowInsetTop
)
binding.sideNav?.updateLayoutParams<ViewGroup.MarginLayoutParams> {
topMargin = insets.systemWindowInsetTop
topMargin = insets.systemWindowInsetBottom
}
binding.bottomView?.isVisible = insets.systemWindowInsetBottom > 0
binding.bottomView?.updateLayoutParams<ViewGroup.LayoutParams> {
height = insets.systemWindowInsetBottom
}
}
// Set this as nav view will try to set its own insets and they're hilariously bad
ViewCompat.setOnApplyWindowInsetsListener(nav) { _, insets -> insets }
router = Conductor.attachRouter(this, container, savedInstanceState)