I have a really awkward problem that I cannot get rid of and that I absolutely do not understand.
I simply want my app bar to collapse and an image to move with some placeholder element in the app bar area. I got this from this example: https://github.com/saulmm/CoordinatorBehaviorExample
I use a very simple layout:
<CoordinatorLayout>
<AppBarLayout>
<CollapsingToolbarLayout
android:minHeight="96dp"
app:layout_scrollFlags="exitUntilCollapsed|scroll">
<FrameLayout android:id="@+id/anchorPlaceHolder .../>
</CollapsingToolbarLayout>
</AppBarLayout>
<NestedScrollView ...>
<ImageView
app:layout_anchor="@id/anchorPlaceHolder
...
/>
</CoordinatorLayout>
Everything works just as expected - EXCEPT for one massive bug. When the scrolling reaches its top end - aka the toolbar reaches its minimum height - my image simply disappears. It's "switched off" - and I don't know why and who's doing this.
I inspected the hierachy, but visibility is still "VISIBLE", not switched off or anything.
Can anybody explain what is going on here?