STAR-ZERO / navigation-keep-fragment-sample

392 stars 63 forks source link

Using one navgraph xml #7

Closed deckyfx closed 5 years ago

deckyfx commented 5 years ago

Hello, thank you for your examples,

I attempt to make it works using with only one navgraph file instead of split it into multiple files or using fragment container class per BottomNavigationBar tab,

I also solved issue crash when re-navigate to same destination after hit back from it

Also tried to make it keep navigation state even after moving to another tab like this: Tab 1 -> Another Fragment in Tab 1 -> Tab 2 -> Another Fragment in Tab 2 -> Tab 3 Keep hit back button will navigate back like this Tab 3 -> Another Fragment in Tab 2 -> Tab 2 -> Another Fragment in Tab 1 -> Tab 1

can you help me to check it if anything wrong with this implementation? https://github.com/deckyfx/navigation-keep-fragment-sample/blob/using-one-navgraph/app/src/main/java/com/star_zero/navigation_keep_fragment_sample/navigation/KeepStateBackStackNavigator.kt

STAR-ZERO commented 5 years ago

Tab 1 -> Another Fragment in Tab 1 -> Tab 2 -> Another Fragment in Tab 2 -> Tab 3 Keep hit back button will navigate back like this Tab 3 -> Another Fragment in Tab 2 -> Tab 2 -> Another Fragment in Tab 1 -> Tab 1

Do you expect the above behavior?

Sorry, I can't understand. 🙇 Please tell me what you want and more information. 🙏

STAR-ZERO commented 5 years ago

Let me close 🙇