When using the Navigation library from AndroidX, I'd like to display a Fragment with a semi-transparent background on top of the old destination. So basically, instead of the FragmentNavigator doing ft.replace(mContainerId, frag)
inside its navigate() method, having a ft.add(mContainerId, frag)
instead.
I've tried subclassing FragmentNavigator
, but the API is very strongly limited (lots of private variables and package protected methods), thus not being able to properly override the navigate()
method in order to make that change.
So, what would be the correct method to achieve support for Fragments with transparent background using the Navigation library?
If what you are looking for is Dialog, then it is now fully supported as of 2.1.0-alpha03
You can achieve your intended behavior with dialog
destination which will show on top of your current destination.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With