Fix remarks

This commit is contained in:
Dima-1 2020-01-31 14:46:11 +02:00
parent da8b4602cb
commit 11550ea94d
2 changed files with 5 additions and 7 deletions

View file

@ -977,7 +977,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
} }
public static void requestFineLocationPermissionIfNeeded(Activity activity) { public static void requestFineLocationPermissionIfNeeded(Activity activity) {
if (!OsmAndLocationProvider.isLocationPermissionAvailable(activity)) { if (!isLocationPermissionAvailable(activity)) {
ActivityCompat.requestPermissions(activity, ActivityCompat.requestPermissions(activity,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
OsmAndLocationProvider.REQUEST_LOCATION_PERMISSION); OsmAndLocationProvider.REQUEST_LOCATION_PERMISSION);

View file

@ -1,7 +1,6 @@
package net.osmand.plus.routepreparationmenu; package net.osmand.plus.routepreparationmenu;
import android.Manifest;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface.OnDismissListener; import android.content.DialogInterface.OnDismissListener;
import android.graphics.PointF; import android.graphics.PointF;
@ -19,7 +18,6 @@ import android.support.transition.Scene;
import android.support.transition.Transition; import android.support.transition.Transition;
import android.support.transition.TransitionListenerAdapter; import android.support.transition.TransitionListenerAdapter;
import android.support.transition.TransitionManager; import android.support.transition.TransitionManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.widget.AppCompatImageView; import android.support.v7.widget.AppCompatImageView;
@ -263,7 +261,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
if (selectFromMapTouch) { if (selectFromMapTouch) {
selectFromMapTouch = false; selectFromMapTouch = false;
LatLon latLon = tileBox.getLatLonFromPixel(point.x, point.y); LatLon latLon = tileBox.getLatLonFromPixel(point.x, point.y);
choicePointTypeAction(mapActivity, latLon, selectFromMapPointType, null, null); choosePointTypeAction(mapActivity, latLon, selectFromMapPointType, null, null);
if (selectFromMapWaypoints) { if (selectFromMapWaypoints) {
WaypointsFragment.showInstance(mapActivity.getSupportFragmentManager(), true); WaypointsFragment.showInstance(mapActivity.getSupportFragmentManager(), true);
} else { } else {
@ -275,7 +273,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
return false; return false;
} }
private void choicePointTypeAction(MapActivity mapActivity, LatLon latLon, PointType pointType, PointDescription pd, String address) { private void choosePointTypeAction(MapActivity mapActivity, LatLon latLon, PointType pointType, PointDescription pd, String address) {
OsmandApplication app = getApp(); OsmandApplication app = getApp();
FavouritesDbHelper favorites = app.getFavorites(); FavouritesDbHelper favorites = app.getFavorites();
TargetPointsHelper targetPointsHelper = app.getTargetPointsHelper(); TargetPointsHelper targetPointsHelper = app.getTargetPointsHelper();
@ -1796,7 +1794,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
MapActivity mapActivity = getMapActivity(); MapActivity mapActivity = getMapActivity();
if (mapActivity != null) { if (mapActivity != null) {
PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_ADDRESS, name); PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_ADDRESS, name);
choicePointTypeAction(mapActivity, latLon, pointType, pd, name); choosePointTypeAction(mapActivity, latLon, pointType, pd, name);
updateMenu(); updateMenu();
} }
} }
@ -1839,7 +1837,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
if (marker != null) { if (marker != null) {
LatLon latLon = new LatLon(marker.getLatitude(), marker.getLongitude()); LatLon latLon = new LatLon(marker.getLatitude(), marker.getLongitude());
PointDescription pd = marker.getPointDescription(mapActivity); PointDescription pd = marker.getPointDescription(mapActivity);
choicePointTypeAction(mapActivity, latLon, pointType, pd, null); choosePointTypeAction(mapActivity, latLon, pointType, pd, null);
updateMenu(); updateMenu();
} else { } else {
MapMarkerSelectionFragment selectionFragment = MapMarkerSelectionFragment.newInstance(pointType); MapMarkerSelectionFragment selectionFragment = MapMarkerSelectionFragment.newInstance(pointType);