Remove compass in accessibility

This commit is contained in:
Victor Shcherb 2014-07-08 19:30:14 +02:00
parent e517287f9b
commit 3ed05b4463
2 changed files with 14 additions and 6 deletions

View file

@ -370,8 +370,10 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
} else if(isSearchByNameFilter() ){
searchFilterLayout.setVisibility(View.VISIBLE);
}
app.getLocationProvider().addCompassListener(this);
app.getLocationProvider().registerOrUnregisterCompassListener(true);
if(!app.accessibilityEnabled()) {
app.getLocationProvider().addCompassListener(this);
app.getLocationProvider().registerOrUnregisterCompassListener(true);
}
searchFilter.requestFocus();
}
@ -549,7 +551,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
super.onPause();
if (searchNearBy) {
app.getLocationProvider().pauseAllUpdates();
app.getLocationProvider().removeCompassListener(this);
if(!app.accessibilityEnabled()) {
app.getLocationProvider().removeCompassListener(this);
}
app.getLocationProvider().removeLocationListener(this);
}
}

View file

@ -312,8 +312,10 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
mapLocation = new Location("map");
mapLocation.setLatitude(ml.getLatitude());
mapLocation.setLongitude(ml.getLongitude());
app.getLocationProvider().addCompassListener(this);
app.getLocationProvider().registerOrUnregisterCompassListener(true);
if(!app.accessibilityEnabled()) {
app.getLocationProvider().addCompassListener(this);
app.getLocationProvider().registerOrUnregisterCompassListener(true);
}
app.getLocationProvider().addLocationListener(this);
app.getLocationProvider().resumeAllUpdates();
osMoPlugin.getGroups().setUiListener(this);
@ -326,7 +328,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
protected void onPause() {
super.onPause();
app.getLocationProvider().pauseAllUpdates();
app.getLocationProvider().removeCompassListener(this);
if(!app.accessibilityEnabled()) {
app.getLocationProvider().removeCompassListener(this);
}
app.getLocationProvider().removeLocationListener(this);
osMoPlugin.getGroups().setUiListener(null);
}