add icons
git-svn-id: https://osmand.googlecode.com/svn/trunk@380 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
6
OsmAnd/res/drawable/bicycle_icon.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true"
|
||||
android:drawable="@drawable/bicycle_icon_on" />
|
||||
<item android:drawable="@drawable/bicycle_icon_off" />
|
||||
</selector>
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
BIN
OsmAnd/res/drawable/bicycle_icon_on.png
Normal file
After Width: | Height: | Size: 3 KiB |
6
OsmAnd/res/drawable/car_icon.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true"
|
||||
android:drawable="@drawable/car_icon_on" />
|
||||
<item android:drawable="@drawable/car_icon_off" />
|
||||
</selector>
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
OsmAnd/res/drawable/car_icon_on.png
Normal file
After Width: | Height: | Size: 2 KiB |
6
OsmAnd/res/drawable/pedestrian_icon.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true"
|
||||
android:drawable="@drawable/pedestrian_icon_on" />
|
||||
<item android:drawable="@drawable/pedestrian_icon_off" />
|
||||
</selector>
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
BIN
OsmAnd/res/drawable/pedestrian_icon_on.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
16
OsmAnd/res/layout/calculate_route.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" android:orientation="vertical" >
|
||||
|
||||
<TextView android:id="@+id/TextView" android:layout_width="fill_parent" android:textSize="18dp" android:layout_height="wrap_content" android:gravity="center" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:text="@string/recalculate_route_to_your_location"></TextView>
|
||||
<LinearLayout android:id="@+id/LinearLayout" android:layout_width="fill_parent" android:gravity="center" android:layout_height="wrap_content" android:orientation="horizontal">
|
||||
<ToggleButton android:textOn="" android:textOff="" android:id="@+id/CarButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/car_icon" android:layout_marginLeft="10dp" />
|
||||
<ToggleButton android:textOn="" android:textOff="" android:checked="true" android:id="@+id/BicycleButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:background="@drawable/bicycle_icon"/>
|
||||
<ToggleButton android:textOn="" android:textOff="" android:id="@+id/PedestrianButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:background="@drawable/pedestrian_icon"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -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) {
|
||||
|
|