D
D
dimasik1002002018-02-18 14:08:27
Java
dimasik100200, 2018-02-18 14:08:27

How to make it so that when using the viewpager, the floating action button remains in place, but the icon and functionality change?

I have a TabLayout with 2 tabs and a ViewPager. In each tab, you need to set your own FloatingActionButton functions (in one fragment, it performs one function, in another fragment, another). But it is necessary that when using the ViewPager, the button remains in its place with a change in the icon and its functionality. Whether it is possible to implement it somehow? (an example of such a function is in telegram x and whats app, but one application does not understand, in another this solution is very difficult to find)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2018-02-18
@zagayevskiy

On the viewpager, listener onPageChanged, in this listener, do whatever you want from the factory.

C
Comatu, 2018-02-18
@Comatu

Personally, an article from Habr "Secrets of Buttons" helped me in a similar situation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question