Created
April 20, 2020 01:51
-
-
Save furkanaskin/4a8a086bec240b608ab560d214a50713 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
binding.toolbar.setNavigationOnClickListener { | |
when (navController.currentDestination?.id) { | |
R.id.searchFragment, R.id.gamesFragment, R.id.notificationsFragment -> { | |
if (onBackPressedDispatcher.hasEnabledCallbacks()) | |
onBackPressedDispatcher.onBackPressed() | |
else | |
navController.navigateUp() | |
} | |
else -> navController.navigateUp() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment