mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-08-21 17:47:50 +00:00
Fix player formatters resetting too early on language change
formatters() is called again by the player before the user has a chance to click on the language in the language chooser. So the correct solution would probably be to attach to https://developer.android.com/reference/android/content/Intent#ACTION_LOCALE_CHANGED, but let's keep it simple. I added `PlayerHelper.resetFormat();` in `ContentSettingsFragment.onDestroy()` and it works. It will mean the player formatters will be reset every time the user exits content settings, but whatever.
This commit is contained in:
parent
893a1cb699
commit
eea2b7417e
@ -54,7 +54,6 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||
final Intent intent = new Intent(Settings.ACTION_APP_LOCALE_SETTINGS)
|
||||
.setData(Uri.fromParts("package", requireContext().getPackageName(), null));
|
||||
startActivity(intent);
|
||||
PlayerHelper.resetFormat();
|
||||
return true;
|
||||
});
|
||||
newAppLanguagePref.setVisible(true);
|
||||
@ -66,7 +65,6 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||
final String systemLang = getString(R.string.default_localization_key);
|
||||
final String tag = systemLang.equals(language) ? null : language;
|
||||
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(tag));
|
||||
PlayerHelper.resetFormat();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@ -110,5 +108,6 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||
NewPipe.setupLocalization(
|
||||
Localization.getPreferredLocalization(context),
|
||||
Localization.getPreferredContentCountry(context));
|
||||
PlayerHelper.resetFormat();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user