diff --git a/build.gradle b/build.gradle index 4d60e95c8..2b15a9a66 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { maven { url 'https://maven.fabric.io/public' } } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:3.5.1' classpath 'com.google.gms:google-services:4.3.2' classpath 'org.ow2.asm:asm:7.2-beta' // https://github.com/jacoco/jacoco/issues/639#issuecomment-355424756 classpath 'org.jacoco:org.jacoco.core:0.8.4' diff --git a/collect_app/schemas/org.fieldsight.naxa.common.FieldSightDatabase/22.json b/collect_app/schemas/org.fieldsight.naxa.common.FieldSightDatabase/22.json index 2bb62dd9a..8b135b665 100644 --- a/collect_app/schemas/org.fieldsight.naxa.common.FieldSightDatabase/22.json +++ b/collect_app/schemas/org.fieldsight.naxa.common.FieldSightDatabase/22.json @@ -2,11 +2,11 @@ "formatVersion": 1, "database": { "version": 22, - "identityHash": "5940fba9456110e288f089bba811bca8", + "identityHash": "c7c07bf47a1f45c94665f6a69a71c350", "entities": [ { "tableName": "sites", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `latitude` TEXT, `longitude` TEXT, `identifier` TEXT, `name` TEXT, `typeId` TEXT, `typeLabel` TEXT, `phone` TEXT, `address` TEXT, `publicDesc` TEXT, `additionalDesc` TEXT, `logo` TEXT, `isActive` INTEGER, `location` TEXT, `isSurvey` INTEGER, `dateCreated` TEXT, `project` TEXT, `isSiteVerified` INTEGER NOT NULL, `siteTypeError` TEXT, `metaAttributes` TEXT, `siteDocuments` TEXT, `regionId` TEXT, `site` TEXT, `generalFormDeployedFrom` TEXT, `stagedFormDeployedFrom` TEXT, `scheduleFormDeployedForm` TEXT, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `latitude` TEXT, `longitude` TEXT, `identifier` TEXT, `name` TEXT, `typeId` TEXT, `typeLabel` TEXT, `phone` TEXT, `address` TEXT, `publicDesc` TEXT, `additionalDesc` TEXT, `logo` TEXT, `isActive` INTEGER, `location` TEXT, `isSurvey` INTEGER, `dateCreated` TEXT, `project` TEXT, `isSiteVerified` INTEGER NOT NULL, `siteTypeError` TEXT, `metaAttributes` TEXT, `siteDocuments` TEXT, `regionId` TEXT, `users` INTEGER NOT NULL, `site` TEXT, `generalFormDeployedFrom` TEXT, `stagedFormDeployedFrom` TEXT, `scheduleFormDeployedForm` TEXT, PRIMARY KEY(`id`))", "fields": [ { "fieldPath": "id", @@ -140,6 +140,12 @@ "affinity": "TEXT", "notNull": false }, + { + "fieldPath": "users", + "columnName": "users", + "affinity": "INTEGER", + "notNull": true + }, { "fieldPath": "site", "columnName": "site", @@ -176,7 +182,7 @@ }, { "tableName": "project", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `description` TEXT, `address` TEXT, `lat` TEXT, `lon` TEXT, `url` TEXT, `siteClusters` TEXT, `organizationName` TEXT, `organizationlogourl` TEXT, `hasClusteredSites` INTEGER, `typeId` INTEGER, `typeLabel` TEXT, `phone` TEXT, `isSyncedWithRemote` INTEGER NOT NULL, `terms_and_labels` TEXT, `regionList` TEXT, `typesList` TEXT, `siteMetaAttributes` TEXT, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `description` TEXT, `address` TEXT, `lat` TEXT, `lon` TEXT, `url` TEXT, `siteClusters` TEXT, `organizationName` TEXT, `organizationlogourl` TEXT, `hasClusteredSites` INTEGER, `typeId` INTEGER, `typeLabel` TEXT, `phone` TEXT, `isSyncedWithRemote` INTEGER NOT NULL, `terms_and_labels` TEXT, `regionList` TEXT, `siteMetaAttributes` TEXT, PRIMARY KEY(`id`))", "fields": [ { "fieldPath": "id", @@ -280,12 +286,6 @@ "affinity": "TEXT", "notNull": false }, - { - "fieldPath": "typesList", - "columnName": "typesList", - "affinity": "TEXT", - "notNull": false - }, { "fieldPath": "siteMetaAttributes", "columnName": "siteMetaAttributes", @@ -1606,10 +1606,9 @@ "foreignKeys": [] } ], - "views": [], "setupQueries": [ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '5940fba9456110e288f089bba811bca8')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"c7c07bf47a1f45c94665f6a69a71c350\")" ] } } \ No newline at end of file diff --git a/collect_app/schemas/org.fieldsight.naxa.common.FieldSightDatabase/25.json b/collect_app/schemas/org.fieldsight.naxa.common.FieldSightDatabase/25.json new file mode 100644 index 000000000..fa39217aa --- /dev/null +++ b/collect_app/schemas/org.fieldsight.naxa.common.FieldSightDatabase/25.json @@ -0,0 +1,1632 @@ +{ + "formatVersion": 1, + "database": { + "version": 25, + "identityHash": "ea38e35d3380ff65488c6b335c0c9bb4", + "entities": [ + { + "tableName": "sites", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `latitude` TEXT, `longitude` TEXT, `identifier` TEXT, `name` TEXT, `typeId` TEXT, `typeLabel` TEXT, `phone` TEXT, `address` TEXT, `publicDesc` TEXT, `additionalDesc` TEXT, `logo` TEXT, `isActive` INTEGER, `location` TEXT, `isSurvey` INTEGER, `dateCreated` TEXT, `project` TEXT, `current_progress` INTEGER NOT NULL, `site_logo` TEXT, `isSiteVerified` INTEGER NOT NULL, `siteTypeError` TEXT, `metaAttributes` TEXT, `siteDocuments` TEXT, `regionId` TEXT, `submissions` INTEGER NOT NULL, `users` INTEGER NOT NULL, `site` TEXT, `generalFormDeployedFrom` TEXT, `stagedFormDeployedFrom` TEXT, `scheduleFormDeployedForm` TEXT, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "latitude", + "columnName": "latitude", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "longitude", + "columnName": "longitude", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "identifier", + "columnName": "identifier", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "typeId", + "columnName": "typeId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "typeLabel", + "columnName": "typeLabel", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicDesc", + "columnName": "publicDesc", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "additionalDesc", + "columnName": "additionalDesc", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "logo", + "columnName": "logo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isActive", + "columnName": "isActive", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "location", + "columnName": "location", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isSurvey", + "columnName": "isSurvey", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "project", + "columnName": "project", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "current_progress", + "columnName": "current_progress", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "site_logo", + "columnName": "site_logo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isSiteVerified", + "columnName": "isSiteVerified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "siteTypeError", + "columnName": "siteTypeError", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "metaAttributes", + "columnName": "metaAttributes", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteDocuments", + "columnName": "siteDocuments", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "regionId", + "columnName": "regionId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "submissions", + "columnName": "submissions", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "users", + "columnName": "users", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "site", + "columnName": "site", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "generalFormDeployedFrom", + "columnName": "generalFormDeployedFrom", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stagedFormDeployedFrom", + "columnName": "stagedFormDeployedFrom", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "scheduleFormDeployedForm", + "columnName": "scheduleFormDeployedForm", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "project", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `description` TEXT, `address` TEXT, `lat` TEXT, `lon` TEXT, `url` TEXT, `siteClusters` TEXT, `organizationName` TEXT, `organizationlogourl` TEXT, `hasClusteredSites` INTEGER, `typeId` INTEGER, `typeLabel` TEXT, `phone` TEXT, `isSyncedWithRemote` INTEGER NOT NULL, `terms_and_labels` TEXT, `regionList` TEXT, `siteMetaAttributes` TEXT, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lat", + "columnName": "lat", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lon", + "columnName": "lon", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteClusters", + "columnName": "siteClusters", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "organizationName", + "columnName": "organizationName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "organizationlogourl", + "columnName": "organizationlogourl", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasClusteredSites", + "columnName": "hasClusteredSites", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "typeId", + "columnName": "typeId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "typeLabel", + "columnName": "typeLabel", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isSyncedWithRemote", + "columnName": "isSyncedWithRemote", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "terms_and_labels", + "columnName": "terms_and_labels", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "regionList", + "columnName": "regionList", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteMetaAttributes", + "columnName": "siteMetaAttributes", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sync", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uid` INTEGER NOT NULL, `downloadingStatus` INTEGER NOT NULL, `lastSyncDateTime` TEXT, `title` TEXT, `detail` TEXT, `checked` INTEGER NOT NULL, `progressStatus` INTEGER NOT NULL, PRIMARY KEY(`uid`))", + "fields": [ + { + "fieldPath": "uid", + "columnName": "uid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "downloadingStatus", + "columnName": "downloadingStatus", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "lastSyncDateTime", + "columnName": "lastSyncDateTime", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "detail", + "columnName": "detail", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "checked", + "columnName": "checked", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "progressStatus", + "columnName": "progressStatus", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "uid" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "general_forms", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`fsFormId` TEXT NOT NULL, `formDeployedFrom` TEXT NOT NULL, `name` TEXT, `idString` TEXT, `responsesCount` INTEGER, `dateCreated` TEXT, `dateModified` TEXT, `formStatus` INTEGER, `isDeployed` INTEGER, `fromProject` INTEGER, `defaultSubmissionStatus` INTEGER, `xf` INTEGER, `siteId` TEXT, `projectId` TEXT, `downloadUrl` TEXT, `manifestUrl` TEXT, `fsform` TEXT, `lastSubmissionBy` TEXT, `lastSubmissionDateTime` TEXT, PRIMARY KEY(`fsFormId`, `formDeployedFrom`))", + "fields": [ + { + "fieldPath": "fsFormId", + "columnName": "fsFormId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "formDeployedFrom", + "columnName": "formDeployedFrom", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "idString", + "columnName": "idString", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "responsesCount", + "columnName": "responsesCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dateModified", + "columnName": "dateModified", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formStatus", + "columnName": "formStatus", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeployed", + "columnName": "isDeployed", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "fromProject", + "columnName": "fromProject", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "defaultSubmissionStatus", + "columnName": "defaultSubmissionStatus", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "xf", + "columnName": "xf", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "siteId", + "columnName": "siteId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectId", + "columnName": "projectId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "downloadUrl", + "columnName": "downloadUrl", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "manifestUrl", + "columnName": "manifestUrl", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "fsform", + "columnName": "fsform", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastSubmissionBy", + "columnName": "lastSubmissionBy", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastSubmissionDateTime", + "columnName": "lastSubmissionDateTime", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "fsFormId", + "formDeployedFrom" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "scheduled_form", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`formDeployedFrom` TEXT NOT NULL, `scheduleId` TEXT NOT NULL, `fsFormId` TEXT, `scheduleLevel` TEXT, `startDate` TEXT, `endDate` TEXT, `scheduleName` TEXT, `siteId` TEXT, `idString` TEXT, `lastSubmissionBy` TEXT, `lastSubmissionDateTime` TEXT, `projectId` TEXT, `isFormDeployed` INTEGER, `frequencyArrayInString` TEXT, `jrFormId` TEXT, `siteName` TEXT, `formName` TEXT, `formDescFromXML` TEXT, `hash` TEXT, `lastFilledDateTime` TEXT, PRIMARY KEY(`scheduleId`, `formDeployedFrom`))", + "fields": [ + { + "fieldPath": "formDeployedFrom", + "columnName": "formDeployedFrom", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "scheduleId", + "columnName": "scheduleId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fsFormId", + "columnName": "fsFormId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "scheduleLevel", + "columnName": "scheduleLevel", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "startDate", + "columnName": "startDate", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "endDate", + "columnName": "endDate", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "scheduleName", + "columnName": "scheduleName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteId", + "columnName": "siteId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "idString", + "columnName": "idString", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastSubmissionBy", + "columnName": "lastSubmissionBy", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastSubmissionDateTime", + "columnName": "lastSubmissionDateTime", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectId", + "columnName": "projectId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isFormDeployed", + "columnName": "isFormDeployed", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "frequencyArrayInString", + "columnName": "frequencyArrayInString", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "jrFormId", + "columnName": "jrFormId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteName", + "columnName": "siteName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formName", + "columnName": "formName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formDescFromXML", + "columnName": "formDescFromXML", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastFilledDateTime", + "columnName": "lastFilledDateTime", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "scheduleId", + "formDeployedFrom" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `projectStageId` INTEGER, `name` TEXT, `description` TEXT, `order` INTEGER, `dateCreated` TEXT, `dateModified` TEXT, `site` INTEGER, `project` INTEGER, `formDeployedFrom` TEXT NOT NULL, PRIMARY KEY(`id`, `formDeployedFrom`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "projectStageId", + "columnName": "projectStageId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "order", + "columnName": "order", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dateModified", + "columnName": "dateModified", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "site", + "columnName": "site", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "project", + "columnName": "project", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "formDeployedFrom", + "columnName": "formDeployedFrom", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id", + "formDeployedFrom" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "substage", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `stageId` TEXT, `deployed_from` TEXT, `fsFormId` TEXT, `jrFormId` TEXT, `name` TEXT, `description` TEXT, `order` INTEGER, `tagIds` TEXT, `responseCount` TEXT, `projectStageId` INTEGER, `lastSubmissionBy` TEXT, `lastSubmissionDateTime` TEXT, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "stageId", + "columnName": "stageId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "subStageDeployedFrom", + "columnName": "deployed_from", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "fsFormId", + "columnName": "fsFormId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "jrFormId", + "columnName": "jrFormId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "order", + "columnName": "order", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "tagIds", + "columnName": "tagIds", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "responseCount", + "columnName": "responseCount", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectStageId", + "columnName": "projectStageId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "lastSubmissionBy", + "columnName": "lastSubmissionBy", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastSubmissionDateTime", + "columnName": "lastSubmissionDateTime", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "survey_forms", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`fsFormId` TEXT NOT NULL, `projectId` TEXT, `idString` TEXT, `name` TEXT, PRIMARY KEY(`fsFormId`))", + "fields": [ + { + "fieldPath": "fsFormId", + "columnName": "fsFormId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "projectId", + "columnName": "projectId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "idString", + "columnName": "idString", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "fsFormId" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "site_types", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `identifer` TEXT, `projectId` TEXT, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "identifer", + "columnName": "identifer", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectId", + "columnName": "projectId", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "site_region", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `identifier` TEXT, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "identifier", + "columnName": "identifier", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "FieldSightNotification", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `notificationType` TEXT, `notifiedDate` TEXT, `notifiedTime` TEXT, `idString` TEXT, `fsFormId` TEXT, `fsFormIdProject` TEXT, `formName` TEXT, `siteId` TEXT, `siteName` TEXT, `projectId` TEXT, `projectName` TEXT, `formStatus` TEXT, `role` TEXT, `isFormDeployed` TEXT, `details_url` TEXT, `comment` TEXT, `formType` TEXT, `isRead` INTEGER NOT NULL, `formSubmissionId` TEXT, `formVersion` TEXT, `siteIdentifier` TEXT, `receivedDateTime` TEXT, `isDeployedFromSite` INTEGER NOT NULL, `receivedDateTimeInMillis` INTEGER NOT NULL, `schedule_forms_count` TEXT)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "notificationType", + "columnName": "notificationType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "notifiedDate", + "columnName": "notifiedDate", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "notifiedTime", + "columnName": "notifiedTime", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "idString", + "columnName": "idString", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "fsFormId", + "columnName": "fsFormId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "fsFormIdProject", + "columnName": "fsFormIdProject", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formName", + "columnName": "formName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteId", + "columnName": "siteId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteName", + "columnName": "siteName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectId", + "columnName": "projectId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectName", + "columnName": "projectName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formStatus", + "columnName": "formStatus", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isFormDeployed", + "columnName": "isFormDeployed", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "details_url", + "columnName": "details_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "comment", + "columnName": "comment", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formType", + "columnName": "formType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isRead", + "columnName": "isRead", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "formSubmissionId", + "columnName": "formSubmissionId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formVersion", + "columnName": "formVersion", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteIdentifier", + "columnName": "siteIdentifier", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receivedDateTime", + "columnName": "receivedDateTime", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isDeployedFromSite", + "columnName": "isDeployedFromSite", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "receivedDateTimeInMillis", + "columnName": "receivedDateTimeInMillis", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "scheduleFormsCount", + "columnName": "schedule_forms_count", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_FieldSightNotification_receivedDateTimeInMillis", + "unique": true, + "columnNames": [ + "receivedDateTimeInMillis" + ], + "createSql": "CREATE UNIQUE INDEX `index_FieldSightNotification_receivedDateTimeInMillis` ON `${TABLE_NAME}` (`receivedDateTimeInMillis`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "educational_materials", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `emImages` TEXT, `pdf` TEXT, `title` TEXT, `text` TEXT, `fsFormId` TEXT NOT NULL, PRIMARY KEY(`fsFormId`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "emImages", + "columnName": "emImages", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "pdf", + "columnName": "pdf", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "text", + "columnName": "text", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "fsFormId", + "columnName": "fsFormId", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "fsFormId" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "contacts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `username` TEXT, `email` TEXT, `address` TEXT, `gender` TEXT, `phone` TEXT, `skype` TEXT, `twitter` TEXT, `tango` TEXT, `hike` TEXT, `qq` TEXT, `google_talk` TEXT, `profilePicture` TEXT, `viber` TEXT, `whatsapp` TEXT, `wechat` TEXT, `full_name` TEXT, `primary_number` TEXT, `secondary_number` TEXT, `office_number` TEXT, `roleString` TEXT)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "username", + "columnName": "username", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "email", + "columnName": "email", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "gender", + "columnName": "gender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "skype", + "columnName": "skype", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "twitter", + "columnName": "twitter", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tango", + "columnName": "tango", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hike", + "columnName": "hike", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "qq", + "columnName": "qq", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "google_talk", + "columnName": "google_talk", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "profilePicture", + "columnName": "profilePicture", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "viber", + "columnName": "viber", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "whatsapp", + "columnName": "whatsapp", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "wechat", + "columnName": "wechat", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "full_name", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "primary_number", + "columnName": "primary_number", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "secondary_number", + "columnName": "secondary_number", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "office_number", + "columnName": "office_number", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "roleString", + "columnName": "roleString", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "submission_detail", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `site` TEXT, `project` TEXT, `siteFsFormId` TEXT, `projectFsFormId` TEXT, `submissionDateTime` TEXT, `submittedBy` TEXT, `statusDisplay` TEXT)", + "fields": [ + { + "fieldPath": "uid", + "columnName": "uid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "site", + "columnName": "site", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "project", + "columnName": "project", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteFsFormId", + "columnName": "siteFsFormId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectFsFormId", + "columnName": "projectFsFormId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "submissionDateTime", + "columnName": "submissionDateTime", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "submittedBy", + "columnName": "submittedBy", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "statusDisplay", + "columnName": "statusDisplay", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "uid" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "syncstat", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`project_id` TEXT NOT NULL, `type` TEXT NOT NULL, `failed_url` TEXT, `started` INTEGER NOT NULL, `status` INTEGER NOT NULL, `created_date` INTEGER NOT NULL, `total` INTEGER NOT NULL, `progress` INTEGER NOT NULL, PRIMARY KEY(`project_id`, `type`))", + "fields": [ + { + "fieldPath": "projectId", + "columnName": "project_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "failedUrl", + "columnName": "failed_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "started", + "columnName": "started", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "created_date", + "columnName": "created_date", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "total", + "columnName": "total", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "progress", + "columnName": "progress", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "project_id", + "type" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "fieldsight_forms", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`fieldSightFormId` TEXT NOT NULL, `formDeployedSiteId` TEXT, `formDeployedProjectId` TEXT, `projectId` INTEGER, `odkFormName` TEXT, `formDescriptionText` TEXT, `odkFormVersion` TEXT, `metadata` TEXT, `formOrder` INTEGER, `formType` TEXT, `totalFormsInProject` INTEGER NOT NULL, `errorStr` TEXT, `formName` TEXT, `downloadUrl` TEXT, `manifestUrl` TEXT, `formID` TEXT, `formVersion` TEXT, `hash` TEXT, `manifestFileHash` TEXT, `isNewerFormVersionAvailable` INTEGER NOT NULL, `areNewerMediaFilesAvailable` INTEGER NOT NULL, PRIMARY KEY(`fieldSightFormId`))", + "fields": [ + { + "fieldPath": "fieldSightFormId", + "columnName": "fieldSightFormId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "formDeployedSiteId", + "columnName": "formDeployedSiteId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formDeployedProjectId", + "columnName": "formDeployedProjectId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "projectId", + "columnName": "projectId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "odkFormName", + "columnName": "odkFormName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formDescriptionText", + "columnName": "formDescriptionText", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "odkFormVersion", + "columnName": "odkFormVersion", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "metadata", + "columnName": "metadata", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formOrder", + "columnName": "formOrder", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "formType", + "columnName": "formType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "totalFormsInProject", + "columnName": "totalFormsInProject", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "errorStr", + "columnName": "errorStr", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formName", + "columnName": "formName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "downloadUrl", + "columnName": "downloadUrl", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "manifestUrl", + "columnName": "manifestUrl", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formID", + "columnName": "formID", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formVersion", + "columnName": "formVersion", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "manifestFileHash", + "columnName": "manifestFileHash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isNewerFormVersionAvailable", + "columnName": "isNewerFormVersionAvailable", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "areNewerMediaFilesAvailable", + "columnName": "areNewerMediaFilesAvailable", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "fieldSightFormId" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "fieldsight_formv3", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `site` TEXT, `project` TEXT, `site_project_id` TEXT, `type` TEXT, `em` TEXT, `description` TEXT, `settings` TEXT, `formDetails` TEXT, `metaAttributes` TEXT, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "site", + "columnName": "site", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "project", + "columnName": "project", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "site_project_id", + "columnName": "site_project_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "em", + "columnName": "em", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "settings", + "columnName": "settings", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "formDetails", + "columnName": "formDetails", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "metaAttributes", + "columnName": "metaAttributes", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"ea38e35d3380ff65488c6b335c0c9bb4\")" + ] + } +} \ No newline at end of file diff --git a/collect_app/src/main/AndroidManifest.xml b/collect_app/src/main/AndroidManifest.xml index 1635bdbbe..2aa5bfaaa 100644 --- a/collect_app/src/main/AndroidManifest.xml +++ b/collect_app/src/main/AndroidManifest.xml @@ -105,6 +105,7 @@ the specific language governing permissions and limitations under the License. + diff --git a/collect_app/src/main/java/org/fieldsight/naxa/common/BaseFormListFragment.java b/collect_app/src/main/java/org/fieldsight/naxa/common/BaseFormListFragment.java index d9c5a887f..83518f99e 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/common/BaseFormListFragment.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/common/BaseFormListFragment.java @@ -118,8 +118,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c View view = inflater.inflate(R.layout.fieldsight_list_fragment, container, false); recyclerView = view.findViewById(R.id.recycler_view_list); emptyLayout = view.findViewById(R.id.root_layout_empty_layout); - View swipeToRefresh = view.findViewById(R.id.swipe_container); - swipeToRefresh.setEnabled(false); return view; } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/common/FieldSightDatabase.java b/collect_app/src/main/java/org/fieldsight/naxa/common/FieldSightDatabase.java index 583b2f8ae..067718282 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/common/FieldSightDatabase.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/common/FieldSightDatabase.java @@ -72,7 +72,7 @@ FieldsightFormDetailsv3.class }, - version = 21) + version = 25) @TypeConverters({SiteMetaAttributesTypeConverter.class, RegionConverter.class}) @@ -125,7 +125,8 @@ public static FieldSightDatabase getDatabase(final Context context) { .allowMainThreadQueries()//used in org.bcss.naxa.jobs.LocalNotificationJob .addMigrations(MIGRATION_4_5, MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8, MIGRATION_8_9, MIGRATION_9_10, MIGRATION_10_11, MIGRATION_11_12, MIGRATION_12_13, MIGRATION_13_14, - MIGRATION_14_15, MIGRATION_15_16, MIGRATION_16_17, MIGRATION_17_18, MIGRATION_18_19, MIGRATION_19_20, MIGRATION_20_21) + MIGRATION_14_15, MIGRATION_15_16, MIGRATION_16_17, MIGRATION_17_18, MIGRATION_18_19, MIGRATION_19_20, MIGRATION_20_21, + MIGRATION_21_22, MIGRATION_22_23, MIGRATION_23_24, MIGRATION_24_25) .build(); } @@ -276,5 +277,32 @@ public void migrate(@NonNull SupportSQLiteDatabase database) { } }; + private static final Migration MIGRATION_21_22 = new Migration(21, 22) { + @Override + public void migrate(@NonNull SupportSQLiteDatabase database) { + database.execSQL("ALTER TABLE sites" + " ADD COLUMN `users` INTEGER NOT NULL DEFAULT 0"); + } + }; + + private static final Migration MIGRATION_22_23 = new Migration(22, 23) { + @Override + public void migrate(@NonNull SupportSQLiteDatabase database) { + database.execSQL("ALTER TABLE sites" + " ADD COLUMN `current_progress` INTEGER NOT NULL DEFAULT 0"); + } + }; + + private static final Migration MIGRATION_23_24 = new Migration(23, 24) { + @Override + public void migrate(@NonNull SupportSQLiteDatabase database) { + database.execSQL("ALTER TABLE sites" + " ADD COLUMN `submissions` INTEGER NOT NULL DEFAULT 0"); + } + }; + + private static final Migration MIGRATION_24_25 = new Migration(24, 25) { + @Override + public void migrate(@NonNull SupportSQLiteDatabase database) { + database.execSQL("ALTER TABLE sites" + " ADD COLUMN `site_logo` TEXT "); + } + }; } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/common/rx/RxErrorHandlingCallAdapterFactory.java b/collect_app/src/main/java/org/fieldsight/naxa/common/rx/RxErrorHandlingCallAdapterFactory.java index fc93b98ef..fbf9d58dc 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/common/rx/RxErrorHandlingCallAdapterFactory.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/common/rx/RxErrorHandlingCallAdapterFactory.java @@ -96,9 +96,8 @@ private RetrofitException asRetrofitException(Throwable throwable, HttpUrl url) return RetrofitException.httpError(response.raw().request().url().toString(), response, retrofit); } - if (throwable instanceof UnknownHostException) { - return RetrofitException.networkError("Server Not Found", (IOException) throwable, url); + return RetrofitException.networkError("No Internet connection or server not found.", (IOException) throwable, url); } // A network error happened diff --git a/collect_app/src/main/java/org/fieldsight/naxa/forms/ui/FieldSightFormVH.java b/collect_app/src/main/java/org/fieldsight/naxa/forms/ui/FieldSightFormVH.java index 727f37a61..9872dc502 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/forms/ui/FieldSightFormVH.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/forms/ui/FieldSightFormVH.java @@ -2,6 +2,7 @@ import android.view.View; import android.widget.Button; +import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; @@ -12,29 +13,32 @@ import org.odk.collect.android.logic.FormDetails; public class FieldSightFormVH extends RecyclerView.ViewHolder { - private final TextView tvTitle, tvSubtitle, tvIconText; - private final Button btnViewSubmission, btnViewEduMaterial; +// private final TextView tvTitle, tvSubtitle, tvIconText; + +// private final Button btnViewSubmission, btnViewEduMaterial; + TextView tvFormName, tvLastSubmittedDate; + ImageView ivEducationMaterials; protected FieldSightFormVH(@NonNull View itemView) { super(itemView); - tvTitle = itemView.findViewById(R.id.tv_form_primary); - tvSubtitle = itemView.findViewById(R.id.tv_form_secondary); - tvIconText = itemView.findViewById(R.id.form_icon_text); - btnViewEduMaterial = itemView.findViewById(R.id.btn_form_edu); - btnViewSubmission = itemView.findViewById(R.id.btn_form_responses); - +// tvTitle = itemView.findViewById(R.id.tv_form_primary); +// tvSubtitle = itemView.findViewById(R.id.tv_form_secondary); +// tvIconText = itemView.findViewById(R.id.form_icon_text); +// btnViewEduMaterial = itemView.findViewById(R.id.btn_form_edu); +// btnViewSubmission = itemView.findViewById(R.id.btn_form_responses); + tvFormName = itemView.findViewById(R.id.tv_form_name); + tvLastSubmittedDate = itemView.findViewById(R.id.tv_last_submitted); + ivEducationMaterials = itemView.findViewById(R.id.iv_education_materials); } public void bindView(FieldsightFormDetailsv3 form) { FormDetails formDetails = form.getFormDetails(); try{ - tvTitle.setText(formDetails.getFormName()); - tvSubtitle.setText(formDetails.getFormName()); - tvIconText.setText(formDetails.getFormName().substring(0, 1)); + tvFormName.setText(formDetails.getFormName()); + tvLastSubmittedDate.setText(formDetails.getFormName()); itemView.setOnClickListener(view -> openForm(form)); - btnViewEduMaterial.setOnClickListener(view -> openEducationalMaterial(form)); - btnViewSubmission.setOnClickListener(view -> openPreviousSubmission(form)); + ivEducationMaterials.setOnClickListener(view -> openEducationalMaterial(form)); }catch (Exception e){ } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/BaseLoginActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/login/BaseLoginActivity.java index 08180ed96..3b4b04322 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/BaseLoginActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/BaseLoginActivity.java @@ -6,6 +6,7 @@ import android.util.Log; import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; import com.google.android.gms.auth.api.signin.GoogleSignIn; import com.google.android.gms.auth.api.signin.GoogleSignInAccount; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginActivity.java index 92a8bed95..8d3509f30 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginActivity.java @@ -1,8 +1,7 @@ package org.fieldsight.naxa.login; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; import android.app.Activity; +import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; @@ -11,12 +10,13 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.inputmethod.InputMethodManager; -import android.widget.AutoCompleteTextView; -import android.widget.Button; +import android.widget.CheckBox; import android.widget.EditText; -import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.Toast; +import androidx.cardview.widget.CardView; + import com.google.android.gms.common.SignInButton; import org.bcss.collect.android.BuildConfig; @@ -41,14 +41,10 @@ public class LoginActivity extends BaseLoginActivity implements LoginView { // UI references. - private AutoCompleteTextView mEmailView; - private EditText mPasswordView; - private View mProgressView; - private View mLoginFormView; - + private EditText edt_email; + private EditText edt_password; + CardView email_sign_in_button; private LoginPresenter loginPresenter; - private Button mEmailSignInButton; - private SignInButton btnGmailLogin; private boolean isFromGooleSignin; @@ -57,13 +53,11 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); // Set up the login form. - mEmailView = findViewById(R.id.email); - - mPasswordView = findViewById(R.id.password); + edt_email = findViewById(R.id.email); + edt_password = findViewById(R.id.password); + email_sign_in_button = findViewById(R.id.email_sign_in_button); - ImageButton btnChangeUrl = findViewById(R.id.btn_change_server_url); - mEmailSignInButton = findViewById(R.id.email_sign_in_button); - mEmailSignInButton.setOnClickListener(new OnClickListener() { + email_sign_in_button.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { if (allowClick(getClass().getName())) { @@ -78,15 +72,16 @@ public void onClick(View view) { @Override public void onClick(View v) { isFromGooleSignin = true; - showProgress(true); + showProgress("Logging with google, Please wait"); gmailSignIn(); btnGmailLogin.setEnabled(false); } }); + ImageView iv_setting = findViewById(R.id.iv_setting); if (!BuildConfig.BUILD_TYPE.equals("release")) { - btnChangeUrl.setVisibility(View.VISIBLE); - btnChangeUrl.setOnClickListener(new OnClickListener() { + iv_setting.setVisibility(View.VISIBLE); + iv_setting.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (allowClick(getClass().getName())) { @@ -96,9 +91,12 @@ public void onClick(View v) { } }); } - mLoginFormView = findViewById(R.id.logo); - mProgressView = findViewById(R.id.login_progress); +// mLoginFormView = findViewById(R.id.logo); +// mProgressView = findViewById(R.id.login_progress); + findViewById(R.id.iv_back).setOnClickListener(v -> { + finish(); + }); findViewById(R.id.tv_forgot_pwd).setOnClickListener(new OnClickListener() { @Override @@ -114,8 +112,6 @@ public void onClick(View v) { }); loginPresenter = new LoginPresenterImpl(this); - - } @Override @@ -137,69 +133,41 @@ public void gmailLoginFailed(String errorMsg) { */ private void attemptLogin() { // Reset errors. - mEmailView.setError(null); - mPasswordView.setError(null); - + edt_email.setError(null); + edt_password.setError(null); // Store values at the time of the login attempt. - String email = mEmailView.getText().toString(); - String password = mPasswordView.getText().toString(); - - + String email = edt_email.getText().toString(); + String password = edt_password.getText().toString(); loginPresenter.validateCredentials(email, password); } @Override - public void showProgress(final boolean show) { - - runOnUiThread(() -> { - int shortAnimTime = getResources().getInteger(android.R.integer.config_longAnimTime); - - mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); - mLoginFormView.animate().setDuration(shortAnimTime).alpha( - show ? 0 : 1).setListener(new AnimatorListenerAdapter() { - - @Override - public void onAnimationEnd(Animator animation) { - mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); - } - }); - - mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); - mProgressView.animate().setDuration(shortAnimTime).alpha( - show ? 1 : 0).setListener(new AnimatorListenerAdapter() { - - @Override - public void onAnimationEnd(Animator animation) { - mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); - } - }); - - mEmailSignInButton.setEnabled(!show); - }); - + public void showProgress(boolean showProgress) { + if (showProgress) + showProgress("Signing in please wait"); + else hideProgress(); } + @Override public void showPasswordError(int resourceId) { - mPasswordView.setError(getString(resourceId)); - mPasswordView.requestFocus(); + edt_password.setError(getString(resourceId)); + edt_password.requestFocus(); } @Override public void showUsernameError(int resourceId) { - mEmailView.setError(getString(resourceId)); - mEmailView.requestFocus(); + edt_email.setError(getString(resourceId)); + edt_password.requestFocus(); } @Override public void successAction() { - - boolean hasOldAccount = new MigrationHelper(mEmailView.getText().toString()).hasOldAccount(); - + boolean hasOldAccount = new MigrationHelper(edt_email.getText().toString()).hasOldAccount(); if (hasOldAccount) { - MigrateFieldSightActivity.start(this, mEmailView.getText().toString()); + MigrateFieldSightActivity.start(this, edt_email.getText().toString()); } else { startActivity(new Intent(this, ProjectListActivityV3.class)); } @@ -209,12 +177,11 @@ public void successAction() { @Override public void showError(String msg) { - showProgress(false); showErrorDialog(msg); } private void showErrorDialog(String msg) { - if(isFinishing()){ + if (isFinishing()) { return; } Dialog dialog = DialogFactory.createActionDialog(this, "Login Failed", msg) @@ -227,7 +194,7 @@ public void onClick(DialogInterface dialog, int which) { }) .setNegativeButton(R.string.dialog_action_dismiss, null) .create(); - dialog.show(); + dialog.show(); } /** @@ -256,5 +223,11 @@ private void retryLogin() { attemptLogin(); } } + + @Override + protected void onStop() { + super.onStop(); + hideProgress(); + } } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginModelImpl.java b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginModelImpl.java index 5c4bfce8b..e821086de 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginModelImpl.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginModelImpl.java @@ -28,7 +28,6 @@ public class LoginModelImpl implements LoginModel { @Override public void login(String username, String password, String token, OnLoginFinishedListener listener) { - authenticateUser(username, password, token, listener); } @@ -39,9 +38,7 @@ public void loginViaGoogle(String googleAccessToken, String username, String tok .flatMap(new Function>() { @Override public ObservableSource apply(AuthResponse authResponse) { - ServiceGenerator.clearInstance(); - return ServiceGenerator .createService(ApiInterface.class) .postFCMUserParameter(APIEndpoint.ADD_FCM, FieldSightUserSession.getFCMParameter(username, token, true)) diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginPresenterImpl.java b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginPresenterImpl.java index 3a0a81487..e6bbee5b7 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginPresenterImpl.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginPresenterImpl.java @@ -1,19 +1,14 @@ package org.fieldsight.naxa.login; import androidx.annotation.NonNull; -import android.text.TextUtils; -import com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork; +import android.text.TextUtils; import com.google.android.gms.tasks.OnFailureListener; import com.google.firebase.iid.FirebaseInstanceId; import org.bcss.collect.android.R;; import org.odk.collect.android.application.Collect; import org.fieldsight.naxa.common.SharedPreferenceUtils; - -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.observers.DisposableSingleObserver; -import io.reactivex.schedulers.Schedulers; import timber.log.Timber; public class LoginPresenterImpl implements LoginPresenter, LoginModel.OnLoginFinishedListener { @@ -28,57 +23,37 @@ public LoginPresenterImpl(LoginView loginView) { @Override public void validateCredentials(String username, String password) { - // Check for a valid email address. + boolean isValid = true; if (TextUtils.isEmpty(username)) { loginView.showUsernameError(R.string.error_invalid_email); - return; + isValid = false; } - // Check for a valid password, if the user entered one. if (TextUtils.isEmpty(password)) { loginView.showPasswordError(R.string.error_incorrect_password); - return; + isValid = false; } - + if (!isValid) return; loginView.showProgress(true); - ReactiveNetwork.checkInternetConnectivity() - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new DisposableSingleObserver() { - @Override - public void onSuccess(Boolean isConnected) { - if (isConnected) { - String fcmToken = SharedPreferenceUtils.getFromPrefs(Collect.getInstance().getApplicationContext(), SharedPreferenceUtils.PREF_VALUE_KEY.KEY_FCM, ""); - if (!TextUtils.isEmpty(fcmToken)) { - Timber.i("TOKEN generated: %s", fcmToken); - loginModel.login(username, password, fcmToken, LoginPresenterImpl.this); - } else { - - FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(instanceIdResult -> { - String fcmToken1 = instanceIdResult.getToken(); - Timber.i("RegeneratedToken: " + fcmToken1); - - SharedPreferenceUtils.saveToPrefs(Collect.getInstance().getApplicationContext(), SharedPreferenceUtils.PREF_VALUE_KEY.KEY_FCM, fcmToken1); - loginModel.login(username, password, fcmToken1, LoginPresenterImpl.this); - }).addOnFailureListener(new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - Timber.i("Error exception, %s ", e.getMessage()); - loginView.showError("Failed to get TOKEN"); - } - }); - } - } else { - loginView.showError("No Network Connectivity"); - } - } - - @Override - public void onError(Throwable e) { - loginView.showError("No Network Connectivity"); - } - }); + String fcmToken = SharedPreferenceUtils.getFromPrefs(Collect.getInstance().getApplicationContext(), SharedPreferenceUtils.PREF_VALUE_KEY.KEY_FCM, ""); + if (!TextUtils.isEmpty(fcmToken)) { + Timber.i("TOKEN generated: %s", fcmToken); + loginModel.login(username, password, fcmToken, LoginPresenterImpl.this); + } else { + FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(instanceIdResult -> { + String fcmToken1 = instanceIdResult.getToken(); + Timber.i("RegeneratedToken: " + fcmToken1); + SharedPreferenceUtils.saveToPrefs(Collect.getInstance().getApplicationContext(), SharedPreferenceUtils.PREF_VALUE_KEY.KEY_FCM, fcmToken1); + loginModel.login(username, password, fcmToken1, LoginPresenterImpl.this); + }).addOnFailureListener(new OnFailureListener() { + @Override + public void onFailure(@NonNull Exception e) { + Timber.i("Error exception, %s ", e.getMessage()); + loginView.showError("Failed to get TOKEN"); + } + }); + } } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginView.java b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginView.java index ec7607a27..6be0d6f00 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/login/LoginView.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/login/LoginView.java @@ -1,8 +1,7 @@ package org.fieldsight.naxa.login; public interface LoginView { - - void showProgress(boolean show); + void showProgress(boolean showProgress); void showPasswordError(int resourceId); 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 d728e9f88..292f01de6 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 @@ -3,6 +3,7 @@ import android.os.Parcel; import android.os.Parcelable; +import android.text.TextUtils; import androidx.annotation.NonNull; import androidx.room.ColumnInfo; @@ -48,7 +49,7 @@ public class Site implements Parcelable { @ColumnInfo(name = "typeId") private String typeId; - @SerializedName("type_label") + @SerializedName("type__name") @ColumnInfo(name = "typeLabel") private String typeLabel; @@ -85,6 +86,14 @@ public class Site implements Parcelable { @ColumnInfo(name = "project") private String project; + @SerializedName("current_progress") + @ColumnInfo(name = "current_progress") + private int current_progress; + + @SerializedName("site_logo") + @ColumnInfo(name = "site_logo") + private String site_logo; + @ColumnInfo(name = "isSiteVerified") private int isSiteVerified = Constant.SiteStatus.IS_ONLINE; @@ -97,7 +106,6 @@ public class Site implements Parcelable { @Ignore private String siteUploadError; - private String metaAttributes; @TypeConverters(StringListTypeConvertor.class) @@ -107,6 +115,10 @@ public class Site implements Parcelable { @SerializedName("region") private String regionId; + @SerializedName("submissions") + @ColumnInfo(name = "submissions") + private int submissions; + public String getSite() { return site; @@ -116,6 +128,9 @@ public void setSite(String site) { this.site = site; } + @SerializedName("users") + @ColumnInfo(name = "users") + private int users; private String site; @@ -250,6 +265,13 @@ public void setScheduleFormDeployedForm(String scheduleFormDeployedForm) { this.scheduleFormDeployedForm = scheduleFormDeployedForm; } + public int getCurrent_progress() { + return current_progress; + } + + public void setCurrent_progress(int current_progress) { + this.current_progress = current_progress; + } public int getIsSiteVerified() { return isSiteVerified; @@ -301,13 +323,20 @@ public void setName(String name) { } public String getTypeId() { - return typeId == null ? "" : typeId; + return TextUtils.isEmpty(typeId) ? "" : typeId; } public void setTypeId(String typeId) { this.typeId = typeId; } + public int getSubmissions() { + return submissions; + } + + public void setSubmissions(int submissions) { + this.submissions = submissions; + } public String getRegion() { return regionId == null ? "" : regionId; @@ -419,6 +448,21 @@ public void setSiteUploadError(String siteUploadError) { this.siteUploadError = siteUploadError; } + public int getUsers() { + return users; + } + + public String getSite_logo() { + return site_logo; + } + + public void setSite_logo(String site_logo) { + this.site_logo = site_logo; + } + + public void setUsers(int users) { + this.users = users; + } public String getRegionId() { return regionId; 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 ae7b2f238..f5b6dab05 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 @@ -63,6 +63,12 @@ public static class V3 { public static final String GET_MY_FLAGGED_SUBMISSIONS_V2 = "/fv3/api/v2/my/submissions/"; } + + public static class V4 { + public static final String GET_SITES = "/fv3/api/sites/v4/"; + } + + public class PARAMS { public static final String PROJECT_ID = "project_id"; public static final String REGION_ID = "region_id"; diff --git a/collect_app/src/main/java/org/fieldsight/naxa/profile/UserActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/profile/UserActivity.java index 4bf57ffd3..b7b1c79ad 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/profile/UserActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/profile/UserActivity.java @@ -141,7 +141,6 @@ public void onChanged(@Nullable Boolean editMode) { fabPictureEdit.setVisibility(View.GONE); fabEditProfile.setImageResource(R.drawable.ic_edit); setInputLayoutEnabledStatus(false); - userProfileViewModel.setUser(mUser); userProfileViewModel.save(); } diff --git a/collect_app/src/main/java/org/fieldsight/naxa/site/FragmentHostActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/site/FragmentHostActivity.java index 8f319a755..bdc0aaa50 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/site/FragmentHostActivity.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/site/FragmentHostActivity.java @@ -104,6 +104,10 @@ protected void onCreate(Bundle savedInstanceState) { Timber.i("hasProject = %s", (project != null)); } + openFragment(); + } + + void openFragment() { Fragment fragment; openSubmissionScreen = TextUtils.equals(Constant.FormStatus.FLAGGED, extraMessage) || TextUtils.equals(Constant.FormStatus.REJECTED, extraMessage); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/site/SiteDashboardFragment.java b/collect_app/src/main/java/org/fieldsight/naxa/site/SiteDashboardFragment.java index 61d9e6a67..168c3d607 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/site/SiteDashboardFragment.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/site/SiteDashboardFragment.java @@ -5,28 +5,32 @@ import android.database.Cursor; import android.os.Bundle; import android.os.Handler; +import android.text.TextUtils; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.CompoundButton; -import android.widget.ImageButton; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.PopupMenu; import android.widget.TextView; import android.widget.ToggleButton; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.widget.PopupMenu; +import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import androidx.cardview.widget.CardView; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; import com.google.common.primitives.Longs; -import org.bcss.collect.android.BuildConfig; -import org.bcss.collect.android.R;; +import org.bcss.collect.android.R; import org.fieldsight.naxa.FSInstanceChooserList; import org.fieldsight.naxa.FSInstanceUploaderListActivity; import org.fieldsight.naxa.common.Constant; @@ -58,9 +62,9 @@ import java.util.Collections; import java.util.List; +import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; -import butterknife.OnLongClick; import butterknife.Unbinder; import io.reactivex.Observable; import io.reactivex.ObservableSource; @@ -81,23 +85,50 @@ import static org.fieldsight.naxa.common.Constant.ANIM.FRAGMENT_POP_EXIT_ANIMATION; import static org.fieldsight.naxa.common.Constant.EXTRA_OBJECT; import static org.fieldsight.naxa.common.Constant.EXTRA_PROJECT; -import static org.fieldsight.naxa.common.ViewUtils.showOrHide; import static org.odk.collect.android.utilities.PermissionUtils.checkIfLocationPermissionsGranted; -public class SiteDashboardFragment extends Fragment implements View.OnClickListener { +; + +public class SiteDashboardFragment extends Fragment /*implements View.OnClickListener */ { private Site loadedSite; public File f, f1; - private ImageButton btnShowInfo; - private PopupMenu popup; - private TextView tvSiteName, tvSiteAddress; private ToggleButton btnToggleFinalized; - private TextView tvSiteType; private Unbinder unbinder; private View rootView; private Project project; boolean isParent; + @BindView(R.id.tv_site_name) + TextView tv_site_name; + + @BindView(R.id.tv_sub_site_identifier) + TextView tv_sub_site_identifier; + + @BindView(R.id.iv_site_image) + ImageView iv_site_image; + + @BindView(R.id.tv_region_name) + TextView tv_region_name; + + @BindView(R.id.tv_site_type) + TextView tv_site_type; + + @BindView(R.id.tv_site_progress) + TextView tv_progress; + + @BindView(R.id.tv_site_no_of_users) + TextView tv_site_no_of_users; + + @BindView(R.id.tv_submissions) + TextView tv_submissions; + + @BindView(R.id.iv_more) + ImageView iv_more; + + @BindView(R.id.site_option_frag_btn_send_form) + Button btnUpload; + private Menu menu; public static SiteDashboardFragment newInstance(Site site, boolean isParent, Project project) { @@ -114,7 +145,6 @@ public static SiteDashboardFragment newInstance(Site site, boolean isParent, Pro public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); - } @Nullable @@ -122,13 +152,18 @@ public void onCreate(@Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_dashboard_site, container, false); - //Constants.MY_FRAG = 1; unbinder = ButterKnife.bind(this, rootView); + return rootView; + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); loadedSite = getArguments().getParcelable(EXTRA_OBJECT); isParent = getArguments().getBoolean("isParent"); project = getArguments().getParcelable(EXTRA_PROJECT); - bindUI(rootView); + /* *https://medium.com/@BladeCoder/architecture-components-pitfalls-part-1-9300dd969808 @@ -138,36 +173,64 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, if (site == null) { return; } - this.loadedSite = site; - hideSendButtonIfMockedSite(rootView); - setupPopup(); + + updateUi(loadedSite); setupToolbar(); + }); + + } - tvSiteAddress.setText(loadedSite.getAddress()); - tvSiteName.setText(loadedSite.getName()); - showOrHide(tvSiteType, loadedSite.getTypeLabel()); - tvSiteType.setOnLongClickListener(view -> { - ToastUtils.showLongToast(loadedSite.getTypeId()); - return true; - }); + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + switch (item.getItemId()) { + case R.id.menu_site_map: + checkPermissionAndOpenMap(); + break; + case R.id.menu_upload: + boolean isOfflineSite = loadedSite.getIsSiteVerified() == Constant.SiteStatus.IS_OFFLINE; + boolean isEditedSite = loadedSite.getIsSiteVerified() == Constant.SiteStatus.IS_EDITED; + + if (isOfflineSite) { + showSiteUploadConfirmationDialog(); + } else if (isEditedSite) { + showEditedSiteUploadDialog(); + } + break; + case R.id.menu_delete: + showDeleteWarningDialog(); + break; + + } + return super.onOptionsItemSelected(item); + } - tvSiteType.setOnClickListener(view -> DialogFactory.createMessageDialog(getActivity(), - "Information", String.format("Only %s type sub stages will be displayed for %s", loadedSite.getTypeLabel(), loadedSite.getName())).show()); + @Override + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { + inflater.inflate(R.menu.menu_site_dashboard, menu); + super.onCreateOptionsMenu(menu, inflater); + } - rootView.findViewById(R.id.site_option_btn_delete_site) - .setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - showDeleteWarningDialog(); - } - }); - setupFinalizedButton(); - }); + private String checkIfEmpty(String text) { + return TextUtils.isEmpty(text) ? "N/A" : text; + } - return rootView; + private void updateUi(Site site) { + tv_progress.setText(checkIfEmpty(site.getCurrent_progress() + "%")); + tv_site_name.setText(checkIfEmpty(site.getName())); + tv_sub_site_identifier.setText(site.getIdentifier()); + tv_region_name.setText(checkIfEmpty(site.getRegion())); + tv_site_no_of_users.setText(checkIfEmpty(site.getUsers() + "")); + tv_submissions.setText(checkIfEmpty(site.getSubmissions() + "")); + tv_site_type.setText(checkIfEmpty(site.getTypeLabel())); + + // load site image + Glide.with(this) + .load(site.getSite_logo()) + .apply(RequestOptions.placeholderOf(R.drawable.ic_launcher_fieldsight).error(R.drawable.ic_launcher_fieldsight)) + .into(iv_site_image); } @@ -205,51 +268,47 @@ private void deleteSite(Site loadedSite) { break; } }); - - } private void setupToolbar() { - Toolbar toolbar = getActivity().findViewById(R.id.toolbar); - toolbar.setTitle(R.string.toolbar_form_types); - toolbar.setSubtitle(loadedSite.getName()); + Toolbar toolbar = requireActivity().findViewById(R.id.toolbar); + toolbar.setTitle(""); } private void setupPopup() { + if (this.menu == null) { + return; + } - popup = new PopupMenu(requireActivity(), btnShowInfo); - popup.getMenuInflater().inflate(R.menu.popup_menu_site_option, popup.getMenu()); - popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { - public boolean onMenuItemClick(MenuItem item) { - switch (item.getItemId()) { - - case R.id.popup_open_edit: - SiteProfileActivity.start(requireActivity(), loadedSite.getId()); + boolean isOfflineSite = loadedSite.getIsSiteVerified() == Constant.SiteStatus.IS_OFFLINE; + boolean isEditedSite = loadedSite.getIsSiteVerified() == Constant.SiteStatus.IS_EDITED; - break; - case R.id.popup_open_in_map: - checkPermissionAndOpenMap(); - break; - case R.id.popup_view_blue_prints: - SiteDocumentsListActivity.start(requireActivity(), loadedSite); - break; + if (isOfflineSite) { + this.menu.findItem(R.id.menu_delete).setEnabled(true); + this.menu.findItem(R.id.menu_upload).setEnabled(true); + btnUpload.setEnabled(false); - } - return true; - } - }); + } else if (isEditedSite) { + btnUpload.setEnabled(true); + this.menu.findItem(R.id.menu_delete).setEnabled(false); + this.menu.findItem(R.id.menu_upload).setEnabled(true); + } else { + btnUpload.setEnabled(true); + this.menu.findItem(R.id.menu_delete).setEnabled(false); + this.menu.findItem(R.id.menu_upload).setEnabled(false); + } } + private void checkPermissionAndOpenMap() { if (!checkIfLocationPermissionsGranted(requireActivity())) { new PermissionUtils().requestLocationPermissions(requireActivity(), new PermissionListener() { @Override public void granted() { ProjectMapActivity.start(getActivity(), loadedSite); - } @Override @@ -263,71 +322,63 @@ public void denied() { } - private void setupFinalizedButton() { - boolean isFinalizedSite = loadedSite.getIsSiteVerified() == Constant.SiteStatus.IS_FINALIZED; - btnToggleFinalized.setChecked(isFinalizedSite); - - btnToggleFinalized.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { - if (isChecked) { - ToastUtils.showShortToast("Marked Finalized"); - SiteLocalSource.getInstance().setSiteAsFinalized(loadedSite.getId()); - } else { - ToastUtils.showShortToast("Marked (Not) Finalized"); - SiteLocalSource.getInstance().setSiteAsNotFinalized(loadedSite.getId()); - } - } - }); + @OnClick(R.id.tv_site_documents) + void openSiteDocuments() { + SiteDocumentsListActivity.start(requireActivity(), loadedSite); } + @OnClick(R.id.tv_view_more) + void viewMore() { + SiteProfileActivity.start(requireActivity(), loadedSite.getId()); + } - private void bindUI(View rootView) { - tvSiteName = rootView.findViewById(R.id.site_option_frag_site_name); - tvSiteAddress = rootView.findViewById(R.id.site_option_frag_site_address); - tvSiteType = rootView.findViewById(R.id.site_option_frag_site_type); - - btnToggleFinalized = rootView.findViewById(R.id.site_option_btn_finalize_site); - btnShowInfo = rootView.findViewById(R.id.site_option_frag_btn_info); - btnShowInfo.setOnClickListener(this); - CardView cvStageform = rootView.findViewById(R.id.cv_stageform); - - Timber.d("SitesdashboardFragment, isParentsite = %s", isParent); - cvStageform.setVisibility(isParent ? View.GONE : View.VISIBLE); + @OnClick(R.id.ll_stage_form) + void openStageFormList() { + toStageList(); + } - rootView.findViewById(R.id.site_option_frag_btn_delete_form).setOnClickListener(this); - rootView.findViewById(R.id.site_option_frag_btn_edit_saved_form).setOnClickListener(this); - rootView.findViewById(R.id.site_option_frag_btn_send_form).setOnClickListener(this); + @OnClick(R.id.ll_scheduled_form) + void openScheduleFormList() { + toScheduleList(); + } - rootView.findViewById(R.id.site_option_frag_general_form).setOnClickListener(this); - rootView.findViewById(R.id.site_option_frag_schedule_form).setOnClickListener(this); - rootView.findViewById(R.id.site_option_frag_staged_form).setOnClickListener(this); + @OnClick(R.id.ll_general_form) + void openGeneralFormPage() { + toForms(); } - private void hideSendButtonIfMockedSite(View rootView) { + @OnClick(R.id.site_option_frag_btn_delete_form) + void deleteForm() { + Intent intent = new Intent(requireActivity(), FileManagerTabs.class); + intent.putExtra(EXTRA_OBJECT, loadedSite); + startActivity(intent); + } - boolean isOfflineSite = loadedSite.getIsSiteVerified() == Constant.SiteStatus.IS_OFFLINE; - boolean isEditedSite = loadedSite.getIsSiteVerified() == Constant.SiteStatus.IS_EDITED; + @OnClick(R.id.site_option_frag_btn_edit_saved_form) + void editForm() { + Intent i = new Intent(requireActivity(), FSInstanceChooserList.class); + i.putExtra(EXTRA_OBJECT, loadedSite); + i.putExtra(ApplicationConstants.BundleKeys.FORM_MODE, + ApplicationConstants.FormModes.EDIT_SAVED); + startActivity(i); + } - if (isOfflineSite) { - rootView.findViewById(R.id.site_option_frag_btn_send_form).setEnabled(false); - rootView.findViewById(R.id.site_option_btn_finalize_site).setEnabled(true); - rootView.findViewById(R.id.site_option_btn_delete_site).setVisibility(View.VISIBLE); - rootView.findViewById(R.id.site_option_btn_upload_site).setVisibility(View.VISIBLE); - rootView.findViewById(R.id.site_option_btn_upload_edited_site).setVisibility(View.GONE); - } else if (isEditedSite) { - rootView.findViewById(R.id.site_option_btn_upload_edited_site).setVisibility(View.VISIBLE); - rootView.findViewById(R.id.site_option_btn_delete_site).setVisibility(View.GONE); - rootView.findViewById(R.id.site_option_btn_upload_site).setVisibility(View.GONE); + @OnClick(R.id.iv_back) + void finishActivity() { + Timber.i("SiteDashboardFragment, back option selected"); + if (getActivity() instanceof FragmentHostActivity) { + ((FragmentHostActivity) getActivity()).openFragment(); } else { - rootView.findViewById(R.id.site_option_frag_btn_send_form).setEnabled(true); - rootView.findViewById(R.id.site_option_btn_finalize_site).setEnabled(false); - rootView.findViewById(R.id.site_option_btn_delete_site).setVisibility(View.GONE); - rootView.findViewById(R.id.site_option_btn_upload_site).setVisibility(View.GONE); - rootView.findViewById(R.id.site_option_btn_upload_edited_site).setVisibility(View.GONE); + Timber.i("HostActivity not known"); } + } + @OnClick(R.id.site_option_frag_btn_send_form) + void sendForm() { + Intent intent = new Intent(requireActivity(), FSInstanceUploaderListActivity.class); + intent.putExtra(EXTRA_OBJECT, loadedSite); + startActivity(intent); } @@ -337,58 +388,8 @@ public void onDestroyView() { unbinder.unbind(); } - @Override - public void onClick(View view) { - Intent intent = null; - - switch (view.getId()) { - case R.id.site_option_frag_general_form: - toForms(); - break; - case R.id.site_option_frag_schedule_form: - toScheduleList(); - break; - case R.id.site_option_frag_staged_form: - toStageList(); - break; - case R.id.site_option_frag_btn_delete_form: - - intent = new Intent(requireActivity(), FileManagerTabs.class); - intent.putExtra(EXTRA_OBJECT, loadedSite); - startActivity(intent); - - break; - case R.id.site_option_frag_btn_edit_saved_form: - Intent i = new Intent(requireActivity(), FSInstanceChooserList.class); - i.putExtra(EXTRA_OBJECT, loadedSite); - i.putExtra(ApplicationConstants.BundleKeys.FORM_MODE, - ApplicationConstants.FormModes.EDIT_SAVED); - startActivity(i); - break; - case R.id.site_option_frag_btn_send_form: - intent = new Intent(requireActivity(), FSInstanceUploaderListActivity.class); - intent.putExtra(EXTRA_OBJECT, loadedSite); - startActivity(intent); - break; - case R.id.site_option_frag_btn_info: - popup.show(); - - break; - } - } - - @OnLongClick(R.id.site_option_frag_btn_info) - public boolean showSiteDebugInfo() { - if (BuildConfig.DEBUG) { - DialogFactory.createSimpleOkErrorDialog(getActivity(), "", loadedSite.toString()).show(); - return true; - } - return false; - } - - @OnClick(R.id.site_option_btn_upload_site) - public void showConfirmationDialog() { + void showSiteUploadConfirmationDialog() { DialogFactory.createActionDialog(requireActivity(), getString(R.string.dialog_title_upload_sites), getString(R.string.dialog_msg_upload_sites)) .setPositiveButton(R.string.dialog_action_upload_site_and_form, (dialog, which) -> { @@ -405,8 +406,7 @@ public void showConfirmationDialog() { } - @OnClick(R.id.site_option_btn_upload_edited_site) - public void showEditedSiteUploadDialog() { + void showEditedSiteUploadDialog() { DialogFactory.createActionDialog(requireActivity(), getString(R.string.dialog_title_upload_sites), getString(R.string.dialog_msg_upload_edited_sites)) .setPositiveButton(R.string.upload, (dialog, which) -> { @@ -523,6 +523,29 @@ public void onError(Throwable e) { }); } + @Override + public void onPrepareOptionsMenu(@NonNull Menu menu) { + super.onPrepareOptionsMenu(menu); + disableMenuItems(menu); + this.menu = menu; + setupPopup(); + } + + private void disableMenuItems(Menu menu) { + Integer[] itemsToRemove = new Integer[]{ + R.id.action_refresh, + R.id.action_logout, + R.id.action_setting, + R.id.action_notificaiton, + }; + + for (Integer itemId : itemsToRemove) { + MenuItem menuItem = menu.findItem(itemId); + if (menuItem != null) { + menuItem.setVisible(false); + } + } + } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { @@ -602,4 +625,5 @@ private void toScheduleList() { } + } \ No newline at end of file diff --git a/collect_app/src/main/java/org/fieldsight/naxa/site/SiteListFragment.java b/collect_app/src/main/java/org/fieldsight/naxa/site/SiteListFragment.java index 7e5a06411..cb5fa851c 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/site/SiteListFragment.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/site/SiteListFragment.java @@ -99,6 +99,9 @@ public void onCreate(@Nullable Bundle savedInstanceState) { setHasOptionsMenu(true); } + + + @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { @@ -175,7 +178,6 @@ private void setupRecycleView() { } - private void collectFilterAndApply(ArrayList sortList) { String selectedRegion = "0"; @@ -265,7 +267,6 @@ public void onItemClicked(FilterDialogAdapter.ViewHolderText holder, int positio public MutableLiveData> getFilterOptionForSites() { - List siteRegions; siteRegions = loadedProject.getRegionList(); MutableLiveData> sortingOptionsMutableLive = new MutableLiveData<>(); diff --git a/collect_app/src/main/java/org/fieldsight/naxa/v3/network/ApiV3Interface.java b/collect_app/src/main/java/org/fieldsight/naxa/v3/network/ApiV3Interface.java index 1b2cac9ed..6fa4dd5d6 100644 --- a/collect_app/src/main/java/org/fieldsight/naxa/v3/network/ApiV3Interface.java +++ b/collect_app/src/main/java/org/fieldsight/naxa/v3/network/ApiV3Interface.java @@ -15,7 +15,7 @@ public interface ApiV3Interface { @GET(APIEndpoint.V3.GET_PROJECTS) Single getProjects(); - @GET(APIEndpoint.V3.GET_SITES) + @GET(APIEndpoint.V4.GET_SITES) Single getSites(@QueryMap Map options); @GET diff --git a/collect_app/src/main/java/org/odk/collect/android/activities/CollectAbstractActivity.java b/collect_app/src/main/java/org/odk/collect/android/activities/CollectAbstractActivity.java index ef01bbfa2..866ec23d0 100644 --- a/collect_app/src/main/java/org/odk/collect/android/activities/CollectAbstractActivity.java +++ b/collect_app/src/main/java/org/odk/collect/android/activities/CollectAbstractActivity.java @@ -74,6 +74,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { } } + @Override protected void onPostResume() { super.onPostResume(); @@ -96,20 +97,22 @@ protected void attachBaseContext(Context base) { } public void showProgress() { + showProgress(""); + } + + public void showProgress(String message) { try { RelativeLayout relativeLayout = findViewById(R.id.fl_toolbar_progress_wrapper); if (relativeLayout != null) { ViewUtils.animateViewVisibility(relativeLayout, View.VISIBLE); -// relativeLayout.setVisibility(View.VISIBLE); } else { - progressDialog = DialogFactory.createProgressDialogHorizontal(this, getString(R.string.please_wait)); + progressDialog = DialogFactory.createProgressDialogHorizontal(this, message.isEmpty() ? getString(R.string.please_wait) : message); progressDialog.show(); } } catch (Exception e) { SnackBarUtils.showFlashbar(this, e.getMessage()); Timber.e(e); } - } public void hideProgress() { @@ -117,11 +120,12 @@ public void hideProgress() { RelativeLayout relativeLayout = findViewById(R.id.fl_toolbar_progress_wrapper); if (relativeLayout != null) { ViewUtils.animateViewVisibility(relativeLayout,View.GONE); -// relativeLayout.setVisibility(View.GONE); } else { - if (progressDialog != null && progressDialog.isShowing()) { + Timber.i("hide progress dialog"); + if (progressDialog != null) { ToastUtils.showLongToast("Dismiss"); progressDialog.dismiss(); + progressDialog = null; } } } catch (Exception e) { diff --git a/collect_app/src/main/res/drawable-anydpi-v24/ic_action_forward.xml b/collect_app/src/main/res/drawable-anydpi-v24/ic_action_forward.xml new file mode 100644 index 000000000..0e368aef1 --- /dev/null +++ b/collect_app/src/main/res/drawable-anydpi-v24/ic_action_forward.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/collect_app/src/main/res/drawable-anydpi/ic_action_arrow_back.xml b/collect_app/src/main/res/drawable-anydpi/ic_action_arrow_back.xml new file mode 100644 index 000000000..98478bec9 --- /dev/null +++ b/collect_app/src/main/res/drawable-anydpi/ic_action_arrow_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/collect_app/src/main/res/drawable-anydpi/ic_action_more_vert.xml b/collect_app/src/main/res/drawable-anydpi/ic_action_more_vert.xml new file mode 100644 index 000000000..221ad9a84 --- /dev/null +++ b/collect_app/src/main/res/drawable-anydpi/ic_action_more_vert.xml @@ -0,0 +1,11 @@ + + + diff --git a/collect_app/src/main/res/drawable-hdpi/ic_action_arrow_back.png b/collect_app/src/main/res/drawable-hdpi/ic_action_arrow_back.png new file mode 100644 index 000000000..ebdf58407 Binary files /dev/null and b/collect_app/src/main/res/drawable-hdpi/ic_action_arrow_back.png differ diff --git a/collect_app/src/main/res/drawable-hdpi/ic_action_forward.png b/collect_app/src/main/res/drawable-hdpi/ic_action_forward.png new file mode 100644 index 000000000..159c1eb6c Binary files /dev/null and b/collect_app/src/main/res/drawable-hdpi/ic_action_forward.png differ diff --git a/collect_app/src/main/res/drawable-hdpi/ic_action_more_vert.png b/collect_app/src/main/res/drawable-hdpi/ic_action_more_vert.png new file mode 100644 index 000000000..385beaaa8 Binary files /dev/null and b/collect_app/src/main/res/drawable-hdpi/ic_action_more_vert.png differ diff --git a/collect_app/src/main/res/drawable-mdpi/ic_action_arrow_back.png b/collect_app/src/main/res/drawable-mdpi/ic_action_arrow_back.png new file mode 100644 index 000000000..24a492818 Binary files /dev/null and b/collect_app/src/main/res/drawable-mdpi/ic_action_arrow_back.png differ diff --git a/collect_app/src/main/res/drawable-mdpi/ic_action_forward.png b/collect_app/src/main/res/drawable-mdpi/ic_action_forward.png new file mode 100644 index 000000000..14780c05e Binary files /dev/null and b/collect_app/src/main/res/drawable-mdpi/ic_action_forward.png differ diff --git a/collect_app/src/main/res/drawable-mdpi/ic_action_more_vert.png b/collect_app/src/main/res/drawable-mdpi/ic_action_more_vert.png new file mode 100644 index 000000000..329ff5bb4 Binary files /dev/null and b/collect_app/src/main/res/drawable-mdpi/ic_action_more_vert.png differ diff --git a/collect_app/src/main/res/drawable-xhdpi/ic_action_arrow_back.png b/collect_app/src/main/res/drawable-xhdpi/ic_action_arrow_back.png new file mode 100644 index 000000000..77c9552e0 Binary files /dev/null and b/collect_app/src/main/res/drawable-xhdpi/ic_action_arrow_back.png differ diff --git a/collect_app/src/main/res/drawable-xhdpi/ic_action_forward.png b/collect_app/src/main/res/drawable-xhdpi/ic_action_forward.png new file mode 100644 index 000000000..0e9d1d163 Binary files /dev/null and b/collect_app/src/main/res/drawable-xhdpi/ic_action_forward.png differ diff --git a/collect_app/src/main/res/drawable-xhdpi/ic_action_more_vert.png b/collect_app/src/main/res/drawable-xhdpi/ic_action_more_vert.png new file mode 100644 index 000000000..ccf7019c0 Binary files /dev/null and b/collect_app/src/main/res/drawable-xhdpi/ic_action_more_vert.png differ diff --git a/collect_app/src/main/res/drawable-xxhdpi/ic_action_arrow_back.png b/collect_app/src/main/res/drawable-xxhdpi/ic_action_arrow_back.png new file mode 100644 index 000000000..d7c6207da Binary files /dev/null and b/collect_app/src/main/res/drawable-xxhdpi/ic_action_arrow_back.png differ diff --git a/collect_app/src/main/res/drawable-xxhdpi/ic_action_forward.png b/collect_app/src/main/res/drawable-xxhdpi/ic_action_forward.png new file mode 100644 index 000000000..b493fb8eb Binary files /dev/null and b/collect_app/src/main/res/drawable-xxhdpi/ic_action_forward.png differ diff --git a/collect_app/src/main/res/drawable-xxhdpi/ic_action_more_vert.png b/collect_app/src/main/res/drawable-xxhdpi/ic_action_more_vert.png new file mode 100644 index 000000000..e5ea24a9e Binary files /dev/null and b/collect_app/src/main/res/drawable-xxhdpi/ic_action_more_vert.png differ diff --git a/collect_app/src/main/res/drawable/ic_checklist_major_monotone.xml b/collect_app/src/main/res/drawable/ic_checklist_major_monotone.xml new file mode 100644 index 000000000..894082f41 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_checklist_major_monotone.xml @@ -0,0 +1,9 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_chevron_left_minor.xml b/collect_app/src/main/res/drawable/ic_chevron_left_minor.xml new file mode 100644 index 000000000..d48105026 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_chevron_left_minor.xml @@ -0,0 +1,10 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_circle_tick_outline_minor.xml b/collect_app/src/main/res/drawable/ic_circle_tick_outline_minor.xml new file mode 100644 index 000000000..f0f38cab3 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_circle_tick_outline_minor.xml @@ -0,0 +1,9 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_clock_major_monotone.xml b/collect_app/src/main/res/drawable/ic_clock_major_monotone.xml new file mode 100644 index 000000000..2ce866e0e --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_clock_major_monotone.xml @@ -0,0 +1,9 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_customers_major_monotone.xml b/collect_app/src/main/res/drawable/ic_customers_major_monotone.xml new file mode 100644 index 000000000..44e06e108 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_customers_major_monotone.xml @@ -0,0 +1,9 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_grammar_major_monotone.xml b/collect_app/src/main/res/drawable/ic_grammar_major_monotone.xml new file mode 100644 index 000000000..572182fa3 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_grammar_major_monotone.xml @@ -0,0 +1,9 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_list_major_monotone.xml b/collect_app/src/main/res/drawable/ic_list_major_monotone.xml new file mode 100644 index 000000000..0b255c204 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_list_major_monotone.xml @@ -0,0 +1,10 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_logo_boarding.xml b/collect_app/src/main/res/drawable/ic_logo_boarding.xml new file mode 100644 index 000000000..655ea5644 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_logo_boarding.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + diff --git a/collect_app/src/main/res/drawable/ic_mobile_vertical_dots_major_monotone.xml b/collect_app/src/main/res/drawable/ic_mobile_vertical_dots_major_monotone.xml new file mode 100644 index 000000000..f8820a27f --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_mobile_vertical_dots_major_monotone.xml @@ -0,0 +1,9 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_note_major_monotone.xml b/collect_app/src/main/res/drawable/ic_note_major_monotone.xml new file mode 100644 index 000000000..954777b6b --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_note_major_monotone.xml @@ -0,0 +1,9 @@ + + + diff --git a/collect_app/src/main/res/drawable/ic_vocabulary_major_monotone.xml b/collect_app/src/main/res/drawable/ic_vocabulary_major_monotone.xml new file mode 100644 index 000000000..b3178a700 --- /dev/null +++ b/collect_app/src/main/res/drawable/ic_vocabulary_major_monotone.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/collect_app/src/main/res/drawable/rounded_rectangle_border_stroke.xml b/collect_app/src/main/res/drawable/rounded_rectangle_border_stroke.xml new file mode 100644 index 000000000..ed9f14c0f --- /dev/null +++ b/collect_app/src/main/res/drawable/rounded_rectangle_border_stroke.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/collect_app/src/main/res/drawable/rounded_rectangle_border_stroke_highlight.xml b/collect_app/src/main/res/drawable/rounded_rectangle_border_stroke_highlight.xml new file mode 100644 index 000000000..d4d495468 --- /dev/null +++ b/collect_app/src/main/res/drawable/rounded_rectangle_border_stroke_highlight.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/collect_app/src/main/res/layouts/fieldsight/layout/activity_site_dashboard.xml b/collect_app/src/main/res/layouts/fieldsight/layout/activity_site_dashboard.xml index dbb028358..ad9a76f12 100644 --- a/collect_app/src/main/res/layouts/fieldsight/layout/activity_site_dashboard.xml +++ b/collect_app/src/main/res/layouts/fieldsight/layout/activity_site_dashboard.xml @@ -7,7 +7,7 @@ android:background="@color/background_grey" android:orientation="vertical"> - + + android:orientation="vertical" + android:padding="16dp"> - - - + diff --git a/collect_app/src/main/res/layouts/fieldsight/layout/fragment_dashboard_site.xml b/collect_app/src/main/res/layouts/fieldsight/layout/fragment_dashboard_site.xml index e32541da4..e29d5ae13 100644 --- a/collect_app/src/main/res/layouts/fieldsight/layout/fragment_dashboard_site.xml +++ b/collect_app/src/main/res/layouts/fieldsight/layout/fragment_dashboard_site.xml @@ -1,414 +1,425 @@ - - - - - - - - + + - - - - - - - - -