ncapdevi / FragNav

An Android library for managing multiple stacks of fragments
1.5k stars 220 forks source link

Return to root fragment with double click #151

Closed lensbreak closed 6 years ago

lensbreak commented 6 years ago

Hi

How can I let the user return to the root fragment with a double click on a particular tab in the bottom bar? Many Apps do this for usability reasons: The first click on the navigation tab switches to the page with a fragment where the user left, the second click on the same tab resets the fragment in the page back to the very root fragment (so the user doesn't need to hit the back button many times).

Thanks in advance for a hint how to do this. :)

gildor commented 6 years ago

Just call navController.clearStack() if user clicked on already selected tab