Skip to content

Commit

Permalink
Migrate deprecated onBackButton call (#48)
Browse files Browse the repository at this point in the history
## Context
- `Activity.onBackPressed` is now deprecated

## Code
- Migrate `Activity.onBackPressed` to `onBackPressedDispatcher.onBackPressed()`
  • Loading branch information
cmorigaki authored Nov 10, 2022
1 parent 222510f commit 84c5217
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RecipeDetailActivity : AppCompatActivity() {
RecipeDetailView(
state = it,
statusBarHeight = getStatusBarHeight().dp,
onBackClick = ::onBackPressed,
onBackClick = { onBackPressedDispatcher.onBackPressed() },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SettingsThemeActivity : AppCompatActivity() {
RecipeBookTheme {
SettingsThemeView(
state = it,
onBackClick = ::onBackPressed,
onBackClick = { onBackPressedDispatcher.onBackPressed() },
onItemClick = ::onItemClick,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SettingsActivity : AppCompatActivity() {
RecipeBookTheme {
SettingsView(
state = it,
onBackClick = ::onBackPressed,
onBackClick = { onBackPressedDispatcher.onBackPressed() },
onItemClick = ::onItemClick,
)
}
Expand Down

0 comments on commit 84c5217

Please sign in to comment.