我正在尝试使用 MotionLayout 视图来获得折叠工具栏的行为。我的方法与此处的示例类似:https ://blog.stylingandroid.com/motionlayout-collapsing-toolbar-part-1/
这工作正常,但即使 recyclerview 为空或条目少于屏幕上的条目,也可以在滑动时开始转换。
如果回收器实际上能够滚动,有没有办法只启用 MotionLayout 过渡?
我的 OnSwipe 描述:
<OnSwipe
app:dragDirection="dragUp"
app:maxAcceleration="40"
app:moveWhenScrollAtTop="true"
app:touchAnchorId="@id/recycler"
app:touchAnchorSide="top" />