terrakok / Cicerone

🚦 Cicerone is a lightweight library that makes the navigation in an Android app easy.
Other
2.58k stars 218 forks source link

Question: Check if back stack is empty #138

Open emartynov opened 3 years ago

emartynov commented 3 years ago

I can not find an easy way to get from the router if there is something in the back stack to pop.

terrakok commented 3 years ago

Yes, it's true cause router doesn't have direct access to navigator which works with fragment manager.
Navigator lives in UI lifecycle and can be destroyed any time.
Router is independent from UI lifecycle.

But if it necessary I can add Router.getCurrentStackSize(): Int? method which returns null when navigator does not available. What do you think?

aziko19 commented 1 year ago

when are you going to add this @terrakok . It's been 2 years already.