This commit is contained in:
Victor Shcherb 2015-09-23 14:36:09 +02:00
parent 737793ba4d
commit 3f2c394444
4 changed files with 30 additions and 13 deletions

View file

@ -9,6 +9,8 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="simulate_your_location_stop_descr">Stop simulating your position</string>
<string name="simulate_your_location_descr">Simulate using recorded GPX or calculated route</string>
<string name="address_unknown">Address is not known yet</string>
<string name="av_locations_descr">Gpx file with note locations</string>
<string name="av_locations">Locations</string>

View file

@ -7,10 +7,9 @@ import java.util.List;
import net.osmand.CallbackWithObject;
import net.osmand.Location;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
import net.osmand.plus.routing.RoutingHelper;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
@ -51,7 +50,7 @@ public class OsmAndLocationSimulation {
// }
// }
public void startStopRouteAnimation(final MapActivity ma) {
public void startStopRouteAnimation(final Activity ma) {
if (!isRouteAnimating()) {
Builder builder = new AlertDialog.Builder(ma);
builder.setTitle(R.string.animate_route);

View file

@ -1,5 +1,8 @@
package net.osmand.plus.development;
import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.R;
import net.osmand.plus.dashboard.DashBaseFragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
@ -11,11 +14,6 @@ import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dashboard.DashBaseFragment;
public class DashSimulateFragment extends DashBaseFragment {
public static final String TAG = "DASH_SIMULATE_FRAGMENT";
@ -46,10 +44,8 @@ public class DashSimulateFragment extends DashBaseFragment {
@Override
public void onClick(View v) {
if (getActivity() instanceof MapActivity) {
loc.getLocationSimulation().startStopRouteAnimation((MapActivity) getActivity());
dashboard.hideDashboard();
}
loc.getLocationSimulation().startStopRouteAnimation(getActivity());
dashboard.hideDashboard();
}
};
item.setOnClickListener(listener);

View file

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Set;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndLocationSimulation;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.SettingsBaseActivity;
@ -52,8 +53,25 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
cat.addPreference(createCheckBoxPreference(settings.BETA_TESTING_LIVE_UPDATES,
"Live updates", "Beta testing for live updates"));
Preference pref = new Preference(this);
final Preference simulate = pref;
final OsmAndLocationSimulation sim = getMyApplication().getLocationProvider().getLocationSimulation();
pref.setTitle(R.string.simulate_your_location);
simulate.setSummary(sim.isRouteAnimating() ?
R.string.simulate_your_location_stop_descr : R.string.simulate_your_location_descr);
pref.setKey("simulate_your_location");
pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
sim.startStopRouteAnimation(SettingsDevelopmentActivity.this);
simulate.setSummary(sim.isRouteAnimating() ?
R.string.simulate_your_location_stop_descr : R.string.simulate_your_location_descr);
return true;
}
});
cat.addPreference(pref);
pref = new Preference(this);
pref.setTitle(R.string.test_voice_prompts);
pref.setSummary(R.string.play_commands_of_currently_selected_voice);
pref.setKey("test_voice_commands");
@ -65,6 +83,8 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
}
});
cat.addPreference(pref);
pref = new Preference(this);
pref.setTitle(R.string.app_modes_choose);