use of io.jawg.osmcontributor.model.events.PleaseLoadPoiTypes in project osm-contributor by jawg.
the class MapFragmentPresenter method loadPoi.
private void loadPoi(boolean refreshData, boolean forceRefresh) {
if (poiTypes == null) {
Timber.v("PleaseLoadPoiTypes");
eventBus.post(new PleaseLoadPoiTypes());
}
LatLngBounds viewLatLngBounds = mapFragment.getViewLatLngBounds();
if (viewLatLngBounds != null) {
if (mapFragment.getZoomLevel() > BuildConfig.ZOOM_MARKER_MIN) {
if (shouldReload(viewLatLngBounds) || refreshData || forceRefresh) {
previousZoom = mapFragment.getZoomLevel();
triggerReloadPoiLatLngBounds = LatLngBoundsUtils.enlarge(viewLatLngBounds, 1.2);
LatLngBounds latLngToLoad = LatLngBoundsUtils.enlarge(viewLatLngBounds, 1.2);
getPoisAndNotes.unsubscribe();
Timber.e("Unsubscribe current loading");
if (getPoisSubscriber != null) {
getPoisSubscriber.unsubscribe();
}
getPoisSubscriber = new GetPoisSubscriber();
getPoisAndNotes.init(Box.convertFromLatLngBounds(latLngToLoad), refreshData).execute(getPoisSubscriber);
mapFragment.displayZoomTooLargeError(false);
}
} else {
forceRefreshPoi = true;
cleanAllZoomTooLarge();
}
}
}
use of io.jawg.osmcontributor.model.events.PleaseLoadPoiTypes in project osm-contributor by jawg.
the class LoadProfileActivity method onDatabaseResetFinishedEvent.
@Subscribe(threadMode = ThreadMode.MAIN)
public void onDatabaseResetFinishedEvent(DatabaseResetFinishedEvent event) {
eventBus.post(new PleaseLoadPoiTypes());
databaseReseted = true;
checkFinishActivity();
}
use of io.jawg.osmcontributor.model.events.PleaseLoadPoiTypes in project osm-contributor by jawg.
the class TypeListActivity method onBackPressed.
@Override
public void onBackPressed() {
if (!presenter.onBackPressed()) {
eventBus.post(new PleaseLoadPoiTypes());
super.onBackPressed();
}
}
use of io.jawg.osmcontributor.model.events.PleaseLoadPoiTypes in project osm-contributor by jawg.
the class MapActivity method onResume.
@Override
protected void onResume() {
super.onResume();
eventBus.register(this);
if (!sharedPreferences.getBoolean(getString(R.string.shared_prefs_preset_default), false) || !BuildConfig.FLAVOR.equals("store")) {
navigationView.getMenu().findItem(R.id.edit_way).setVisible(false);
navigationView.getMenu().findItem(R.id.manage_poi_types).setVisible(false);
eventBus.post(new PleaseLoadPoiTypes());
} else {
navigationView.getMenu().findItem(R.id.edit_way).setVisible(true);
navigationView.getMenu().findItem(R.id.manage_poi_types).setVisible(sharedPreferences.getBoolean(getString(R.string.shared_prefs_expert_mode), false));
}
}
Aggregations