Add missing animateMyLocation preference

This commit is contained in:
Chumva 2019-09-26 11:30:00 +03:00
parent 8cb70567d9
commit 384cc8014a
3 changed files with 12 additions and 1 deletions

View file

@ -56,4 +56,11 @@
app:fragment="net.osmand.plus.settings.TurnScreenOnFragment"
tools:icon="@drawable/ic_action_turn_screen_on" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="animate_my_location"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_off"
android:summaryOn="@string/shared_string_on"
android:title="@string/animate_my_location" />
</PreferenceScreen>

View file

@ -1644,7 +1644,7 @@ public class OsmandSettings {
public final CommonPreference<NotesSortByMode> NOTES_SORT_BY_MODE = new EnumIntPreference<>("notes_sort_by_mode", NotesSortByMode.BY_DATE, NotesSortByMode.values());
public final OsmandPreference<Boolean> ANIMATE_MY_LOCATION = new BooleanPreference("animate_my_location", true).makeGlobal().cache();
public final OsmandPreference<Boolean> ANIMATE_MY_LOCATION = new BooleanPreference("animate_my_location", true).makeProfile().cache();
public final OsmandPreference<Integer> EXTERNAL_INPUT_DEVICE = new IntPreference("external_input_device", 0).makeProfile();

View file

@ -6,6 +6,7 @@ import android.support.v7.preference.SwitchPreferenceCompat;
import android.view.View;
import net.osmand.plus.R;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
public class NavigationFragment extends BaseSettingsFragment {
@ -47,6 +48,7 @@ public class NavigationFragment extends BaseSettingsFragment {
SwitchPreferenceCompat showRoutingAlarms = (SwitchPreferenceCompat) findPreference(settings.SHOW_ROUTING_ALARMS.getId());
SwitchPreferenceCompat speakRoutingAlarms = (SwitchPreferenceCompat) findPreference(settings.SPEAK_ROUTING_ALARMS.getId());
SwitchPreferenceCompat turnScreenOn = (SwitchPreferenceCompat) findPreference(settings.TURN_SCREEN_ON_ENABLED.getId());
SwitchPreferenceEx animateMyLocation = (SwitchPreferenceEx) findPreference(settings.ANIMATE_MY_LOCATION.getId());
routeParameters.setIcon(getContentIcon(R.drawable.ic_action_route_distance));
showRoutingAlarms.setIcon(getContentIcon(R.drawable.ic_action_alert));
@ -54,6 +56,8 @@ public class NavigationFragment extends BaseSettingsFragment {
turnScreenOn.setIcon(getContentIcon(R.drawable.ic_action_turn_screen_on));
setupVehicleParametersPref();
animateMyLocation.setDescription(getString(R.string.animate_my_location_desc));
}
private void setupVehicleParametersPref() {