Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the best practice show full screen fragment without independent from stack #236

Open
skyberk opened this issue Nov 5, 2020 · 1 comment

Comments

@skyberk
Copy link

skyberk commented Nov 5, 2020

Hi,

Firstly thank you for this awesome library,

I am using this library with bottom bar(bottom bar in my activity) but sometimes i need to push/show fragment without bottom bar. In this case user cannot switch selected tab. I am setting visibility gone to bottombar when pushing fragment whatever stack. When user navigate to back i am setting visibility visible to bottombar. But i am not sure about this way is correct.

Should i create match parent second FrameLayout for full screen fragments in my activity. But i think FragNav and supportFragmentManager manual usage can be conflict same time.

Also i don't want to start new activity for this case because multiple activities always can be dangerous as you know.

@Sh0rxy
Copy link

Sh0rxy commented Nov 21, 2020

I had the same problem a while ago and solved it via using two different FragNavControllers.
Since you have to declare a view as attaching point for your fragments in the initalisation process of your FragNavController, which you cannot change afterwards, you have to use two different Controllers to fulfill your needs.
I created one FragNavController which is being instantiated inside the Activity and handles Overlays that fill out the whole screen.
The second FragNavController gets created inside of the "MainFragment" that handles all the "tabbing" work of your application.
That means you have to move all your code that handles the tabs and the bottom bar from your activity to this newly created Fragment.

Alternatively it is also possible to use a DialogFragment. I did not look into workings of the DialogFragment yet, that means I am only making assumptions in the following.
I guess this will push itself over every view and viewgroup regardless of declared position of the view. But from your explanations

I assumed that you did not need a Dialog but a Fragment that covers the whole screen, so the second solution might not be what you are looking for.
Also your solution now is working, which, in my opinion, means, that it is a viable solution. On the other hand, my first proposal would result in a more organized and encapsulated code, what will help future you and others working with that code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants