diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 842baa09b9..4805de7a1c 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -3418,7 +3418,7 @@ Zodpovedá oblasti: %1$s x %2$s Umožňuje zdieľanie polohy a zaznamenávanie výletu. Sledovanie online Presnosť záznamu - Všetky vaše zaznamenané stopy sú v \'Menu\' → \'Moje miesta\' → \'Stopy\', alebo v priečinku OsmAnd. + Všetky vaše zaznamenané stopy sú v %1$s, alebo v priečinku OsmAnd. Všetky vaše OSM poznámky sú v \'Menu\' → \'Moje miesta\' → \'Zmeny v OSM\'. Video-poznámky Foto-poznámky diff --git a/OsmAnd/res/xml/monitoring_settings.xml b/OsmAnd/res/xml/monitoring_settings.xml index ffcc2df3f4..6a1e03358d 100644 --- a/OsmAnd/res/xml/monitoring_settings.xml +++ b/OsmAnd/res/xml/monitoring_settings.xml @@ -33,6 +33,13 @@ android:layout="@layout/preference_category_with_descr" android:title="@string/save_track_logging_accuracy" /> + + entry = getTimeValues(false); ListPreferenceEx saveTrackInterval = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_INTERVAL.getId()); - saveTrackInterval.setEntries(entries); - saveTrackInterval.setEntryValues(entryValues); + saveTrackInterval.setEntries(entry.values().toArray(new String[0])); + saveTrackInterval.setEntryValues(entry.keySet().toArray()); saveTrackInterval.setIcon(getActiveIcon(R.drawable.ic_action_time_span)); saveTrackInterval.setDescription(R.string.save_track_interval_descr); } + private void setupSaveGlobalTrackIntervalPref() { + HashMap entry = getTimeValues(true); + ListPreferenceEx saveTrackInterval = (ListPreferenceEx) findPreference(settings.SAVE_GLOBAL_TRACK_INTERVAL.getId()); + saveTrackInterval.setEntries(entry.values().toArray(new String[0])); + saveTrackInterval.setEntryValues(entry.keySet().toArray()); + saveTrackInterval.setIcon(getActiveIcon(R.drawable.ic_action_time_span)); + saveTrackInterval.setDescription(R.string.save_global_track_interval_descr); + } + + private HashMap getTimeValues(boolean alwaysAskEntry) { + HashMap entry = new LinkedHashMap<>(); + if (alwaysAskEntry) { + entry.put(settings.SAVE_GLOBAL_TRACK_REMEMBER.getModeValue(getSelectedAppMode()), getString(R.string.confirm_every_run)); + } + for (int second : SECONDS) { + entry.put(second * 1000, second + " " + getString(R.string.int_seconds)); + } + for (int minute : MINUTES) { + entry.put((minute * 60) * 1000, minute + " " + getString(R.string.int_min)); + } + return entry; + } + private void setupSaveTrackMinDistancePref() { Float[] entryValues = new Float[] {0.f, 2.0f, 5.0f, 10.0f, 20.0f, 30.0f, 50.0f}; String[] entries = new String[entryValues.length]; @@ -257,15 +271,20 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment implements String prefId = preference.getKey(); OsmandSettings.OsmandPreference pref = settings.getPreference(prefId); - if (pref instanceof OsmandSettings.CommonPreference && !((OsmandSettings.CommonPreference) pref).hasDefaultValueForMode(getSelectedAppMode())) { - FragmentManager fragmentManager = getFragmentManager(); - if (fragmentManager != null && newValue instanceof Serializable) { - ChangeGeneralProfilesPrefBottomSheet.showInstance(fragmentManager, prefId, - (Serializable) newValue, this, false, getSelectedAppMode()); + if (SAVE_GLOBAL_TRACK_INTERVAL.equals(prefId)) { + if (newValue instanceof Boolean) { + prefId = settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(); + newValue = Boolean.FALSE; + } + if (pref instanceof OsmandSettings.CommonPreference && !((OsmandSettings.CommonPreference) pref).hasDefaultValueForMode(getSelectedAppMode())) { + FragmentManager fragmentManager = getFragmentManager(); + if (fragmentManager != null && newValue instanceof Serializable) { + ChangeGeneralProfilesPrefBottomSheet.showInstance(fragmentManager, prefId, + (Serializable) newValue, this, false, getSelectedAppMode()); + } + return false; } - return false; } - return true; } diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index 42f395deb2..0b8e57720a 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -553,19 +553,18 @@ public class OsmandMonitoringPlugin extends OsmandPlugin { ll.addView(sp); if (choice != null) { final AppCompatCheckBox cb = new AppCompatCheckBox(uiCtx); - cb.setText(R.string.shared_string_remember_my_choice); + cb.setText(R.string.confirm_every_run); cb.setTextColor(textColorPrimary); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); lp.setMargins(dp24, dp8, dp24, 0); cb.setLayoutParams(lp); cb.setPadding(dp8, 0, 0, 0); + cb.setChecked(!choice.value); cb.setOnCheckedChangeListener(new OnCheckedChangeListener() { - @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - choice.value = isChecked; - + choice.value = !isChecked; } }); UiUtilities.setupCompoundButton(cb, nightMode, PROFILE_DEPENDENT);