How to change Jetpack compose navigation component backstack behaviour? - android-jetpack-compose

I implemented the login, sign-up with jetpack compose on an app. I redirected the logged-in users to the main screen and keep the new user on to the login screen. But the problem is when I redirect the user from the login screen to the main screen and the user press the back button the login screen appears. Now I know it's a normal behavior of the navigation component but I need to change it. How can I do that?
Used this line for navigating to the main screen from the login screen
navController().navigate("main_screen")

You can remove last item from the back stack before navigating to the main screen using popBackStack:
navController.popBackStack()
navController.navigate("main_screen")

Related

How to know when a controller unload in Swift

In my iOS application I have a login page that leads to the main pages. You can navigate between these pages with a tab bar. On each of these pages you can log out and return to the login page using the dismiss function. I wanted to know if by doing this I was leaving some controllers in a vacuum without having unloaded them.
For example, if I log in, go to the second tab and log out, will the first tab be unloaded?
And more broadly how does navigation with a tab bar work if it's not a stack?
On successfull login change root of application to TabBarController.When user kill application and launch again then set root according to the login status of a user. And when user logout from application then again change root to login controller.
Please check attached link

Adding a button to user home screen

I would like to ask if there is a possibility to add button into user homescreen. Let's assume I have an app, when user do something with app I want to add a button into user homescreen. I'm thinking about something similar to "Add to Home Screen" from Safari app.
You can add web link icon on home screen, and no way you can add some buttons with custom actions on home screen. Every "button" is application or link icon and nothing more

Best way to realize multi page site in Vaadin

I'm working on pretty simple web side that cointains login screen (almost same as in demo presentation, white page with login and password) and main screen with sidebar and navigation bar. How should it be done? My plan is to build main screen using navigation bar, sidebar (just few buttons in layout basicly) and few layouts with content of the webside. On each button click change layout used to create content to another one, for example for Schudele button I'm gonna load layout that contains some tables, for About button plain text. Is it good idea?
So finnaly is should look like this:
init() function decides if user is logged or not and display Login page or Main page, Main Page is builded from modules like navbar, sidebar and content, content depends on sidebar buttons click. I'm right?
Handling it on your own is legit way to start or learn Vaadin. If you have a first grasp of this works out, the most common way to handle such a scenario is the use of the Navigator See the book of Vaadin.
With the Navigator you define Views and give them a name, register them with the Navigator. Then you can navigate your application with the Navigator, it takes care to give you nice ...#!view... URLs so the Users can have bookmarks and navigate your app also e.g. with the back button in the browser.
The Navigator hooks into an event system, where listeners (ViewChangeListener) can react to "before enter" and "leave". The "before enter" can be used to realize auth needs, since they are allowed to object entering a view.

Jquery mobile navigation stack when logout and go back to login

My phonegap app, I want to bring back login when user logs out. But If I use,
$.changePage('#login');
after logout. It makes navigation stack unmanageable specially navigating with Android back Button . Can I reset my Navigation stack after logout.
Try using
$.mobile.navigate('#login');

iPad Safari Home Screen website gets stuck on Facebook Login

I have a website that uses the JavaScript SDK, and I have a facebook login button that calls FB.login() that opens a new tab for the user to log in.
This website is optimized for the iPad, and I made a home screen entry for this website so it could be viewed in full screen, like how this article mentions it:
http://www.viaboxxsystems.de/html-fullscreen-apps-for-the-ipad
My problem is that only in the home-screen-launched, fullscreen version, when I click on the login button, either I see a white screen, or I get the login details screen (but in that case, clicking "Log In" also results in a white screen), and thus I get to a dead end.
How do I make it so the Facebook login goes through and I get redirected back to my website successfully?
Apple’s documentation for this says,
When you use this standalone mode, Safari is not used to display the web content—specifically, there is no browser URL text field at the top of the screen or button bar at the bottom of the screen.
Sounds to me like this might also affect the ability to open popups. If that’s the case, you could maybe use the server-side authentication flow instead.

Resources