2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

For #20029: Remove animations when recreating activity on locale change.

This commit is contained in:
mcarare 2021-06-25 15:08:13 +03:00 committed by mergify[bot]
parent 9693507ffb
commit b43db5f2b6
2 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,7 @@ class DefaultLocaleSettingsController(
LocaleManager.setNewLocale(activity, localeUseCase, locale)
LocaleManager.updateBaseConfiguration(activity, locale)
activity.recreate()
activity.overridePendingTransition(0, 0)
}
override fun handleDefaultLocaleSelected() {
@ -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) {

View File

@ -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) }
}
@ -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) }
}
@ -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) }
}