I have some problems with AppBarLayout and CollapsingToolbarLayout. This is what currently happens:
https://www.youtube.com/watch?v=z4yD8rmjSjU
The downwards scr
I ended up moving the orange bar out of the CollapsingToolbarLayout
and setting an OnOffsetChangedListener
that changes the translationY
of the top bar on the AppBarLayout
.
Setting the OnOffsetChangedListener
:
app_bar.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appbar, offset ->
topbar.translationY = Math.min(image.height.toFloat(), - offset.toFloat())
})
Layout: