我要删除附件屏幕中显示的突出显示的空间。我使用下面的代码来产生这种滑动效果。
[
private fun customizeNavigationDrawerToMakeEffect() {
binding.drawerLayout.setScrimColor(Color.TRANSPARENT)
val actionBarDrawerToggle =
object : ActionBarDrawerToggle(this, binding.drawerLayout, R.string.ok, R.string.cancel) {
private val scaleFactor = 6f
override fun onDrawerSlide(drawerView: View, slideOffset: Float) {
super.onDrawerSlide(drawerView, slideOffset)
val slideX = drawerView!!.width * slideOffset
binding.content.translationX = slideX
binding.content.scaleX = 1 - slideOffset / scaleFactor
binding.content.scaleY = 1 - slideOffset / scaleFactor
}
}
binding.drawerLayout.addDrawerListener(actionBarDrawerToggle)
}