Merge pull request #5578 from osmandapp/FixLocationUI
Fix stale location and compass in landscape
This commit is contained in:
commit
c25fffe12a
3 changed files with 7 additions and 12 deletions
|
@ -135,6 +135,7 @@ public class UiUtilities {
|
||||||
fromLoc = new LatLon(loc.getLatitude(), loc.getLongitude());
|
fromLoc = new LatLon(loc.getLatitude(), loc.getLongitude());
|
||||||
} else {
|
} else {
|
||||||
useCenter = true;
|
useCenter = true;
|
||||||
|
stale = false;
|
||||||
fromLoc = app.getMapViewTrackingUtilities().getMapLocation();
|
fromLoc = app.getMapViewTrackingUtilities().getMapLocation();
|
||||||
h = app.getMapViewTrackingUtilities().getMapRotate();
|
h = app.getMapViewTrackingUtilities().getMapRotate();
|
||||||
if(h != null) {
|
if(h != null) {
|
||||||
|
|
|
@ -1497,7 +1497,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
||||||
OsmandApplication app = getMyApplication();
|
OsmandApplication app = getMyApplication();
|
||||||
if (app != null && view != null) {
|
if (app != null && view != null) {
|
||||||
View compassView = view.findViewById(R.id.compass_layout);
|
View compassView = view.findViewById(R.id.compass_layout);
|
||||||
if (menu.displayDistanceDirection() && menu.getCurrentMenuState() != MenuState.FULL_SCREEN) {
|
if (menu.displayDistanceDirection()) {
|
||||||
updateDistanceDirection();
|
updateDistanceDirection();
|
||||||
compassView.setVisibility(View.VISIBLE);
|
compassView.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.osmand.plus.mapcontextmenu.other;
|
package net.osmand.plus.mapcontextmenu.other;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
@ -21,8 +20,6 @@ import net.osmand.plus.R;
|
||||||
import net.osmand.plus.TargetPointsHelper;
|
import net.osmand.plus.TargetPointsHelper;
|
||||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.activities.search.SearchActivity;
|
|
||||||
import net.osmand.plus.activities.search.SearchPOIActivity;
|
|
||||||
import net.osmand.plus.poi.PoiFiltersHelper;
|
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||||
import net.osmand.plus.poi.PoiUIFilter;
|
import net.osmand.plus.poi.PoiUIFilter;
|
||||||
|
|
||||||
|
@ -124,14 +121,11 @@ public class DestinationReachedMenuFragment extends Fragment {
|
||||||
findParkingButton.setOnClickListener(new View.OnClickListener() {
|
findParkingButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
PoiFiltersHelper helper = getMapActivity().getMyApplication().getPoiFilters();
|
MapActivity mapActivity = getMapActivity();
|
||||||
//PoiType place = getMapActivity().getMyApplication().getPoiTypes().getPoiTypeByKey("parking");
|
if (mapActivity != null) {
|
||||||
PoiUIFilter parkingFilter = helper.getFilterById(PoiUIFilter.STD_PREFIX + "parking");
|
PoiFiltersHelper helper = getMapActivity().getMyApplication().getPoiFilters();
|
||||||
if (parkingFilter != null) {
|
PoiUIFilter parkingFilter = helper.getFilterById(PoiUIFilter.STD_PREFIX + "parking");
|
||||||
final Intent newIntent = new Intent(getActivity(), SearchPOIActivity.class);
|
mapActivity.showQuickSearch(parkingFilter);
|
||||||
newIntent.putExtra(SearchPOIActivity.AMENITY_FILTER, parkingFilter.getFilterId());
|
|
||||||
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
|
|
||||||
startActivityForResult(newIntent, 0);
|
|
||||||
}
|
}
|
||||||
dismissMenu();
|
dismissMenu();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue