Context menu icons updated. OsmandMonitoringPlugin - commentedcode for another type of MapInfoControl.

This commit is contained in:
aFedasenka 2012-07-12 23:02:13 +02:00
parent c1034f5d13
commit 5d939774ab
11 changed files with 56 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

@ -311,9 +311,14 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
private void updateDistance (double lat, double lon) { private void updateDistance (double lat, double lon) {
if (lastPoint == null) { if (lastPoint == null) {
lastPoint = new LatLon(lat, lon); lastPoint = new LatLon(lat, lon);
}
double lastLat = lastPoint.getLatitude();
double lastLon = lastPoint.getLongitude();
if ((lat == lastLat) && (lon == lastLon)) {
return;
} else { } else {
float[] lastInterval = new float[1]; float[] lastInterval = new float[1];
Location.distanceBetween(lat, lon, lastPoint.getLatitude(), lastPoint.getLongitude(), lastInterval); Location.distanceBetween(lat, lon, lastLat, lastLon, lastInterval);
distance += lastInterval[0]; distance += lastInterval[0];
lastPoint = new LatLon(lat, lon); lastPoint = new LatLon(lat, lon);
} }

View file

@ -198,9 +198,11 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
private Paint paintText; private Paint paintText;
private Paint paintSubText; private Paint paintSubText;
// private MapInfoControl monitoringControl;
private TextInfoControl monitoringControl; private TextInfoControl monitoringControl;
private Drawable monitoring_rec; private Drawable monitoring_rec;
private Drawable monitoring; private Drawable monitoring;
// private OsmandMapTileView view;
public MonitoringLayer(MapActivity map) { public MonitoringLayer(MapActivity map) {
this.map = map; this.map = map;
@ -208,7 +210,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
@Override @Override
public void initLayer(OsmandMapTileView view) { public void initLayer(OsmandMapTileView view) {
// this.view = view;
paintText = new Paint(); paintText = new Paint();
paintText.setStyle(Style.FILL_AND_STROKE); paintText.setStyle(Style.FILL_AND_STROKE);
paintText.setColor(Color.BLACK); paintText.setColor(Color.BLACK);
@ -246,6 +248,51 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
* that shows a monitoring state (recorded/stopped) * that shows a monitoring state (recorded/stopped)
*/ */
private MapInfoControl createMonitoringControl(final MapActivity mapActivity) { private MapInfoControl createMonitoringControl(final MapActivity mapActivity) {
// monitoringControl = new MapInfoControl(view.getContext()) {
//
//
// @Override
// public boolean updateInfo() {
//// setText(getMonitoringControlTxt(), null);
//// setImageDrawable(getMonitoringControlImg(mapActivity));
// return true;
// }
//
// @Override
// protected void onDraw(Canvas canvas) {
// }
//
// };
//
// monitoringControl.setOrientation(LinearLayout.HORIZONTAL);
// monitoringControl.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
// LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
// LinearLayout.LayoutParams.WRAP_CONTENT,
// LinearLayout.LayoutParams.WRAP_CONTENT);
//
//
//// ImageView image = new ImageView(monitoringControl.getContext());
//// image.setImageDrawable(mapActivity.getResources().getDrawable(R.drawable.monitoring_rec_big));
//// monitoringControl.addView(image, layoutParams);
//
// ImageView monitoringView = new ImageView(view.getContext()) {
// @Override
// protected void onDraw(Canvas canvas) {
// canvas.save();
// getMonitoringControlImg(mapActivity).draw(canvas);
// canvas.restore();
// super.onDraw(canvas);
// }
// };
// monitoringView.setImageDrawable(getMonitoringControlImg(mapActivity));
// monitoringControl.addView(monitoringView, layoutParams);
//
//
// TextView text = new TextView(view.getContext());
// text.setText(getMonitoringControlTxt());
// text.setGravity(Gravity.CENTER);
// monitoringControl.addView(text, layoutParams);
monitoringControl = new TextInfoControl(mapActivity, 0, paintText, paintSubText) { monitoringControl = new TextInfoControl(mapActivity, 0, paintText, paintSubText) {
@Override @Override
public boolean updateInfo() { public boolean updateInfo() {

View file

@ -103,7 +103,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
} }
}; };
if (parkingPosition != null) if (parkingPosition != null)
adapter.registerItem(R.string.context_menu_item_delete_parking_point, R.drawable.poi_parking_del_ctx_menu, removeListener, 0); adapter.registerItem(R.string.context_menu_item_delete_parking_point, R.drawable.list_parking_poi_remove, removeListener, 0);
} }
OnContextMenuClick addListener = new OnContextMenuClick() { OnContextMenuClick addListener = new OnContextMenuClick() {
@ -115,7 +115,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
} }
} }
}; };
adapter.registerItem(R.string.context_menu_item_add_parking_point, R.drawable.poi_parking_pos_ctx_menu, addListener, -1); adapter.registerItem(R.string.context_menu_item_add_parking_point, R.drawable.list_parking_poi_add, addListener, -1);
} }