Nested Navigators React Native - android

I am using TabNavigator as per this: https://reactnavigation.org/docs/navigators/tab.
The app already has Navigator from react-native to handle Navigation between different Screens. The Navigator is connected to the redux store. My problem is when I go to any screen after clicking on the button on Tab Screen it goes to the particular screen (Which is handled by Navigator) but while coming back it doesn't come back to the Tab Screen.
I also looked into https://reactnavigation.org/docs/intro/nesting but I want to do it with react Navigator.
Any suggestion/guide to this will be really helpful.

Related

I want to keep AddTransactionFragment while I navigate to other fragment with BottomNavigation (Android, Kotlin)

My problem is illustrated by this screen record.
When I click the FAB on FinanceFragment, it will open AddTransactionFragment. But when I navigate to ReminderFragment and go back to FinanceFragment, the AddTransactionFragment is destroyed.
How could I -- similar to the YouTube app when one switches between fragments -- keep AddTransactionFragment visible while I navigate to another fragment?
I tried to add addToBackStack() but this turned out not to be what I was looking for.

Android Jetpack Navigation BottomNavigationView and Login Screen

hope everybody is doing great,
I came across an issue while using the Navigation Component from Jetpack.
Here's what I want to achieve:
I have a LoginScreen where the users will input their credentials and then I'll send them to the MainScreen, which by its turn has a BottomNavigation. (the BottomNavigation has been always there, I just hide it when the LoginScreen is visible).
Everything looks good until here, I can navigate from the LoginScreen to the MainScreen, and if the user presses back then the application gets closed.
But the problem starts when the user switches to a different tab, let's say, go from tab 1 to 2 them to 3. (1 -> 2 -> 3). If the user presses back, he'll see Screen 2 instead of Screen 1. But if I remove the LoginScreen and go straight to the MainScreen where I have the tabs, if I click on tab 1, 2, and then 3, if I press back, then I'll see the Screen1.
This is how the flow looks like:
Here's the github repository which is basically a cloned from this plus the LoginScreen.
Thanks a lot,
Cheers

Get current screen name of drawer navigation

I'm using React Navigation for my react native app. Currently, my drawer have 5 menus. Let's assume there are Home screen, ScreenA, ScreenB, Screen,C, and ScreenD.
I want a behaviour like this
If user press back button on Android on Home Screen, the screen will show pop up
If user press back button on Android on other screen except Home Screen, the screen will navigate to Home Screen.
I also use Redux Integration and did all the setup as described in React Navigation's documentation.
Need your help guys. Thanks

Prism Navigation in Xamarin Forms - MasterDetailPage

I have a master detail page setup using Prism 6.3 pre-2, I've finally got it working as I expected for navigating to "detail" pages; so the hamburger button shows the slide drawer and I have a simple ListView bound to the ViewModel, I list some items, and I use the NavigateCommand to navigate correctly.
Now, the expected behaviour (in Android), is when you've navigated to other items in the slide-out menu, you should be able to use the hardware back button to navigate back to the very first "detail" page shown.
For example, say your app has this setup, and the items listed are Inbox, Drafts, and Sent. The default view is going to be whatever you decide is the default detail view, in this example, it will most likely be Inbox. So if I navigate to Sent, and then press back, it should go back to Inbox, also, if I go to Sent -> Drafts, and then press back, it should go back to Inbox, as this is the default starting point, if you then press back again, the app should exit. At the moment, using Prism navigation, no matter what page you navigate to using this setup, it will exit straight away.
Please note, I have set it up correctly, I essentially have something like this (as an exmaple):
await NavigationService.NavigateAsync("RootPage/BaseNavigationPage/InboxPage");
When I navigate to say another page like Sent, the relative URI is like so:
"BaseNavigationPage/SentPage"
Now, when back is pressed, it should go back to the InboxPage, I'm not sure how this can be fixed... Brain...???
In addition to this, there is one other unexpected behaviour that is missing.
If I want to show a modal page whilst using a Master Detail Page, it doesn't work as any app written by Google does... This is easy to see if you open any google app that has this layout. If you show a modal window for say Settings, it pops up, has the navigation title set and a back arrow, basically looks exactly the same as if you've navigated one step further down like:
"RootPage/BaseNavigationPage/InboxPage/EmailPage"
However, I expected this functionality to be available if I did the following:
"BaseNavigationPage/SettingsPage", useModalNavigation:true
If you simply play around with any Google made application you'll see these features, and these are what I expect and they feel natural.
Any help available to achieve this...? again...Brian...?
All of this should be simple, but it's proving not to be...
To get the behavior you are wanting with the NavigationPage in a MasterDetailPage scenario, you must create a custom NavigationPage that implements INavigationPageOptions and set the ClearNavigationStackOnNavigation property to false. This will kep the NavigationPage's navigation stack in place with each navigation operation.
As to your other "expected behavior" regarding modal navigation, your understandings about modal navigation are wrong. Modal navigation does not provide a software back button. Any time you want a software back button you must have the pages wrapped in a NavigationPage,

How should I design Navigation from SignIn/SignUp View Controllers?

My app requires users to sign in or sign up upon the app loading. At the moment I have the flow so that there is a navigation controller controlling the sign In and sign Up VCs, and once the user successfully signsIn/Up (Via Parse), the VC pushes(show segue) to the Tab Bar Controller which is the main layout of the app.
This definitely doesn't seem like the right way to go about designing the navigation. It doesn't seem right to have to hide the back button for navigation upon entering the tab bar (from the sign in/up). How should I design this?
I realize that once I have a user saved locally I can set the rootview controller in the appDelegate to the tab Bar.
Thank you for any help.

Categories

Resources