diff --git a/opensrp-eusm/build.gradle b/opensrp-eusm/build.gradle index a57d31f..c86aede 100644 --- a/opensrp-eusm/build.gradle +++ b/opensrp-eusm/build.gradle @@ -51,7 +51,7 @@ android { minSdkVersion androidMinSdkVersion targetSdkVersion androidTargetSdkVersion versionCode 1 - versionName "0.1.2" + versionName "0.1.3" multiDexEnabled true buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" buildConfigField "boolean", "TIME_CHECK", "false" diff --git a/opensrp-eusm/src/main/java/org/smartregister/eusm/interactor/EusmTaskingMapInteractor.java b/opensrp-eusm/src/main/java/org/smartregister/eusm/interactor/EusmTaskingMapInteractor.java index 239022c..baf884f 100644 --- a/opensrp-eusm/src/main/java/org/smartregister/eusm/interactor/EusmTaskingMapInteractor.java +++ b/opensrp-eusm/src/main/java/org/smartregister/eusm/interactor/EusmTaskingMapInteractor.java @@ -36,43 +36,37 @@ public EusmTaskingMapInteractor(TaskingMapActivityContract.Presenter presenter) @Override public void fetchLocations(String plan, String operationalArea, String point, Boolean locationComponentActive) { - appExecutors.diskIO().execute(new Runnable() { - @Override - public void run() { - Set operationalAreaLocations = getOperationalAreaLocations(new HashSet<>(Arrays.asList(operationalArea.split(PreferencesUtil.OPERATIONAL_AREA_SEPARATOR)))); + appExecutors.diskIO().execute(() -> { + Set operationalAreaLocations = getOperationalAreaLocations(new HashSet<>(Arrays.asList(operationalArea.split(PreferencesUtil.OPERATIONAL_AREA_SEPARATOR)))); - JSONObject featureCollection = null; - try { - featureCollection = createFeatureCollection(); - if (!operationalAreaLocations.isEmpty()) { - List structureDetails = appStructureRepository - .fetchStructureDetails(null, operationalAreaLocations.stream().filter(location -> location.getId() != null).map(location -> location.getId()).collect(Collectors.toSet()), null, true, plan); + JSONObject featureCollection = null; + try { + featureCollection = createFeatureCollection(); + if (!operationalAreaLocations.isEmpty()) { + List structureDetails = appStructureRepository + .fetchStructureDetails(null, operationalAreaLocations.stream().filter(location -> location.getId() != null).map(location -> location.getId()).collect(Collectors.toSet()), null, true, plan); - if (structureDetails != null && !structureDetails.isEmpty()) { - String features = geoJsonUtils.getGeoJsonFromStructureDetail(structureDetails); - featureCollection.put(TaskingConstants.GeoJSON.FEATURES, new JSONArray(features)); - } + if (structureDetails != null && !structureDetails.isEmpty()) { + String features = geoJsonUtils.getGeoJsonFromStructureDetail(structureDetails); + featureCollection.put(TaskingConstants.GeoJSON.FEATURES, new JSONArray(features)); } - } catch (Exception e) { - Timber.e(e); } - JSONObject finalFeatureCollection = featureCollection; - appExecutors.mainThread().execute(new Runnable() { - @Override - public void run() { - if (!operationalAreaLocations.isEmpty()) { - Feature operationalAreaFeature = Feature.fromJson(gson.toJson(operationalAreaLocations.stream().findFirst().orElse(null))); - if (locationComponentActive != null) { - getPresenter().onStructuresFetched(finalFeatureCollection, operationalAreaFeature, null, point, locationComponentActive); - } else { - getPresenter().onStructuresFetched(finalFeatureCollection, operationalAreaFeature, null); - } - } else { - getPresenter().onStructuresFetched(finalFeatureCollection, null, null); - } - } - }); + } catch (Exception e) { + Timber.e(e); } + JSONObject finalFeatureCollection = featureCollection; + appExecutors.mainThread().execute(() -> { + if (!operationalAreaLocations.isEmpty()) { + Feature operationalAreaFeature = Feature.fromJson(gson.toJson(operationalAreaLocations.stream().findFirst().orElse(null))); + if (locationComponentActive != null) { + getPresenter().onStructuresFetched(finalFeatureCollection, operationalAreaFeature, null, point, locationComponentActive); + } else { + getPresenter().onStructuresFetched(finalFeatureCollection, operationalAreaFeature, null); + } + } else { + getPresenter().onStructuresFetched(finalFeatureCollection, null, null); + } + }); }); } diff --git a/opensrp-eusm/src/main/res/values/strings.xml b/opensrp-eusm/src/main/res/values/strings.xml index 4023d68..62033b7 100644 --- a/opensrp-eusm/src/main/res/values/strings.xml +++ b/opensrp-eusm/src/main/res/values/strings.xml @@ -97,7 +97,7 @@ >]]> - %s · %s %s + %s · %s %s Serial # Qty: Serial # %s @@ -146,8 +146,8 @@ identifier OK New Mission Assigned - There are no structures mapped to this operational area. Please add a point to begin - This operational area has not been defined in the system. Please try to sync your device. Please contact the system administrator if that doesn\'t solve the issue noting the operational area number %1$s. + There are no active service points in this district. + There are no active service points in this district. Account Disabled Fetching Structure Details Fetching Structure Details. Please wait