diff --git a/collect_app/build.gradle b/collect_app/build.gradle index 8b7306730..a9351a93c 100644 --- a/collect_app/build.gradle +++ b/collect_app/build.gradle @@ -254,7 +254,7 @@ configurations.all { force('com.google.code.findbugs:jsr305:1.3.9') //todo: identify and fix this conflict - //Conflict with dependency 'org.objenesis:objenesis' in project ':collect_app'. Resolved versions for app (2.4) and test app (2.6) differ. + //Conflict with dependency 'org.objenesis:objenesis' in PROJECT ':collect_app'. Resolved versions for app (2.4) and test app (2.6) differ. force 'org.objenesis:objenesis:2.1' } transitive = true diff --git a/collect_app/src/main/java/org/fieldsight/naxa/common/Constant.java b/collect_app/src/main/java/org/fieldsight/naxa/common/Constant.java index dccf8f986..f30da30e3 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/common/Constant.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/common/Constant.java @@ -78,7 +78,7 @@ public static final class FormType { } public final static class FormDeploymentFrom { - public final static String PROJECT = "project"; + public final static String PROJECT = "PROJECT"; public final static String SITE = "site"; } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/common/SharedPreferenceUtils.java b/collect_app/src/main/java/org/fieldsight/naxa/common/SharedPreferenceUtils.java index 877d76489..8db5c223b 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/common/SharedPreferenceUtils.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/common/SharedPreferenceUtils.java @@ -110,11 +110,11 @@ public static void removeFromPrefs(Context context, String key) { } public static String keySelectedRegionId(String projectId) { - return String.format("project-id-%s", projectId); + return String.format("PROJECT-id-%s", projectId); } public static String keySelectedRegionLabel(String label) { - return String.format("project-label-%s", label); + return String.format("PROJECT-label-%s", label); } public static String getSiteLisTitle(Context context, String projectId) { diff --git a/collect_app/src/main/java/org/fieldsight/naxa/data/source/local/FieldSightNotificationLocalSource.java b/collect_app/src/main/java/org/fieldsight/naxa/data/source/local/FieldSightNotificationLocalSource.java index c6a2e5365..13ef8b766 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/data/source/local/FieldSightNotificationLocalSource.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/data/source/local/FieldSightNotificationLocalSource.java @@ -366,8 +366,8 @@ public FieldSightNotification parseNotificationData(JSONObject jsonObject) { } } - if (notificationData.has("project")) { - String site = notificationData.optString("project"); + if (notificationData.has("PROJECT")) { + String site = notificationData.optString("PROJECT"); try { JSONObject siteData = new JSONObject(site); if (siteData.has("name")) { diff --git a/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialsRemoteSource.java b/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialsRemoteSource.java index f6eb7979d..0103500e7 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialsRemoteSource.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialsRemoteSource.java @@ -203,7 +203,7 @@ private Observable getProjectObservable(@Nullable String projectId) { @Override public List apply(List projects) throws Exception { if (projects.isEmpty()) { - throw new RuntimeException("Download project(s) site(s) first"); + throw new RuntimeException("Download PROJECT(s) site(s) first"); } return projects; } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/firebase/FieldSightFirebaseMessagingService.java b/collect_app/src/main/java/org/fieldsight/naxa/firebase/FieldSightFirebaseMessagingService.java index 2231e4551..240c5a3d8 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/firebase/FieldSightFirebaseMessagingService.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/firebase/FieldSightFirebaseMessagingService.java @@ -200,8 +200,8 @@ private void parseNotificationData(Map notificationData) { } } - if (notificationData.containsKey("project")) { - String site = notificationData.get("project"); + if (notificationData.containsKey("PROJECT")) { + String site = notificationData.get("PROJECT"); try { JSONObject siteData = new JSONObject(site); if (siteData.has("name")) { diff --git a/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldSightFormDetails.java b/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldSightFormDetails.java index dcfda922a..bb2e9bc3b 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldSightFormDetails.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldSightFormDetails.java @@ -26,7 +26,7 @@ public class FieldSightFormDetails extends FormDetails { @SerializedName("site") private String formDeployedSiteId; - @SerializedName("project") + @SerializedName("PROJECT") private String formDeployedProjectId; @SerializedName("site_project_id") diff --git a/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldsightFormDetailsv3.java b/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldsightFormDetailsv3.java index 829c2f9d3..75b5e8f4f 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldsightFormDetailsv3.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/forms/data/local/FieldsightFormDetailsv3.java @@ -29,7 +29,7 @@ public class FieldsightFormDetailsv3 { @ColumnInfo(name = "site") String site; - @ColumnInfo(name = "project") + @ColumnInfo(name = "PROJECT") String project; @ColumnInfo(name = "site_project_id") @@ -154,7 +154,7 @@ public static FieldsightFormDetailsv3 parseFromJSON(JSONObject jsonObject, Strin FieldsightFormDetailsv3 fieldsightFormDetailsv3 = new FieldsightFormDetailsv3(); FormDetails formDetails = formDetailsfromJSON(jsonObject); fieldsightFormDetailsv3.setId(jsonObject.optString("id")); - fieldsightFormDetailsv3.setProject(jsonObject.optString("project")); + fieldsightFormDetailsv3.setProject(jsonObject.optString("PROJECT")); fieldsightFormDetailsv3.setSite_project_id(jsonObject.optString("site_project_id")); fieldsightFormDetailsv3.setSite(jsonObject.optString("site")); fieldsightFormDetailsv3.setFormDetails(formDetailsfromJSON(jsonObject)); @@ -218,7 +218,7 @@ public static List fieldsightFormDetailsV3FromJSON(JSON JSONObject subStageFormDetailJSON = subStageFormJSON.optJSONObject("stage_forms"); fieldsightFormDetails.setId(subStageFormDetailJSON.optString("id")); - fieldsightFormDetails.setProject(subStageFormDetailJSON.optString("project")); + fieldsightFormDetails.setProject(subStageFormDetailJSON.optString("PROJECT")); fieldsightFormDetails.setSite_project_id(subStageFormDetailJSON.optString("site_project_id")); fieldsightFormDetails.setSite(subStageFormDetailJSON.optString("site")); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/forms/data/remote/FieldSightFormRemoteSourceV3.java b/collect_app/src/main/java/org/fieldsight/naxa/forms/data/remote/FieldSightFormRemoteSourceV3.java index d8d5f1f4a..e32d26c50 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/forms/data/remote/FieldSightFormRemoteSourceV3.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/forms/data/remote/FieldSightFormRemoteSourceV3.java @@ -168,7 +168,7 @@ private void updateProjectIdUrlMap(FieldsightFormDetailsv3 fieldsightFormDetails } private Integer getProjectId(FieldsightFormDetailsv3 fieldSightForm) { String value = TextUtils.isEmpty(fieldSightForm.getProject()) || TextUtils.equals(fieldSightForm.getProject(), "null")? fieldSightForm.getSite_project_id() : fieldSightForm.getProject(); - Timber.i("Fieldsightformremotesourcev3, id = %s, value = %s, projectName = %s, project = %s, site_project_id = %s", + Timber.i("Fieldsightformremotesourcev3, id = %s, value = %s, projectName = %s, PROJECT = %s, site_project_id = %s", fieldSightForm.getId(), value, fieldSightForm.getDescription(), fieldSightForm.getProject(), fieldSightForm.getSite_project_id()); return Integer.parseInt(value); } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/FormResponse.java b/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/FormResponse.java index afff5d3a1..effa813db 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/FormResponse.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/FormResponse.java @@ -35,7 +35,7 @@ public class FormResponse implements Parcelable { @SerializedName("site") @Expose private Integer site; - @SerializedName("project") + @SerializedName("PROJECT") @Expose private Integer project; @SerializedName("site_fxf") diff --git a/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/GeneralForm.java b/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/GeneralForm.java index c40d1746c..359504de0 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/GeneralForm.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/generalforms/data/GeneralForm.java @@ -70,7 +70,7 @@ public class GeneralForm { @SerializedName("site") @Expose private String siteId; - @SerializedName(value = "project") + @SerializedName(value = "PROJECT") @Expose private String projectId; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/helpers/FSInstancesDao.java b/collect_app/src/main/java/org/fieldsight/naxa/helpers/FSInstancesDao.java index bf3292407..67f55aeb8 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/helpers/FSInstancesDao.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/helpers/FSInstancesDao.java @@ -243,7 +243,7 @@ public static String generateSubmissionUrl(String formDeployedFrom, String siteI switch (formDeployedFrom) { case PROJECT: - submissionUrl += "project/" + fsFormId + "/" + siteId; + submissionUrl += "PROJECT/" + fsFormId + "/" + siteId; break; case SITE: submissionUrl += fsFormId + "/" + siteId; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/model/MySites.java b/collect_app/src/main/java/org/fieldsight/naxa/login/model/MySites.java index 5ec7d7b77..b39da9baf 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/model/MySites.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/model/MySites.java @@ -7,7 +7,7 @@ public class MySites { - @SerializedName("project") + @SerializedName("PROJECT") @Expose(serialize = false,deserialize = false) private Project project; @SerializedName("site") @@ -17,7 +17,7 @@ public class MySites { /** * * @return - * The project + * The PROJECT */ public Project getProject() { return project; @@ -26,7 +26,7 @@ public Project getProject() { /** * * @param project - * The project + * The PROJECT */ public void setProject(Project project) { this.project = project; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/model/Project.java b/collect_app/src/main/java/org/fieldsight/naxa/login/model/Project.java index 7a6c9cbd9..9d99b4704 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/model/Project.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/model/Project.java @@ -21,7 +21,7 @@ /** * Created by Susan on 11/24/2016. */ -@Entity(tableName = "project") +@Entity(tableName = "PROJECT") public class Project implements Parcelable { @PrimaryKey diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/model/Site.java b/collect_app/src/main/java/org/fieldsight/naxa/login/model/Site.java index 1f350b996..a300ad6fb 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/model/Site.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/model/Site.java @@ -81,7 +81,7 @@ public class Site implements Parcelable { @ColumnInfo(name = "dateCreated") private String dateCreated; - @ColumnInfo(name = "project") + @ColumnInfo(name = "PROJECT") private String project; @ColumnInfo(name = "isSiteVerified") @@ -434,8 +434,12 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } Site site = (Site) o; return isSiteVerified == site.isSiteVerified && Objects.equal(id, site.id) && diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/model/User.java b/collect_app/src/main/java/org/fieldsight/naxa/login/model/User.java index 0c5b958a2..ed83b6573 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/model/User.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/model/User.java @@ -378,8 +378,12 @@ public void setSync(boolean sync) { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } User user = (User) o; return sync == user.sync && Objects.equal(mySitesModel, user.mySitesModel) && diff --git a/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrateFieldSightViewModel.java b/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrateFieldSightViewModel.java index 5f6a0e27b..31633600a 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrateFieldSightViewModel.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrateFieldSightViewModel.java @@ -40,7 +40,7 @@ public class MigrateFieldSightViewModel extends ViewModel { private void copyProjects() { SQLiteDatabase db = getProjSiteDB(); Cursor cursor = null; - cursor = selectAll(db, MigrationHelper.Table.project); + cursor = selectAll(db, MigrationHelper.Table.PROJECT); ArrayList projects = new ArrayList<>(); while (cursor.moveToNext()) { @@ -241,8 +241,9 @@ private SQLiteDatabase getProjSiteDB() { File.separator + MigrationHelper.Folder.DB_FOLDER + File.separator + MigrationHelper.Database.PROJ_SITES); - if (!dbfile.exists()) + if (!dbfile.exists()) { throw new RuntimeException("Database file does not exist for " + usernameOrEmail); + } return SQLiteDatabase.openOrCreateDatabase(dbfile, null); } @@ -251,8 +252,9 @@ private SQLiteDatabase getInstancesDB() { String dbPath = migrationHelper.getOldRootPath() + File.separator + MigrationHelper.Folder.METADATA + File.separator + MigrationHelper.Database.INSTANCES; File dbfile = new File(dbPath); - if (!dbfile.exists()) + if (!dbfile.exists()) { throw new RuntimeException("Instance Database does not exist for " + usernameOrEmail); + } return SQLiteDatabase.openOrCreateDatabase(dbfile, null); } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrationHelper.java b/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrationHelper.java index 5ed6774c7..76629ece2 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrationHelper.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/migrate/MigrationHelper.java @@ -127,7 +127,7 @@ String fixSitePhotosPath(String oldPath) { public static class Table { - public static final String project = "table_project"; + public static final String PROJECT = "table_project"; static final String my_site = "table_my_site_detail"; public static final String notifications = "table_notify"; public static final String all_contacts = "table_contact"; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/network/APIEndpoint.java b/collect_app/src/main/java/org/fieldsight/naxa/network/APIEndpoint.java index 4b1d51a2e..5794dc963 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/network/APIEndpoint.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/network/APIEndpoint.java @@ -24,14 +24,14 @@ public class APIEndpoint { public static final String GET_GENERAL_EM = "/forms/api/general/0/{site_id}"; public static final String GET_SCHEDULE_EM = "/forms/api/schedules/0/{site_id}"; - public static final String GET_LOCATION_URL = "/fieldsight/api/project-sites/"; + public static final String GET_LOCATION_URL = "/fieldsight/api/PROJECT-sites/"; public static final String GET_FORM_SCHEDULE = "/forms/api/schedules/{is_project}/{id}"; public static final String GET_GENERAL_FORM = "/forms/api/general/{is_project}/{id}"; public static final String GET_PROJECT_SITES = "/users/metwo/"; public static final String GET_FS_FORM_DETAIL = "/forms/api/form-detail/{fs_form_id}"; - public static final String ASSIGNED_FORM_LIST_PROJECT = "/forms/assignedFormList/project/"; + public static final String ASSIGNED_FORM_LIST_PROJECT = "/forms/assignedFormList/PROJECT/"; public static final String ASSIGNED_FORM_LIST_SITE = "/forms/assignedFormList/siteLevel/"; public static final String ADD_FCM = "/fieldsight/fcm/add/"; @@ -40,7 +40,7 @@ public class APIEndpoint { public static final String SITE_UPDATE_URL = "/fieldsight/api/update-site/"; public static final String PROJECT_UPDATE_URL = "/fieldsight/api/async_save_project/"; - public static final String GET_CLUSTER_LIST = "/fieldsight/project/region-list/{project_id}/"; + public static final String GET_CLUSTER_LIST = "/fieldsight/PROJECT/region-list/{project_id}/"; public static final String GET_ALL_SUBMISSION = "/forms/last-submissions/"; public static final String GET_MY_SITES = "/users/mysites"; public static final String GET_MY_SITES_v2 = "users/api/v2/mysites/"; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/network/ApiInterface.java b/collect_app/src/main/java/org/fieldsight/naxa/network/ApiInterface.java index ebd7eff61..6de0c8cac 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/network/ApiInterface.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/network/ApiInterface.java @@ -104,7 +104,7 @@ Observable uploadSite(@Url String url, @Part("phone") RequestBody phone, @Part("address") RequestBody address, @Part("public_desc") RequestBody public_desc, - @Part("project") RequestBody project, + @Part("PROJECT") RequestBody project, @Part("type") RequestBody type, @Part("region") RequestBody regionID, @Part("site_meta_attributes_ans") RequestBody metaAttrs); @@ -227,7 +227,7 @@ Observable updateSite(@Url String url, @Part("phone") RequestBody phone, @Part("address") RequestBody address, @Part("public_desc") RequestBody public_desc, - @Part("project") RequestBody project, + @Part("PROJECT") RequestBody project, @Part("type") RequestBody type, @Part("region") RequestBody regionID, @Part("site_meta_attributes_ans") RequestBody metaAttrs); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/network/NetworkUtils.java b/collect_app/src/main/java/org/fieldsight/naxa/network/NetworkUtils.java index 2f8904d8d..077252953 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/network/NetworkUtils.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/network/NetworkUtils.java @@ -13,7 +13,9 @@ private static NetworkInfo getNetworkStat() { ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); if (cm != null) return cm.getActiveNetworkInfo(); - else return null; + else { + return null; + } } public static boolean isMopbileType() { diff --git a/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/Finstance.java b/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/Finstance.java index d6064a1c2..ed61604f7 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/Finstance.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/Finstance.java @@ -27,7 +27,7 @@ public class Finstance { @SerializedName("site") @Expose private Integer site; - @SerializedName("project") + @SerializedName("PROJECT") @Expose private Integer project; @SerializedName("submitted_by") diff --git a/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationListActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationListActivity.java index a25fff525..fd3bc15c6 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationListActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationListActivity.java @@ -193,13 +193,14 @@ private void pullNotificationByDate(String type) { if (lastUpdatedDate != null) { String date = lastUpdatedDate.getReceivedDateTime(); - String epochTime = DateTimeUtils.tsToSec8601(date)+""; + String epochTime = DateTimeUtils.tsToSec8601(date) + ""; Timber.i("NotificationListActivity, date = %s, epochTime = %s", date, epochTime); if (epochTime != null) { getDataFromServer(epochTime, type); } else { - if (swipeLayout.isRefreshing()) + if (swipeLayout.isRefreshing()) { swipeLayout.setRefreshing(false); + } Toast.makeText(getApplicationContext(), "Invalid date format", Toast.LENGTH_SHORT).show(); } } else { @@ -208,7 +209,6 @@ private void pullNotificationByDate(String type) { } - void getDataFromServer(String mEpcoh, String mType) { NotificationRemoteSource.getInstance().getNotifications(mEpcoh, mType) .toObservable() diff --git a/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationsAdapter.java b/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationsAdapter.java index 7c7b95e03..6aecfbbd0 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationsAdapter.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/notificationslist/NotificationsAdapter.java @@ -71,8 +71,11 @@ public void updateList(List newList) { } public FieldSightNotification getMostRecentNotification() { - if (fieldSightNotifications.size() > 0) return fieldSightNotifications.get(0); - else return null; + if (fieldSightNotifications.size() > 0) { + return fieldSightNotifications.get(0); + } else { + NotificationsAdapter + } } @Override diff --git a/collect_app/src/main/java/org/fieldsight/naxa/onboarding/SyncableItem.java b/collect_app/src/main/java/org/fieldsight/naxa/onboarding/SyncableItem.java index 277426f6e..4e9c6348d 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/onboarding/SyncableItem.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/onboarding/SyncableItem.java @@ -130,8 +130,12 @@ public void setDetail(String detail) { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } SyncableItem that = (SyncableItem) o; return uid == that.uid && downloadingStatus == that.downloadingStatus && diff --git a/collect_app/src/main/java/org/fieldsight/naxa/onboarding/XMLFormDownloadService.java b/collect_app/src/main/java/org/fieldsight/naxa/onboarding/XMLFormDownloadService.java index 8c92aa3da..b7679882d 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/onboarding/XMLFormDownloadService.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/onboarding/XMLFormDownloadService.java @@ -106,7 +106,7 @@ protected void onHandleIntent(@Nullable Intent intent) { .getStatusById(Constant.DownloadUID.PROJECT_SITES) .map(syncableItem -> { if (syncableItem.getDownloadingStatus() == Constant.DownloadStatus.RUNNING) { - throw new DownloadRunningException("Waiting until project and sites are downloaded"); + throw new DownloadRunningException("Waiting until PROJECT and sites are downloaded"); } return syncableItem; @@ -119,7 +119,7 @@ public ObservableSource apply(Observable throwableObservable) { @Override public ObservableSource apply(Throwable throwable) { if (throwable instanceof DownloadRunningException) { - Timber.i("Polling for project sites"); + Timber.i("Polling for PROJECT sites"); return Observable.timer(3, TimeUnit.SECONDS); } @@ -140,7 +140,7 @@ public SingleSource> apply(DownloadableItem syncableItem) { @Override public List apply(List projects) throws Exception { if (projects.isEmpty()) { - throw new RuntimeException("Download project(s) site(s) first"); + throw new RuntimeException("Download PROJECT(s) site(s) first"); } return projects; } @@ -185,7 +185,7 @@ public void onNext(List projects) { } if (formsToDownlaod == null || formsToDownlaod.isEmpty()) { - broadcastDownloadError("No project id provided to download forms"); + broadcastDownloadError("No PROJECT id provided to download forms"); } else { downloadFormList(getApplicationContext(), XMLFormDownloadService.this, XMLFormDownloadService.this, formsToDownlaod.get(0)); broadcastDownloadStarted(); @@ -249,7 +249,7 @@ public void formsDownloadingComplete(HashMap result) { return; } - Log.d(TAG, "Forms Downloading Complete for project " + formsToDownlaod.get(0).getFormCreatorsId()); + Log.d(TAG, "Forms Downloading Complete for PROJECT " + formsToDownlaod.get(0).getFormCreatorsId()); //remove the site that has completed download diff --git a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/GeneralFormAndSubmission.java b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/GeneralFormAndSubmission.java index 4b0313d09..6b5522e41 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/GeneralFormAndSubmission.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/GeneralFormAndSubmission.java @@ -32,8 +32,12 @@ public void setSubmissionDetail(SubmissionDetail submissionDetail) { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()){ + return false; + } GeneralFormAndSubmission that = (GeneralFormAndSubmission) o; return Objects.equal(generalForm, that.generalForm) && Objects.equal(submissionDetail, that.submissionDetail); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/LastSubmissionResponse.java b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/LastSubmissionResponse.java index 9e3d90880..41bb5c143 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/LastSubmissionResponse.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/LastSubmissionResponse.java @@ -20,7 +20,7 @@ public class LastSubmissionResponse { @SerializedName("results") @Expose - private List submissionDetails = null; + private List submissionDetails; public Integer getCount() { return count; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubStageAndSubmission.java b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubStageAndSubmission.java index 3a4076218..7a5a04495 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubStageAndSubmission.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubStageAndSubmission.java @@ -15,8 +15,12 @@ public class SubStageAndSubmission { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } SubStageAndSubmission that = (SubStageAndSubmission) o; return Objects.equal(subStage, that.subStage) && Objects.equal(submissionDetail, that.submissionDetail); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubmissionDetail.java b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubmissionDetail.java index 635b858f9..e4010f8d5 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubmissionDetail.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/previoussubmission/model/SubmissionDetail.java @@ -2,7 +2,6 @@ package org.fieldsight.naxa.previoussubmission.model; - import androidx.annotation.NonNull; import androidx.room.Entity; import androidx.room.Ignore; @@ -25,7 +24,7 @@ public class SubmissionDetail { @Expose private String site; - @SerializedName("project") + @SerializedName("PROJECT") @Expose private String project; @@ -124,18 +123,22 @@ public void setUid(Integer uid) { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } SubmissionDetail that = (SubmissionDetail) o; return Objects.equal(site, that.site) && - Objects.equal(project, that.project) && - Objects.equal(siteFsFormId, that.siteFsFormId) && - Objects.equal(projectFsFormId, that.projectFsFormId) && - Objects.equal(submissionDateTime, that.submissionDateTime) && - Objects.equal(submittedBy, that.submittedBy) && - Objects.equal(formType, that.formType) && - Objects.equal(statusDisplay, that.statusDisplay); + Objects.equal(project, that.project) && + Objects.equal(siteFsFormId, that.siteFsFormId) && + Objects.equal(projectFsFormId, that.projectFsFormId) && + Objects.equal(submissionDateTime, that.submissionDateTime) && + Objects.equal(submittedBy, that.submittedBy) && + Objects.equal(formType, that.formType) && + Objects.equal(statusDisplay, that.statusDisplay); } @Override diff --git a/collect_app/src/main/java/org/fieldsight/naxa/project/MapActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/project/MapActivity.java index c917aee8b..00b513d6d 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/project/MapActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/project/MapActivity.java @@ -1,4 +1,4 @@ -//package org.fieldsight.naxa.project;/* +//package org.fieldsight.naxa.PROJECT;/* // * Copyright (C) 2016 GeoODK // * // * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except diff --git a/collect_app/src/main/java/org/fieldsight/naxa/project/MapFragment.java b/collect_app/src/main/java/org/fieldsight/naxa/project/MapFragment.java index 3c31fe0f6..66c9638f8 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/project/MapFragment.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/project/MapFragment.java @@ -1,4 +1,4 @@ -//package org.fieldsight.naxa.project; +//package org.fieldsight.naxa.PROJECT; // //import android.annotation.SuppressLint; //import android.content.BroadcastReceiver; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/project/data/ProjectRepository.java b/collect_app/src/main/java/org/fieldsight/naxa/project/data/ProjectRepository.java index 75341a6a6..e34a8c413 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/project/data/ProjectRepository.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/project/data/ProjectRepository.java @@ -148,7 +148,9 @@ public Project apply(JSONObject json) throws Exception { } private ArrayList mapJSONtoSiteTypes(String types) { - if (TextUtils.isEmpty(types)) return new ArrayList<>(); + if (TextUtils.isEmpty(types)) { + return new ArrayList<>(); + } Type siteTypeToken = new TypeToken>() { }.getType(); return new Gson().fromJson(types, siteTypeToken); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/report/ReportActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/report/ReportActivity.java index 34ab58e0e..d39e677af 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/report/ReportActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/report/ReportActivity.java @@ -48,34 +48,34 @@ public class ReportActivity extends CollectAbstractActivity { @BindView(R.id.tv_device_id) - TextView tv_device_id; + TextView tvDeviceId; @BindView(R.id.tv_fcm_token) - TextView tv_fcm_token; + TextView tvFcmToken; @BindView(R.id.tv_app_version) - TextView tv_app_version; + TextView tvAppVersion; @BindView(R.id.tv_os_version) - TextView tv_os_version; + TextView tvOsVersion; @BindView(R.id.tv_lat) - TextView tv_lat; + TextView tvLat; @BindView(R.id.tv_lng) - TextView tv_lng; + TextView tvLng; @BindView(R.id.spnr_type) - Spinner spnr_type; + Spinner spnrType; @BindView(R.id.tv_device_name) - TextView tv_device_name; + TextView tvDeviceName; @BindView(R.id.edt_message) - EditText edt_message; + EditText edtMessage; @BindView(R.id.chkbx_agree) - CheckBox chkbx_agree; + CheckBox chkbxAgree; @BindView(R.id.toolbar) Toolbar toolbar; @@ -93,11 +93,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); hideKeyboardInActivity(); fusedLocationClient = LocationServices.getFusedLocationProviderClient(this); - tv_device_id.setText(new PropertyManager(this).getSingularProperty(PropertyManager.PROPMGR_DEVICE_ID)); - tv_fcm_token.setText(SharedPreferenceUtils.getFromPrefs(this, SharedPreferenceUtils.PREF_VALUE_KEY.KEY_FCM, "")); - tv_app_version.setText(BuildConfig.VERSION_NAME); - tv_os_version.setText(Build.VERSION.RELEASE); - tv_device_name.setText(Build.MANUFACTURER); + tvDeviceId.setText(new PropertyManager(this).getSingularProperty(PropertyManager.PROPMGR_DEVICE_ID)); + tvFcmToken.setText(SharedPreferenceUtils.getFromPrefs(this, SharedPreferenceUtils.PREF_VALUE_KEY.KEY_FCM, "")); + tvAppVersion.setText(BuildConfig.VERSION_NAME); + tvOsVersion.setText(Build.VERSION.RELEASE); + tvDeviceName.setText(Build.MANUFACTURER); new PermissionUtils().requestLocationPermissions(this, new PermissionListener() { @SuppressLint("MissingPermission") @Override @@ -108,8 +108,8 @@ public void granted() { public void onSuccess(Location location) { // Got last known location. In some rare situations this can be null. if (location != null) { - tv_lat.setText(location.getLatitude() + ""); - tv_lng.setText(location.getLongitude() + ""); + tvLat.setText(location.getLatitude() + ""); + tvLng.setText(location.getLongitude() + ""); } } }); @@ -143,17 +143,17 @@ void submitReport() { Toast.makeText(getApplicationContext(), "Report form is submitting please wait", Toast.LENGTH_SHORT).show(); return; } - if(chkbx_agree.isChecked()) { + if(chkbxAgree.isChecked()) { isSubmitting = true; - String deviceId = checkEmptyWithFallback(tv_device_id, "0"); - String deviceName = checkEmptyWithFallback(tv_device_name, ""); - String fcmToken = checkEmptyWithFallback(tv_fcm_token, ""); - String app_os_version = checkEmptyWithFallback(tv_os_version, ""); - String lat = checkEmptyWithFallback(tv_lat, "0"); - String lng = checkEmptyWithFallback(tv_lng, "0"); - String message_type = checkEmptyWithFallback(spnr_type, ""); - String app_version = checkEmptyWithFallback(tv_app_version, ""); - String message = checkEmptyWithFallback(edt_message, "I have an issues using the app"); + String deviceId = checkEmptyWithFallback(tvDeviceId, "0"); + String deviceName = checkEmptyWithFallback(tvDeviceName, ""); + String fcmToken = checkEmptyWithFallback(tvFcmToken, ""); + String app_os_version = checkEmptyWithFallback(tvOsVersion, ""); + String lat = checkEmptyWithFallback(tvLat, "0"); + String lng = checkEmptyWithFallback(tvLng, "0"); + String message_type = checkEmptyWithFallback(spnrType, ""); + String app_version = checkEmptyWithFallback(tvAppVersion, ""); + String message = checkEmptyWithFallback(edtMessage, "I have an issues using the app"); observer = ServiceGenerator.getRxClient().create(ApiInterface.class) .submitReport(deviceId, fcmToken, app_version, app_os_version, message_type, message, deviceName, lat, lng) .subscribeOn(Schedulers.io()) diff --git a/collect_app/src/main/java/org/fieldsight/naxa/scheduled/data/ScheduleForm.java b/collect_app/src/main/java/org/fieldsight/naxa/scheduled/data/ScheduleForm.java index 1de1217fc..943774215 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/scheduled/data/ScheduleForm.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/scheduled/data/ScheduleForm.java @@ -122,7 +122,7 @@ public void setLastFilledDateTime(String lastFilledDateTime) { this.lastFilledDateTime = lastFilledDateTime; } - @SerializedName("project") + @SerializedName("PROJECT") @Expose private String projectId; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/site/CreateSiteActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/site/CreateSiteActivity.java index adba265a8..1cc463e2b 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/site/CreateSiteActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/site/CreateSiteActivity.java @@ -148,7 +148,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { try { project = getIntent().getExtras().getParcelable(EXTRA_OBJECT); } catch (Exception e) { - Timber.e("Can't start activity without project extra_object"); + Timber.e("Can't start activity without PROJECT extra_object"); ToastUtils.showLongToast(getString(R.string.msg_failed_to_load)); finish(); return; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/site/SiteType.java b/collect_app/src/main/java/org/fieldsight/naxa/site/SiteType.java index feb24821e..2719a8423 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/site/SiteType.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/site/SiteType.java @@ -31,7 +31,7 @@ public class SiteType { private String identifer; @Expose - @SerializedName("project") + @SerializedName("PROJECT") private String projectId; public String getProjectId() { diff --git a/collect_app/src/main/java/org/fieldsight/naxa/stages/data/Stage.java b/collect_app/src/main/java/org/fieldsight/naxa/stages/data/Stage.java index d899ded11..86d0b50c3 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/stages/data/Stage.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/stages/data/Stage.java @@ -54,7 +54,7 @@ public class Stage { @Expose private Integer site; - @SerializedName("project") + @SerializedName("PROJECT") @Expose private Integer project; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/survey/SurveyForm.java b/collect_app/src/main/java/org/fieldsight/naxa/survey/SurveyForm.java index 850713e35..b338f17fa 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/survey/SurveyForm.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/survey/SurveyForm.java @@ -16,7 +16,7 @@ public class SurveyForm { @SerializedName("id") private String fsFormId; - @SerializedName("project") + @SerializedName("PROJECT") private String projectId; @Ignore diff --git a/collect_app/src/main/java/org/fieldsight/naxa/sync/DownloadableItemLocalSource.java b/collect_app/src/main/java/org/fieldsight/naxa/sync/DownloadableItemLocalSource.java index a7af6d70c..cc08c767e 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/sync/DownloadableItemLocalSource.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/sync/DownloadableItemLocalSource.java @@ -225,11 +225,11 @@ private String formattedDate() { private DownloadableItem[] getData() { return new DownloadableItem[]{ - new DownloadableItem(PROJECT_SITES, PENDING, "Project and sites", "Downloads your assigned project and sites"), + new DownloadableItem(PROJECT_SITES, PENDING, "Project and sites", "Downloads your assigned PROJECT and sites"), new DownloadableItem(Constant.DownloadUID.ALL_FORMS, PENDING, "Forms", "Downloads all forms for assigned sites"), new DownloadableItem(Constant.DownloadUID.SITE_TYPES, PENDING, "Site type(s)", "Download site types to filter staged forms"), new DownloadableItem(Constant.DownloadUID.EDU_MATERIALS, PENDING, "Educational Materials", "Download educational attached for form(s)"), - new DownloadableItem(Constant.DownloadUID.PROJECT_CONTACTS, PENDING, "Project Contact(s)", "Download contact information for people associated with your project"), + new DownloadableItem(Constant.DownloadUID.PROJECT_CONTACTS, PENDING, "Project Contact(s)", "Download contact information for people associated with your PROJECT"), //new DownloadableItem(Constant.DownloadUID.PREV_SUBMISSION, PENDING, "Previous Submissions", "Download previous submission(s) for forms"), new DownloadableItem(EDITED_SITES, PENDING, "Edited Site(s)", ""), new DownloadableItem(OFFLINE_SITES, PENDING, "Offline Site(s)", ""), diff --git a/collect_app/src/main/java/org/fieldsight/naxa/sync/SyncRepository.java b/collect_app/src/main/java/org/fieldsight/naxa/sync/SyncRepository.java index fab8fb5e9..2a715f8e5 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/sync/SyncRepository.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/sync/SyncRepository.java @@ -180,7 +180,7 @@ protected Void doInBackground(final SyncableItem... items) { public void init() { SyncableItem[] syncableItems = new SyncableItem[]{ - new SyncableItem(Constant.DownloadUID.PROJECT_SITES, PENDING, null, "Project and sites", "Downloads your assigned project and sites"), + new SyncableItem(Constant.DownloadUID.PROJECT_SITES, PENDING, null, "Project and sites", "Downloads your assigned PROJECT and sites"), new SyncableItem(Constant.DownloadUID.ALL_FORMS, PENDING, null, "Forms", "Downloads all forms for assigned sites"), // new SyncableItem(Constant.DownloadUID.ODK_FORMS, PENDING, null, "ODK forms", "Downloads odk forms for your sites"), // new SyncableItem(Constant.DownloadUID.GENERAL_FORMS, PENDING, null, "General forms", "Downloads general forms for your sites"), @@ -188,7 +188,7 @@ public void init() { // new SyncableItem(Constant.DownloadUID.SCHEDULED_FORMS, PENDING, null, "Scheduled forms", "Download scheduled forms for your sites"), new SyncableItem(Constant.DownloadUID.SITE_TYPES, PENDING, null, "Site type(s)", "Download site types to filter staged forms"), new SyncableItem(Constant.DownloadUID.EDU_MATERIALS, PENDING, null, "Educational Materials", "Download educational attached for form(s)"), - new SyncableItem(Constant.DownloadUID.PROJECT_CONTACTS, PENDING, null, "Project Contact(s)", "Download contact information for people associated with your project"), + new SyncableItem(Constant.DownloadUID.PROJECT_CONTACTS, PENDING, null, "Project Contact(s)", "Download contact information for people associated with your PROJECT"), new SyncableItem(Constant.DownloadUID.PREV_SUBMISSION, PENDING, null, "Previous Submissions", "Download previous submission(s) for forms"), }; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/ProjectListActivityV3.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/ProjectListActivityV3.java index ce7bbf3ec..651f61c8c 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/ProjectListActivityV3.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/ProjectListActivityV3.java @@ -94,7 +94,7 @@ public void onChanged() { selected++; } } - Timber.d("project list counter is %d", selected); + Timber.d("PROJECT list counter is %d", selected); if (selected > 0) { tvSyncProject.setVisibility(View.VISIBLE); tvSyncProject.setBackgroundColor(getResources().getColor(R.color.secondaryColor)); @@ -161,7 +161,7 @@ void manageNodata(boolean loading) { llNodata.setVisibility(View.GONE); } prgbar.setVisibility(loading ? View.VISIBLE : View.GONE); - tvNodata.setText(loading ? "Loading data ... " : "Error in syncing the project"); + tvNodata.setText(loading ? "Loading data ... " : "Error in syncing the PROJECT"); } void getDataFromServer() { @@ -185,7 +185,7 @@ public void onDataNotAvailable() { } - // Clear the sync project list and add the selected projects + // Clear the sync PROJECT list and add the selected projects ArrayList manageSyncList() { ArrayList syncProjectList = new ArrayList<>(); for (Project project : projectList) { @@ -237,13 +237,13 @@ public boolean onOptionsItemSelected(MenuItem item) { startActivity(new Intent(this, BackupActivity.class)); return true; case R.id.action_refresh: -// check all the project and make auto true +// check all the PROJECT and make auto true allSelected = !allSelected; for (Project project : projectList) { -// if (!project.isSynced()) { +// if (!PROJECT.isSynced()) { project.setChecked(allSelected); // } else { -// project.setChecked(false); +// PROJECT.setChecked(false); // } } adapter.toggleAllSelected(allSelected); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectListAdapter.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectListAdapter.java index 08c6ea284..29ea48ad8 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectListAdapter.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectListAdapter.java @@ -66,7 +66,7 @@ public void notifyProjectisSynced(List projecttuple) { if (projectList.get(i).getId().equals(projecttuple.get(j).projectId)) { int status = projecttuple.get(j).status; if(status == Constant.DownloadStatus.RUNNING) { - projectList.get(i).setStatusMessage("Syncing project"); + projectList.get(i).setStatusMessage("Syncing PROJECT"); } else if(status == Constant.DownloadStatus.COMPLETED) { projectList.get(i).setSynced(true); projectList.get(i).setSyncedDate(projecttuple.get(j).created_date); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectViewHolder.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectViewHolder.java index 95376fffe..8e3e3ddaa 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectViewHolder.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/ProjectViewHolder.java @@ -48,12 +48,12 @@ public ProjectViewHolder(@NonNull View itemView) { void bindView(Project project, boolean allTrue) { primary_text.setText(project.getName()); - sub_text.setText(String.format("A project by %s", project.getOrganizationName())); + sub_text.setText(String.format("A PROJECT by %s", project.getOrganizationName())); tv_synced_date.setText(project.getStatusMessage()); chkbx_sync.setChecked(project.isChecked()); chkbx_sync.setVisibility(allTrue ? View.VISIBLE : View.GONE); -// imageView.setImageResource(project.isSynced() ? R.drawable.ic_action_check : android.R.drawable.stat_sys_download_done); - Timber.i("project image = %s", project.getUrl()); +// imageView.setImageResource(PROJECT.isSynced() ? R.drawable.ic_action_check : android.R.drawable.stat_sys_download_done); + Timber.i("PROJECT image = %s", project.getUrl()); Glide.with(itemView.getContext()).load(project.getUrl()).apply(RequestOptions.circleCropTransform()).into(iv_thumbnail); } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/SyncAdapterv3.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/SyncAdapterv3.java index 33cad899f..be1554347 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/SyncAdapterv3.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/adapter/SyncAdapterv3.java @@ -23,7 +23,7 @@ * @author: yubaraj poudel * @Since 2019/05/10 *

- * Manages the sync of all the project related contents. It is the controller that allows the user to select + * Manages the sync of all the PROJECT related contents. It is the controller that allows the user to select * which content of the projects to download **/ @@ -138,7 +138,7 @@ public SyncViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { return new SyncViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.row_sync_all, viewGroup, false)) { @Override public void downloadListItemClicked(int parentPos, int pos) { - Timber.i("Syncadapterv3, project details clicked"); + Timber.i("Syncadapterv3, PROJECT details clicked"); if (callback != null) { Project p = selectedProjectList.get(parentPos); syncableMap.get(p.getId()).get(pos).toggleSync(); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/forms/FieldSightFormDownloader.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/forms/FieldSightFormDownloader.java index 2e4cf1ee9..f49e97c24 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/forms/FieldSightFormDownloader.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/forms/FieldSightFormDownloader.java @@ -77,7 +77,7 @@ public Pair downloadSingleFieldSightForm(Fields try { message = processOneForm(1, 1, fd); pair = Pair.create(fieldsightFormDetailsv3, message); - Timber.d("form downloading starts for project = " + fieldsightFormDetailsv3.getSite_project_id() + " or " + fieldsightFormDetailsv3.getProject() + " for = " + fd.getFormName()); + Timber.d("form downloading starts for PROJECT = " + fieldsightFormDetailsv3.getSite_project_id() + " or " + fieldsightFormDetailsv3.getProject() + " for = " + fd.getFormName()); } catch (TaskCancelledException e) { Timber.e(e); pair = Pair.create(fieldsightFormDetailsv3, "Failed to create form download request"); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncActivity.java index 502939292..a9b69ed50 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncActivity.java @@ -70,7 +70,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - /// getting the selected project list from the projectlist activity + /// getting the selected PROJECT list from the projectlist activity Timber.i("SyncActivity, alreadySyncing:: " + (Collect.selectedProjectList != null && Collect.selectedProjectList.size() > 0)); if (Collect.selectedProjectList != null && Collect.selectedProjectList.size() > 0) { syncing = true; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncServiceV3.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncServiceV3.java index c23a44d23..54bc8d5ba 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncServiceV3.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/network/SyncServiceV3.java @@ -123,7 +123,7 @@ public SingleSource> apply(List projects) throws Exc @Override public ArrayList apply(List> pairs) throws Exception { HashSet failedProjectId = new HashSet<>(); - //collect project ids with failed forms + //collect PROJECT ids with failed forms for (Pair pair : pairs) { String message = pair.second; FieldsightFormDetailsv3 fd = pair.first; @@ -381,7 +381,7 @@ private String[] getFailedFormUrl(Throwable throwable) { private void markAsFailed(String projectId, int type, String failedUrl, boolean shouldRetry) { saveState(projectId, type, failedUrl, false, Constant.DownloadStatus.FAILED); - Timber.e("Download stopped %s for project %s", failedUrl, projectId); + Timber.e("Download stopped %s for PROJECT %s", failedUrl, projectId); } private void markAsFailed(String projectId, int type, String failedUrl) { @@ -396,7 +396,7 @@ private void markAsRunning(String projectId, int type) { private void markAsCompleted(String projectId, int type) { saveState(projectId, type, "", false, Constant.DownloadStatus.COMPLETED); - Timber.i("Download completed for project %s", projectId); + Timber.i("Download completed for PROJECT %s", projectId); } private void saveState(String projectId, int type, String failedUrl, boolean started, int status) { diff --git a/collect_app/src/main/java/org/odk/collect/android/logic/FormController.java b/collect_app/src/main/java/org/odk/collect/android/logic/FormController.java index ffc90c928..bb9502598 100644 --- a/collect_app/src/main/java/org/odk/collect/android/logic/FormController.java +++ b/collect_app/src/main/java/org/odk/collect/android/logic/FormController.java @@ -17,13 +17,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import org.odk.collect.android.exception.JavaRosaException; -import org.odk.collect.android.external.ExternalDataUtil; -import org.odk.collect.android.logic.actions.setgeopoint.CollectSetGeopointActionHandler; -import org.odk.collect.android.views.ODKView; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - import org.javarosa.core.model.CoreModelModule; import org.javarosa.core.model.FormDef; import org.javarosa.core.model.FormIndex; @@ -61,6 +54,7 @@ import org.odk.collect.android.utilities.AuditEventLogger; import org.odk.collect.android.utilities.FileUtils; import org.odk.collect.android.utilities.RegexUtils; +import org.odk.collect.android.views.ODKView; import java.io.File; import java.io.IOException; diff --git a/collect_app/src/main/java/org/odk/collect/android/preferences/ServerPreferences.java b/collect_app/src/main/java/org/odk/collect/android/preferences/ServerPreferences.java index 2502288a0..69866a6bd 100644 --- a/collect_app/src/main/java/org/odk/collect/android/preferences/ServerPreferences.java +++ b/collect_app/src/main/java/org/odk/collect/android/preferences/ServerPreferences.java @@ -19,9 +19,10 @@ import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; -import androidx.annotation.Nullable; import android.view.View; +import androidx.annotation.Nullable; + import org.fieldsight.collect.android.R; import static org.odk.collect.android.preferences.GeneralKeys.KEY_PROTOCOL; diff --git a/collect_app/src/main/java/org/odk/collect/android/preferences/UserInterfacePreferences.java b/collect_app/src/main/java/org/odk/collect/android/preferences/UserInterfacePreferences.java index 7c1880b5c..c0edd7a5b 100644 --- a/collect_app/src/main/java/org/odk/collect/android/preferences/UserInterfacePreferences.java +++ b/collect_app/src/main/java/org/odk/collect/android/preferences/UserInterfacePreferences.java @@ -26,11 +26,8 @@ import androidx.annotation.Nullable; -import com.google.common.collect.ObjectArrays; - import org.fieldsight.collect.android.R; import org.odk.collect.android.activities.MainMenuActivity; - import org.odk.collect.android.utilities.LocaleHelper; import org.odk.collect.android.utilities.MediaUtils; diff --git a/collect_app/src/main/java/org/odk/collect/android/tasks/DownloadFormListTask.java b/collect_app/src/main/java/org/odk/collect/android/tasks/DownloadFormListTask.java index 813134d42..2b864e2f2 100644 --- a/collect_app/src/main/java/org/odk/collect/android/tasks/DownloadFormListTask.java +++ b/collect_app/src/main/java/org/odk/collect/android/tasks/DownloadFormListTask.java @@ -15,11 +15,11 @@ package org.odk.collect.android.tasks; import android.os.AsyncTask; + import androidx.annotation.Nullable; import org.odk.collect.android.listeners.FormListDownloaderListener; import org.odk.collect.android.logic.FormDetails; -import org.fieldsight.naxa.onboarding.XMLForm; import org.odk.collect.android.utilities.DownloadFormListUtils; import java.util.HashMap; diff --git a/collect_app/src/main/java/org/odk/collect/android/tasks/ServerPollingJob.java b/collect_app/src/main/java/org/odk/collect/android/tasks/ServerPollingJob.java index 0854c3167..d75c6d602 100644 --- a/collect_app/src/main/java/org/odk/collect/android/tasks/ServerPollingJob.java +++ b/collect_app/src/main/java/org/odk/collect/android/tasks/ServerPollingJob.java @@ -23,6 +23,7 @@ import android.database.Cursor; import android.net.ConnectivityManager; import android.net.NetworkInfo; + import androidx.annotation.NonNull; import com.evernote.android.job.Job; @@ -30,11 +31,11 @@ import com.evernote.android.job.JobRequest; import org.fieldsight.collect.android.R; -import org.odk.collect.android.application.Collect; -import org.odk.collect.android.logic.FormDetails; import org.odk.collect.android.activities.FormDownloadList; import org.odk.collect.android.activities.NotificationActivity; +import org.odk.collect.android.application.Collect; import org.odk.collect.android.dao.FormsDao; +import org.odk.collect.android.logic.FormDetails; import org.odk.collect.android.preferences.GeneralSharedPreferences; import org.odk.collect.android.utilities.DownloadFormListUtils; import org.odk.collect.android.utilities.FormDownloader; @@ -51,8 +52,6 @@ import static org.odk.collect.android.preferences.GeneralKeys.KEY_AUTOMATIC_UPDATE; import static org.odk.collect.android.provider.FormsProviderAPI.FormsColumns.JR_FORM_ID; import static org.odk.collect.android.provider.FormsProviderAPI.FormsColumns.LAST_DETECTED_FORM_VERSION_HASH; -import static org.odk.collect.android.activities.FormDownloadList.DISPLAY_ONLY_UPDATED_FORMS; -import static org.odk.collect.android.preferences.GeneralKeys.KEY_AUTOMATIC_UPDATE; import static org.odk.collect.android.utilities.ApplicationConstants.RequestCodes.FORMS_DOWNLOADED_NOTIFICATION; import static org.odk.collect.android.utilities.ApplicationConstants.RequestCodes.FORM_UPDATES_AVAILABLE_NOTIFICATION; import static org.odk.collect.android.utilities.DownloadFormListUtils.DL_AUTH_REQUIRED; diff --git a/collect_app/src/main/java/org/odk/collect/android/upload/InstanceGoogleSheetsUploader.java b/collect_app/src/main/java/org/odk/collect/android/upload/InstanceGoogleSheetsUploader.java index 9a5b27eee..d9b719528 100644 --- a/collect_app/src/main/java/org/odk/collect/android/upload/InstanceGoogleSheetsUploader.java +++ b/collect_app/src/main/java/org/odk/collect/android/upload/InstanceGoogleSheetsUploader.java @@ -24,11 +24,6 @@ import com.google.api.services.sheets.v4.model.ValueRange; import org.fieldsight.collect.android.R; -import org.odk.collect.android.application.Collect; -import org.odk.collect.android.dto.Form; -import org.odk.collect.android.dto.Instance; -import org.odk.collect.android.exception.BadUrlException; -import org.odk.collect.android.exception.MultipleFoldersFoundException; import org.javarosa.core.model.FormDef; import org.javarosa.core.model.instance.AbstractTreeElement; import org.javarosa.core.model.instance.TreeElement; @@ -37,7 +32,12 @@ import org.javarosa.form.api.FormEntryController; import org.javarosa.form.api.FormEntryModel; import org.javarosa.xform.util.XFormUtils; +import org.odk.collect.android.application.Collect; import org.odk.collect.android.dao.FormsDao; +import org.odk.collect.android.dto.Form; +import org.odk.collect.android.dto.Instance; +import org.odk.collect.android.exception.BadUrlException; +import org.odk.collect.android.exception.MultipleFoldersFoundException; import org.odk.collect.android.preferences.GeneralKeys; import org.odk.collect.android.preferences.GeneralSharedPreferences; import org.odk.collect.android.tasks.FormLoaderTask; diff --git a/collect_app/src/main/java/org/odk/collect/android/utilities/TextUtils.java b/collect_app/src/main/java/org/odk/collect/android/utilities/TextUtils.java index b1f4c5c8a..377d9dbde 100644 --- a/collect_app/src/main/java/org/odk/collect/android/utilities/TextUtils.java +++ b/collect_app/src/main/java/org/odk/collect/android/utilities/TextUtils.java @@ -129,7 +129,7 @@ public static String ellipsizeBeginning(String text) { /** * Copyright (C) 2006 The Android Open Source Project * - * Copied from Android project for testing. + * Copied from Android PROJECT for testing. * TODO: replace with String.join when minSdk goes to 26 * * Returns a string containing the tokens joined by delimiters.