From 615fe88da304ee6f5943c9341f20f63d5392b9ce Mon Sep 17 00:00:00 2001 From: xmd5a2 Date: Thu, 18 Jun 2015 10:50:25 +0300 Subject: [PATCH] Remove nonworking UI languages --- .../activities/SettingsGeneralActivity.java | 82 +++++++++---------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java index 49db849127..e09129c00a 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java @@ -70,31 +70,31 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { String[] entrieValues; PreferenceScreen screen = getPreferenceScreen(); settings = getMyApplication().getSettings(); - - - + + + ApplicationMode[] appModes = ApplicationMode.values(settings).toArray(new ApplicationMode[0]); entries = new String[appModes.length]; for(int i=0; i= 19) { showAppDirDialogV19(); @@ -338,9 +330,9 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { } }); editalert.show(); - + } - + private void showAppDirDialogV19() { Builder bld = new AlertDialog.Builder(this); ChooseAppDirFragment frg = new DashChooseAppDirFragment.ChooseAppDirFragment(this, (Dialog) null); @@ -357,7 +349,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { applicationDir.setTitle(R.string.application_dir); applicationDir.setKey("external_storage_dir"); applicationDir.setOnPreferenceClickListener(new OnPreferenceClickListener() { - + @Override public boolean onPreferenceClick(Preference preference) { showAppDirDialog(); @@ -373,26 +365,26 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { nativeCheckbox.setChecked(true); } misc.addPreference(nativeCheckbox); - + final CheckBoxPreference openGlRender = createCheckBoxPreference(settings.USE_OPENGL_RENDER, R.string.use_opengl_render,R.string.use_opengl_render_descr); misc.addPreference(openGlRender); - + int nav = getResources().getConfiguration().navigation; - if (nav == Configuration.NAVIGATION_DPAD || nav == Configuration.NAVIGATION_TRACKBALL || - nav == Configuration.NAVIGATION_WHEEL || + if (nav == Configuration.NAVIGATION_DPAD || nav == Configuration.NAVIGATION_TRACKBALL || + nav == Configuration.NAVIGATION_WHEEL || nav == Configuration.NAVIGATION_UNDEFINED) { misc.addPreference(createCheckBoxPreference(settings.USE_TRACKBALL_FOR_MOVEMENTS, R.string.use_trackball, R.string.use_trackball_descr)); } } - + registerListPreference( settings.OSMAND_THEME, misc, new String[] { "Dark", "Light" }, new Integer[] { OsmandSettings.OSMAND_DARK_THEME, OsmandSettings.OSMAND_LIGHT_THEME}); - + misc.addPreference(createCheckBoxPreference(settings.USE_KALMAN_FILTER_FOR_COMPASS, R.string.use_kalman_filter_compass, R.string.use_kalman_filter_compass_descr)); - + } @@ -455,14 +447,14 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { } return true; } - - + + private void warnAboutChangingStorage(final String newValue) { String newDir = newValue != null ? newValue.trim() : newValue; if(!newDir.replace('/', ' ').trim(). toLowerCase().endsWith(IndexConstants.APP_DIR.replace('/', ' ').trim())) { - newDir += "/" +IndexConstants.APP_DIR; + newDir += "/" +IndexConstants.APP_DIR; } final File path = new File(newDir); path.mkdirs(); @@ -476,28 +468,28 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { @Override public void onClick(DialogInterface dialog, int which) { MoveFilesToDifferentDirectory task = - new MoveFilesToDifferentDirectory(SettingsGeneralActivity.this, + new MoveFilesToDifferentDirectory(SettingsGeneralActivity.this, settings.getExternalStorageDirectory(), path); task.setRunOnSuccess(new Runnable() { @Override public void run() { - updateSettingsToNewDir(path.getParentFile().getAbsolutePath()); + updateSettingsToNewDir(path.getParentFile().getAbsolutePath()); } }); task.execute(); } }); builder.setNeutralButton(R.string.shared_string_no, new OnClickListener() { - + @Override public void onClick(DialogInterface dialog, int which) { - updateSettingsToNewDir(path.getParentFile().getAbsolutePath()); + updateSettingsToNewDir(path.getParentFile().getAbsolutePath()); } }); builder.setNegativeButton(R.string.shared_string_cancel, null); builder.show(); } - + private void updateSettingsToNewDir(final String newDir) { // edit the preference settings.setExternalStorageDirectoryPre19(newDir); @@ -515,17 +507,17 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { @Override protected List doInBackground(Void... params) { - return getMyApplication().getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, + return getMyApplication().getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, new ArrayList()); } - + protected void onPostExecute(List result) { showWarnings(result); getToolbar().setTitle(oldTitle); getToolbar().setSubtitle(""); setProgressVisibility(false); } - + }.execute(); } @@ -600,7 +592,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { entries[k] = getString(R.string.install_more); registerListPreference(settings.VOICE_PROVIDER, screen, entries, entrieValues); } - + private Set getVoiceFiles() { // read available voice data