compose: navigation: Reference onNavigateUp() directly
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -50,17 +50,17 @@ fun NavDisplay(startDestination: NavKey) {
|
|||||||
),
|
),
|
||||||
entryProvider = entryProvider {
|
entryProvider = entryProvider {
|
||||||
entry<Screen.Blacklist> {
|
entry<Screen.Blacklist> {
|
||||||
BlacklistScreen(onNavigateUp = { onNavigateUp() })
|
BlacklistScreen(onNavigateUp = ::onNavigateUp)
|
||||||
}
|
}
|
||||||
|
|
||||||
entry<Screen.Search> {
|
entry<Screen.Search> {
|
||||||
SearchScreen(onNavigateUp = { onNavigateUp() })
|
SearchScreen(onNavigateUp = ::onNavigateUp)
|
||||||
}
|
}
|
||||||
|
|
||||||
entry<Screen.AppDetails> { screen ->
|
entry<Screen.AppDetails> { screen ->
|
||||||
AppDetailsScreen(
|
AppDetailsScreen(
|
||||||
packageName = screen.packageName,
|
packageName = screen.packageName,
|
||||||
onNavigateUp = { onNavigateUp() },
|
onNavigateUp = ::onNavigateUp,
|
||||||
onNavigateToAppDetails = { packageName ->
|
onNavigateToAppDetails = { packageName ->
|
||||||
backstack.add(Screen.AppDetails(packageName))
|
backstack.add(Screen.AppDetails(packageName))
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ fun NavDisplay(startDestination: NavKey) {
|
|||||||
entry<Screen.DevProfile> { screen ->
|
entry<Screen.DevProfile> { screen ->
|
||||||
DevProfileScreen(
|
DevProfileScreen(
|
||||||
developerId = screen.developerId,
|
developerId = screen.developerId,
|
||||||
onNavigateUp = { onNavigateUp() },
|
onNavigateUp = ::onNavigateUp,
|
||||||
onNavigateToAppDetails = { packageName ->
|
onNavigateToAppDetails = { packageName ->
|
||||||
backstack.add(Screen.AppDetails(packageName))
|
backstack.add(Screen.AppDetails(packageName))
|
||||||
}
|
}
|
||||||
@@ -78,14 +78,12 @@ fun NavDisplay(startDestination: NavKey) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
entry<Screen.PermissionRationale> { screen ->
|
entry<Screen.PermissionRationale> { screen ->
|
||||||
PermissionRationaleScreen(
|
PermissionRationaleScreen(onNavigateUp = ::onNavigateUp)
|
||||||
onNavigateUp = { onNavigateUp() },
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
entry<Screen.Downloads> {
|
entry<Screen.Downloads> {
|
||||||
DownloadsScreen(
|
DownloadsScreen(
|
||||||
onNavigateUp = { onNavigateUp() },
|
onNavigateUp = ::onNavigateUp,
|
||||||
onNavigateToAppDetails = { packageName ->
|
onNavigateToAppDetails = { packageName ->
|
||||||
backstack.add(Screen.AppDetails(packageName))
|
backstack.add(Screen.AppDetails(packageName))
|
||||||
}
|
}
|
||||||
@@ -104,18 +102,18 @@ fun NavDisplay(startDestination: NavKey) {
|
|||||||
.apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) }
|
.apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) }
|
||||||
|
|
||||||
AccountsScreen(
|
AccountsScreen(
|
||||||
onNavigateUp = { onNavigateUp() },
|
onNavigateUp = ::onNavigateUp,
|
||||||
onNavigateToSplash = { activity?.startActivity(splashIntent) }
|
onNavigateToSplash = { activity?.startActivity(splashIntent) }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
entry<Screen.About> {
|
entry<Screen.About> {
|
||||||
AboutScreen(onNavigateUp = { onNavigateUp() })
|
AboutScreen(onNavigateUp = ::onNavigateUp)
|
||||||
}
|
}
|
||||||
|
|
||||||
entry<Screen.Favourite> {
|
entry<Screen.Favourite> {
|
||||||
FavouriteScreen(
|
FavouriteScreen(
|
||||||
onNavigateUp = { onNavigateUp() },
|
onNavigateUp = ::onNavigateUp,
|
||||||
onNavigateToAppDetails = { packageName ->
|
onNavigateToAppDetails = { packageName ->
|
||||||
backstack.add(Screen.AppDetails(packageName))
|
backstack.add(Screen.AppDetails(packageName))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user