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

onBackPressed not working as expected #6

Closed
webianks opened this issue Oct 25, 2019 · 2 comments
Closed

onBackPressed not working as expected #6

webianks opened this issue Oct 25, 2019 · 2 comments

Comments

@webianks
Copy link

onBackPressed() from ArticleScreen closes app instead of navigating back to Home screen. From navigationIcon it works as intended.

@webianks
Copy link
Author

Will this work?

override fun onBackPressed() {
if (JetnewsStatus.currentScreen != Screen.Home) {
navigateTo(Screen.Home)
} else
super.onBackPressed()
}

@nickbutcher
Copy link
Contributor

Thanks for the suggestion. We considered adding something like this but did not want to complicate the navigation by adding a back stack. A proper navigation solution is on the roadmap and we did not want to imply that developers will need to roll their own so tried to keep this to the simplest possible solution.

Thanks again.

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