Fix action toolbar positioning (fixes #5099)
This commit is contained in:
parent
2a7ed1375a
commit
8870ccb18c
@ -13,7 +13,6 @@ import androidx.core.view.ViewCompat
|
|||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.marginTop
|
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.preference.PreferenceDialogController
|
import androidx.preference.PreferenceDialogController
|
||||||
@ -490,7 +489,7 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
|||||||
fun fixViewToBottom(view: View) {
|
fun fixViewToBottom(view: View) {
|
||||||
val listener = AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset ->
|
val listener = AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset ->
|
||||||
val maxAbsOffset = appBarLayout.measuredHeight - binding.tabs.measuredHeight
|
val maxAbsOffset = appBarLayout.measuredHeight - binding.tabs.measuredHeight
|
||||||
view.translationY = -maxAbsOffset - verticalOffset.toFloat() + appBarLayout.marginTop
|
view.translationY = -maxAbsOffset - verticalOffset.toFloat() + appBarLayout.paddingTop
|
||||||
}
|
}
|
||||||
binding.appbar.addOnOffsetChangedListener(listener)
|
binding.appbar.addOnOffsetChangedListener(listener)
|
||||||
fixedViewsToBottom[view] = listener
|
fixedViewsToBottom[view] = listener
|
||||||
|
Loading…
Reference in New Issue
Block a user