Exemple #1
0
 public static float getFontSize(Context context) {
   Configuration mCurConfig = new Configuration();
   Configuration config = new Configuration();
   android.provider.Settings.System.getConfiguration(context.getContentResolver(), config);
   Log.w(TAG, "getFontSize(), Font size is " + mCurConfig.fontScale);
   return mCurConfig.fontScale;
 }
        @Override
        public void onChange(boolean selfChange) {
          if (selfChange) {
            return;
          }

          updateAccessibilityState();

          // Force a configuration change.
          Configuration newConfig = new Configuration();
          newConfig.setToDefaults();
          newConfig.locale = Locale.getDefault();
          Settings.System.getConfiguration(getContentResolver(), newConfig);
          onConfigurationChanged(newConfig);

          onAccessibilityChanged(mAccessibilityEnabled);
        }
Exemple #3
0
  private static Locale getLocale(Context var0) {
    Locale var1 = null;

    try {
      Configuration var2 = new Configuration();
      Settings.System.getConfiguration(var0.getContentResolver(), var2);
      if (var2 != null) {
        var1 = var2.locale;
      }
    } catch (Exception var3) {
      YLog.e(TAG, "fail to read user config locale");
    }

    if (var1 == null) {
      var1 = Locale.getDefault();
    }

    return var1;
  }