Clean unnecessary settings

This commit is contained in:
Victor Shcherb 2015-05-21 15:30:35 +03:00
parent 01ad603c4d
commit eb1a94c4f6

View file

@ -37,22 +37,9 @@ public class SettingsRasterMapsActivity extends SettingsBaseActivity {
PreferenceCategory cat = new PreferenceCategory(this); PreferenceCategory cat = new PreferenceCategory(this);
cat.setTitle(R.string.pref_raster_map); cat.setTitle(R.string.pref_raster_map);
grp.addPreference(cat); grp.addPreference(cat);
CheckBoxPreference mapVectorData = createCheckBoxPreference(settings.MAP_ONLINE_DATA, // present on configure map
R.string.map_online_data, R.string.map_online_data_descr); // addTileSourcePrefs(listener, cat);
// final OnPreferenceChangeListener parent = mapVectorData.getOnPreferenceChangeListener();
// MapRenderRepositories r = app.getResourceManager().getRenderer();
// if(r.isEmpty()){
// AccessibleToast.makeText(this, getString(R.string.no_vector_map_loaded), Toast.LENGTH_LONG).show();
// return false;
// }
cat.addPreference(mapVectorData);
tileSourcePreference = new ListPreference(this);
tileSourcePreference.setSummary(R.string.map_tile_source_descr);
tileSourcePreference.setTitle(R.string.map_tile_source);
tileSourcePreference.setOnPreferenceChangeListener(listener);
cat.addPreference(tileSourcePreference);
cat.addPreference(createCheckBoxPreference(settings.USE_INTERNET_TO_DOWNLOAD_TILES, cat.addPreference(createCheckBoxPreference(settings.USE_INTERNET_TO_DOWNLOAD_TILES,
R.string.use_internet, R.string.use_internet_to_download_tile)); R.string.use_internet, R.string.use_internet_to_download_tile));
@ -68,19 +55,16 @@ public class SettingsRasterMapsActivity extends SettingsBaseActivity {
ListPreference lp = createListPreference(settings.LEVEL_TO_SWITCH_VECTOR_RASTER, ListPreference lp = createListPreference(settings.LEVEL_TO_SWITCH_VECTOR_RASTER,
entries, intValues, R.string.level_to_switch_vector_raster, R.string.level_to_switch_vector_raster_descr); entries, intValues, R.string.level_to_switch_vector_raster, R.string.level_to_switch_vector_raster_descr);
cat.addPreference(lp); cat.addPreference(lp);
// present on configure map
// addOverlayPrefs(grp, listener);
// try without, Issue 823: }
// int startZoom = 12;
// int endZoom = 19;
// entries = new String[endZoom - startZoom + 1]; @SuppressWarnings("unused")
// Integer[] intValues = new Integer[endZoom - startZoom + 1]; private void addOverlayPrefs(PreferenceScreen grp, OnPreferenceChangeListener listener) {
// for (int i = startZoom; i <= endZoom; i++) { PreferenceCategory cat;
// entries[i - startZoom] = i + ""; //$NON-NLS-1$
// intValues[i - startZoom] = i ;
// }
// registerListPreference(osmandosmandSettings.MAX_LEVEL_TO_DOWNLOAD_TILE, screen, entries, intValues);
cat = new PreferenceCategory(this); cat = new PreferenceCategory(this);
cat.setTitle(R.string.pref_overlay); cat.setTitle(R.string.pref_overlay);
grp.addPreference(cat); grp.addPreference(cat);
@ -102,8 +86,21 @@ public class SettingsRasterMapsActivity extends SettingsBaseActivity {
sp = createSeekBarPreference(settings.MAP_TRANSPARENCY, R.string.map_transparency, R.string.map_transparency_descr, sp = createSeekBarPreference(settings.MAP_TRANSPARENCY, R.string.map_transparency, R.string.map_transparency_descr,
R.string.modify_transparency, 0, 255); R.string.modify_transparency, 0, 255);
cat.addPreference(sp); cat.addPreference(sp);
}
@SuppressWarnings("unused")
private void addTileSourcePrefs(OnPreferenceChangeListener listener, PreferenceCategory cat) {
CheckBoxPreference mapVectorData = createCheckBoxPreference(settings.MAP_ONLINE_DATA,
R.string.map_online_data, R.string.map_online_data_descr);
cat.addPreference(mapVectorData);
} tileSourcePreference = new ListPreference(this);
tileSourcePreference.setSummary(R.string.map_tile_source_descr);
tileSourcePreference.setTitle(R.string.map_tile_source);
tileSourcePreference.setOnPreferenceChangeListener(listener);
cat.addPreference(tileSourcePreference);
}
public void updateAllSettings() { public void updateAllSettings() {