Skip to content

Commit

Permalink
For mozilla-mobile#20029: Remove animations when recreating activity …
Browse files Browse the repository at this point in the history
…on locale change.
  • Loading branch information
mcarare committed Jun 25, 2021
1 parent c830ed9 commit 5d062b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class DefaultLocaleSettingsController(
LocaleManager.setNewLocale(activity, localeUseCase, locale)
LocaleManager.updateBaseConfiguration(activity, locale)
activity.recreate()
activity.overridePendingTransition(0, 0)
}

override fun handleDefaultLocaleSelected() {
Expand All @@ -41,6 +42,7 @@ class DefaultLocaleSettingsController(
LocaleManager.resetToSystemDefault(activity, localeUseCase)
LocaleManager.updateBaseConfiguration(activity, localeSettingsStore.state.localeList[0])
activity.recreate()
activity.overridePendingTransition(0, 0)
}

override fun handleSearchQueryTyped(query: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class LocaleSettingsControllerTest {
verify { localeSettingsStore.dispatch(LocaleSettingsAction.Select(selectedLocale)) }
verify { LocaleManager.setNewLocale(activity, localeUseCases, selectedLocale) }
verify { activity.recreate() }
verify { activity.overridePendingTransition(0, 0) }

with(controller) {
verify { LocaleManager.updateBaseConfiguration(activity, selectedLocale) }
}
Expand All @@ -101,6 +103,8 @@ class LocaleSettingsControllerTest {
verify { localeSettingsStore.dispatch(LocaleSettingsAction.Select(selectedLocale)) }
verify { LocaleManager.setNewLocale(activity, localeUseCases, selectedLocale) }
verify { activity.recreate() }
verify { activity.overridePendingTransition(0, 0) }

with(controller) {
verify { LocaleManager.updateBaseConfiguration(activity, selectedLocale) }
}
Expand Down Expand Up @@ -139,6 +143,8 @@ class LocaleSettingsControllerTest {
verify { localeSettingsStore.dispatch(LocaleSettingsAction.Select(selectedLocale)) }
verify { LocaleManager.resetToSystemDefault(activity, localeUseCases) }
verify { activity.recreate() }
verify { activity.overridePendingTransition(0, 0) }

with(controller) {
verify { LocaleManager.updateBaseConfiguration(activity, selectedLocale) }
}
Expand Down

0 comments on commit 5d062b1

Please sign in to comment.