add icons

git-svn-id: https://osmand.googlecode.com/svn/trunk@380 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-07-21 13:03:11 +00:00
parent d175c9efcf
commit f38e330640
11 changed files with 48 additions and 1 deletions

View 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>

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View 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>

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View 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>

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View 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>

View file

@ -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) {