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

Bottom Navigation issues #1139

Closed
2 tasks
iamareebjamal opened this issue Feb 20, 2019 · 11 comments
Closed
2 tasks

Bottom Navigation issues #1139

iamareebjamal opened this issue Feb 20, 2019 · 11 comments

Comments

@iamareebjamal
Copy link
Member

iamareebjamal commented Feb 20, 2019

  • Each time I go to events section, it is reloading
  • Each time I go to Tickets section, it is reloading

This should not happen

@liveHarshit
Copy link
Member

Issue #1078 for events section.

@angmas1
Copy link
Contributor

angmas1 commented Feb 21, 2019

Can I work on this?

@anhanh11001
Copy link
Contributor

@iamareebjamal @liveHarshit I have investigated this issue over the last 2 days. For my own knowledge now, it's clueless for me to fix this issue.

So basically the problem I found is that in the MainActivity, we set up the bottom navigation with navController:
setupWithNavController(navigation, navController)
From what I understand, everytime we click on a bottom navigation's icon, the navController will use the method navigate() to change the fragment in the container, and then clear(pop) all the fragment in the backstack. So if we use navigation with navController here, I don't find a way to keep all the old fragments.

I have tried to research on Singleton pattern to make each fragment a single instance, but I didn't find anything helpful. I also tried to save old fragments by using supportFragmentManager to save the fragment with tag but it made the code really complex and it would take a lot of time to refractor.

Please give some advices or correct me if something is not right

@liveHarshit
Copy link
Member

So basically the problem I found is that in the MainActivity, we set up the bottom navigation with navController:
setupWithNavController(navigation, navController)
From what I understand, everytime we click on a bottom navigation's icon, the navController will use the method navigate() to change the fragment in the container, and then clear(pop) all the fragment in the backstack. So if we use navigation with navController here, I don't find a way to keep all the old fragment

Please read comments in issue #1078. It is already discussed.

@liveHarshit
Copy link
Member

I also tried to save old fragments by using supportFragmentManager to save the fragment

It was used earlier, but now we want to do it with navigation architecture component.
You can see the method in utils for check and load fragment. It is still there.

@anhanh11001
Copy link
Contributor

is anyone working on these issues? Can I work on this?

@sdew021
Copy link

sdew021 commented Dec 31, 2019

hey @iamareebjamal i see that this issue is still open, if no one has picked it, can i take up this issue and start working on it

@iamareebjamal
Copy link
Member Author

yes if you can still reproduce it

@YugN17
Copy link

YugN17 commented Oct 28, 2020

i want to work on this
can you assign me

@YugN17
Copy link

YugN17 commented Oct 28, 2020

@mariobehling i want to work on this can you assign me

@iamareebjamal
Copy link
Member Author

We don't assign issues. Please send a PR

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

Successfully merging a pull request may close this issue.

7 participants