1

I have used TransitionViewPager to create swiping effect in multiple fragments. And it is working all good, the problem lies in having common share button in action bar. I have Share button in action bar, and on clicking it the current fragment should show sharing view. Now only the active fragment where it landed at first shows the share button and none of the other swipe-able fragments show the Share view after click on Share.

Any help ?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
S.T.
  • 13
  • 8

1 Answers1

0

I am not very clear about your requirement but from above understanding I guess you need a share view (lets say a button) in multiple fragments on click of somewhere in the common action bar. Please correct me if I missed on something (or even if I got it completely wrong :)).

If this is the case, then on the click listener of your action bar button, check which fragment is currently visible using Fragments isVisible method. See here.

and after you have the reference you can easily show your corresponding sharing view for that fragment. Give it a try and lemme know if this works. Happy coding :)

Community
  • 1
  • 1
Atul O Holic
  • 6,692
  • 4
  • 39
  • 74