<android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.AppBarLayout>
...
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
<android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.FloatingActionButton
app:layout_behavior="kr.co.kbell.smartled.behavior.ScrollFABBehavior"/>
</android.support.design.widget.CoordinatorLayout>
</android.support.design.widget.CoordinatorLayout>
I'm currently using one more Coordinator Layout inside Coordinator Layout In it, we applied ScrollFABehavior (CustomBehavior) to show(), hide() FloatingActionButton whenever we scroll through RecyclerView.
The problem is that when FloatingActionButton is in the top CoordinatorLayout, Behavior's onNestedScroll callback method is invoked to hide, show The event does not occur when you are in the second Coordinator Layout.
Bottom Navigation View is being used as a fixed one. How do I operate the Behavior of Floating Action Button?
android
To use Coordinator Layout superimposed on an already existing CoordinatorLayout
, customization is required by implementing the NestedScrollingChild
interface. In a typical situation, events are passed on and "consumed" to those in the direct child hierarchy.
I'm attaching a link to help you. https://stackoverflow.com/questions/34181372/coordinatorlayout-inside-another-coordinatorlayout
© 2024 OneMinuteCode. All rights reserved.