diff --git a/OsmAnd/assets/distributed_assets.xml b/OsmAnd/assets/distributed_assets.xml index dbf8b55ca3..b8b4301de0 100644 --- a/OsmAnd/assets/distributed_assets.xml +++ b/OsmAnd/assets/distributed_assets.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/OsmAnd/res/drawable-hdpi/arrow_to_destination.png b/OsmAnd/res/drawable-hdpi/arrow_to_destination.png new file mode 100644 index 0000000000..7c367d6e07 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/arrow_to_destination.png differ diff --git a/OsmAnd/res/drawable/arrow_to_destination.png b/OsmAnd/res/drawable/arrow_to_destination.png new file mode 100644 index 0000000000..31a2413fe7 Binary files /dev/null and b/OsmAnd/res/drawable/arrow_to_destination.png differ diff --git a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java index 85f27cbb88..c704902614 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java @@ -133,9 +133,7 @@ public class MainMenuActivity extends Activity { // only one commit should be with contribution version flag // prefs.edit().putBoolean(CONTRIBUTION_VERSION_FLAG, true).commit(); - final TextView appName = (TextView) window.findViewById(R.id.AppName); if (prefs.contains(CONTRIBUTION_VERSION_FLAG)) { -// appName.setText("OsmAnd"); SpannableString content = new SpannableString(textVersion); content.setSpan(new ClickableSpan() { @@ -148,18 +146,6 @@ public class MainMenuActivity extends Activity { textVersionView.setText(content); textVersionView.setMovementMethod(LinkMovementMethod.getInstance()); } -// SpannableString appLink = new SpannableString(appName.getText()); -// appLink.setSpan(new ClickableSpan() { -// -// @Override -// public void onClick(View widget) { -// TipsAndTricksActivity tactivity = new TipsAndTricksActivity(activity); -// Dialog dlg = tactivity.getDialogToShowTips(false, true); -// dlg.show(); -// } -// }, appLink.length() - 1, appLink.length(), 0); -// appName.setText(appLink); -// appName.setMovementMethod(LinkMovementMethod.getInstance()); View helpButton = window.findViewById(R.id.HelpButton); helpButton.setOnClickListener(new OnClickListener() { @Override @@ -243,7 +229,7 @@ public class MainMenuActivity extends Activity { } startProgressDialog = new ProgressDialog(this); - ((OsmandApplication)getApplication()).checkApplicationIsBeingInitialized(this, startProgressDialog); + ((OsmandApplication)getApplication()).checkApplicationIsBeingInitialized(this, startProgressDialog); SharedPreferences pref = getPreferences(MODE_WORLD_WRITEABLE); boolean firstTime = false; if(!pref.contains(FIRST_TIME_APP_RUN)){ @@ -293,11 +279,25 @@ public class MainMenuActivity extends Activity { TipsAndTricksActivity tipsActivity = new TipsAndTricksActivity(this); Dialog dlg = tipsActivity.getDialogToShowTips(!appVersionChanged, false); dlg.show(); + } else { + startProgressDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + checkVectorIndexesDownloaded(); + } + }); } } checkPreviousRunsForExceptions(firstTime); } + protected void checkVectorIndexesDownloaded() { + ResourceManager resourceManager = ((OsmandApplication) getApplication()).getResourceManager(); +// resourceManager.getRenderer().get + // TODO show dialog with problems + + } + @Override protected Dialog onCreateDialog(int id) { if(id == OsmandApplication.PROGRESS_DIALOG){ diff --git a/OsmAnd/src/net/osmand/plus/activities/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/activities/OsmandApplication.java index 1c0e2bd512..d8f3e4f4a0 100644 --- a/OsmAnd/src/net/osmand/plus/activities/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/activities/OsmandApplication.java @@ -178,7 +178,7 @@ public class OsmandApplication extends Application { activity.showDialog(PROGRESS_DIALOG); startDialog.setDialog(progressDialog); } else if (startingWarnings != null) { - showWarnings(startingWarnings, activity); + showWarnings(startingWarnings, activity); } } } diff --git a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java index 4d8f5c53d3..3d0f16b676 100644 --- a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java @@ -7,7 +7,6 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; -import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PointF; @@ -26,10 +25,11 @@ public class PointNavigationLayer implements OsmandMapLayer { protected LatLon pointToNavigate = null; private OsmandMapTileView view; - private Path pathForDirection; private float[] calculations = new float[2]; + private DisplayMetrics dm; private Bitmap targetPoint; + private Bitmap arrowToDestination; @@ -41,9 +41,12 @@ public class PointNavigationLayer implements OsmandMapLayer { point.setStyle(Style.FILL); bitmapPaint = new Paint(); + bitmapPaint.setDither(true); + bitmapPaint.setAntiAlias(true); + bitmapPaint.setFilterBitmap(true); targetPoint = BitmapFactory.decodeResource(view.getResources(), R.drawable.target_point); + arrowToDestination = BitmapFactory.decodeResource(view.getResources(), R.drawable.arrow_to_destination); - pathForDirection = new Path(); } @@ -72,21 +75,12 @@ public class PointNavigationLayer implements OsmandMapLayer { } else { Location.distanceBetween(view.getLatitude(), view.getLongitude(), pointToNavigate.getLatitude(), pointToNavigate.getLongitude(), calculations); - float bearing = calculations[1]; - pathForDirection.reset(); - pathForDirection.moveTo(0, 0); - pathForDirection.lineTo(0.5f, 1.5f); - pathForDirection.lineTo(-0.5f, 1.5f); - pathForDirection.lineTo(0, 0); - float radiusBearing = DIST_TO_SHOW; - Matrix m = new Matrix(); - m.reset(); - m.postScale(RADIUS * dm.density * 2, RADIUS * 2 * dm.density); - m.postTranslate(0, - radiusBearing * dm.density ); - m.postTranslate(view.getCenterPointX(), view.getCenterPointY()); - m.postRotate(bearing, view.getCenterPointX(), view.getCenterPointY()); - pathForDirection.transform(m); - canvas.drawPath(pathForDirection, point); + float bearing = calculations[1] - 90; + float radiusBearing = DIST_TO_SHOW * dm.density; + canvas.rotate(bearing - view.getRotate(), view.getCenterPointX(), view.getCenterPointY()); + canvas.translate(-24 * dm.density + radiusBearing, -22 * dm.density); + canvas.drawBitmap(arrowToDestination, view.getCenterPointX(), view.getCenterPointY(), bitmapPaint); + } } diff --git a/OsmAnd/assets/basemap.obf.jpg b/config/basemap_world_1.obf similarity index 100% rename from OsmAnd/assets/basemap.obf.jpg rename to config/basemap_world_1.obf