I have a FloatingActionButton
general and 3 Fragments
that are loaded with a ViewPager
Following the Google Design Guide , show that FloatingActionButton
is in parent
and not in each fragment
video: link
I have the following questions:
- Assign functionality depending on the fragment
- Change the icon
- Hide and show on each page change.
layout.xml
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:tint="@android:color/white"
app:srcCompat="@drawable/ic_send_black_24dp" />