mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
address review
This commit is contained in:
@@ -106,7 +106,7 @@ public class BriarApplicationImpl extends Application
|
|||||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
Localizer.getInstance()
|
Localizer.getInstance()
|
||||||
.applicationConfigurationChanged(this);
|
.applicationConfigurationChanged(this, newConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTheme(Context ctx, SharedPreferences prefs) {
|
private void setTheme(Context ctx, SharedPreferences prefs) {
|
||||||
|
|||||||
@@ -119,20 +119,29 @@ public class Localizer {
|
|||||||
Resources.getSystem().getConfiguration();
|
Resources.getSystem().getConfiguration();
|
||||||
updateConfiguration(systemConfiguration, locale);
|
updateConfiguration(systemConfiguration, locale);
|
||||||
// DateUtils uses the system resources, so we need to update them too.
|
// DateUtils uses the system resources, so we need to update them too.
|
||||||
|
//noinspection deprecation
|
||||||
Resources.getSystem().updateConfiguration(systemConfiguration,
|
Resources.getSystem().updateConfiguration(systemConfiguration,
|
||||||
Resources.getSystem().getDisplayMetrics());
|
Resources.getSystem().getDisplayMetrics());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applicationConfigurationChanged(Context appContext) {
|
public void applicationConfigurationChanged(Context appContext,
|
||||||
|
Configuration newConfig) {
|
||||||
|
if (SDK_INT >= 24) {
|
||||||
|
if (newConfig.getLocales().get(0) == locale) return;
|
||||||
|
} else {
|
||||||
|
if (newConfig.locale == locale) return;
|
||||||
|
}
|
||||||
setLocaleAndSystemConfiguration(locale);
|
setLocaleAndSystemConfiguration(locale);
|
||||||
if (SDK_INT < 17) setLocaleLegacy(appContext);
|
if (SDK_INT < 17) setLocaleLegacy(appContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indicates whether the language represented by locale
|
/**
|
||||||
// should be offered to the user on this device.
|
* Indicates whether the language represented by locale
|
||||||
// * Android doesn't pick up Asturian on API < 21
|
* should be offered to the user on this device.
|
||||||
// * Android can't render Devanagari characters on API 15.
|
* * Android doesn't pick up Asturian on API < 21
|
||||||
// * RTL languages are supported since API >= 17
|
* * Android can't render Devanagari characters on API 15.
|
||||||
|
* * RTL languages are supported since API >= 17
|
||||||
|
*/
|
||||||
public static boolean isLocaleSupported(Locale locale) {
|
public static boolean isLocaleSupported(Locale locale) {
|
||||||
if (SDK_INT >= 21) return true;
|
if (SDK_INT >= 21) return true;
|
||||||
if (locale.getLanguage().equals("ast")) return false;
|
if (locale.getLanguage().equals("ast")) return false;
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String nativeName;
|
String nativeName;
|
||||||
// Unsupported languages won't be translated to their native name.
|
// Unknown languages won't be translated to their native name.
|
||||||
if (locale.getLanguage().equals("ast")) {
|
if (locale.getLanguage().equals("ast")) {
|
||||||
nativeName = "Asturianu";
|
nativeName = "Asturianu";
|
||||||
} else if (locale.getLanguage().equals("oc")) {
|
} else if (locale.getLanguage().equals("oc")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user