diff --git a/OsmAnd/res/drawable/bicycle_icon.xml b/OsmAnd/res/drawable/bicycle_icon.xml new file mode 100644 index 0000000000..39c48ce8bf --- /dev/null +++ b/OsmAnd/res/drawable/bicycle_icon.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/OsmAnd/res/drawable/bicycle_icon.png b/OsmAnd/res/drawable/bicycle_icon_off.png similarity index 100% rename from OsmAnd/res/drawable/bicycle_icon.png rename to OsmAnd/res/drawable/bicycle_icon_off.png diff --git a/OsmAnd/res/drawable/bicycle_icon_on.png b/OsmAnd/res/drawable/bicycle_icon_on.png new file mode 100644 index 0000000000..c38dc5dc76 Binary files /dev/null and b/OsmAnd/res/drawable/bicycle_icon_on.png differ diff --git a/OsmAnd/res/drawable/car_icon.xml b/OsmAnd/res/drawable/car_icon.xml new file mode 100644 index 0000000000..99091a1491 --- /dev/null +++ b/OsmAnd/res/drawable/car_icon.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/OsmAnd/res/drawable/car_icon.png b/OsmAnd/res/drawable/car_icon_off.png similarity index 100% rename from OsmAnd/res/drawable/car_icon.png rename to OsmAnd/res/drawable/car_icon_off.png diff --git a/OsmAnd/res/drawable/car_icon_on.png b/OsmAnd/res/drawable/car_icon_on.png new file mode 100644 index 0000000000..70f11eea31 Binary files /dev/null and b/OsmAnd/res/drawable/car_icon_on.png differ diff --git a/OsmAnd/res/drawable/pedestrian_icon.xml b/OsmAnd/res/drawable/pedestrian_icon.xml new file mode 100644 index 0000000000..8ed0e4426e --- /dev/null +++ b/OsmAnd/res/drawable/pedestrian_icon.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/OsmAnd/res/drawable/pedestrian_icon.png b/OsmAnd/res/drawable/pedestrian_icon_off.png similarity index 100% rename from OsmAnd/res/drawable/pedestrian_icon.png rename to OsmAnd/res/drawable/pedestrian_icon_off.png diff --git a/OsmAnd/res/drawable/pedestrian_icon_on.png b/OsmAnd/res/drawable/pedestrian_icon_on.png new file mode 100644 index 0000000000..caa02c610d Binary files /dev/null and b/OsmAnd/res/drawable/pedestrian_icon_on.png differ diff --git a/OsmAnd/res/layout/calculate_route.xml b/OsmAnd/res/layout/calculate_route.xml new file mode 100644 index 0000000000..c4a230c46b --- /dev/null +++ b/OsmAnd/res/layout/calculate_route.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/OsmAnd/src/com/osmand/activities/MapActivity.java b/OsmAnd/src/com/osmand/activities/MapActivity.java index 14970dc244..965a8aec7b 100644 --- a/OsmAnd/src/com/osmand/activities/MapActivity.java +++ b/OsmAnd/src/com/osmand/activities/MapActivity.java @@ -49,6 +49,7 @@ import android.view.View.OnClickListener; import android.widget.EditText; import android.widget.ImageButton; import android.widget.Toast; +import android.widget.ToggleButton; import android.widget.ZoomControls; import com.osmand.Algoritms; @@ -59,6 +60,7 @@ import com.osmand.R; import com.osmand.ResourceManager; import com.osmand.SQLiteTileSource; import com.osmand.Version; +import com.osmand.OsmandSettings.ApplicationMode; import com.osmand.activities.FavouritesActivity.FavouritePoint; import com.osmand.activities.FavouritesActivity.FavouritesDbHelper; import com.osmand.activities.search.SearchActivity; @@ -861,7 +863,18 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso } Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.follow_route); - builder.setMessage(R.string.recalculate_route_to_your_location); + View view = getLayoutInflater().inflate(R.layout.calculate_route, null); + ToggleButton car = (ToggleButton) view.findViewById(R.id.CarButton); + ToggleButton bicyle = (ToggleButton) view.findViewById(R.id.BicycleButton); + ToggleButton pedestrian = (ToggleButton) view.findViewById(R.id.PedestrianButton); + if(OsmandSettings.getApplicationMode(this) == ApplicationMode.BICYCLE){ + bicyle.setChecked(true); + } else if(OsmandSettings.getApplicationMode(this) == ApplicationMode.PEDESTRIAN){ + pedestrian.setChecked(true); + } else if(OsmandSettings.getApplicationMode(this) == ApplicationMode.CAR){ + car.setChecked(true); + } + builder.setView(view); builder.setPositiveButton(R.string.follow, new DialogInterface.OnClickListener(){ @Override public void onClick(DialogInterface dialog, int which) {