Skip to content

Commit

Permalink
Code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Mar 14, 2018
1 parent c034b8c commit 3a4f8dd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Expand Up @@ -461,7 +461,7 @@ public void taskComplete(HashMap<String, Object> results) {
setProgressBarIndeterminateVisibility(false);

if (results == null) {
// if messagesByInstanceId was null, then got a google exception
// if results was null, then got a google exception
// requiring the user to authorize
return;
}
Expand Down
Expand Up @@ -282,7 +282,7 @@ public void uploadingComplete(HashMap<String, String> result) {
// probably got an auth request, so ignore
return;
}
Timber.i("uploadingComplete: Processing messagesByInstanceId ( %d ) from upload of %d instances!",
Timber.i("uploadingComplete: Processing results ( %d ) from upload of %d instances!",
result.size(), instancesToSend.length);

StringBuilder selection = new StringBuilder();
Expand Down
Expand Up @@ -167,7 +167,7 @@ protected void onDestroy() {

@Override
public void uploadingComplete(HashMap<String, String> result) {
Timber.i("uploadingComplete: Processing messagesByInstanceId (%d) from upload of %d instances!",
Timber.i("uploadingComplete: Processing results (%d) from upload of %d instances!",
result.size(), instancesToSend.length);

try {
Expand Down
Expand Up @@ -184,7 +184,7 @@ private Map<String, String> uploadInstances(String selection, String[] selection
.getColumnIndex(InstanceColumns.INSTANCE_FILE_PATH));

try {
uploadOneInstance(new File(instance), formFilePath, getGoogleSeetsUrl(cursor));
uploadOneInstance(new File(instance), formFilePath, getGoogleSheetsUrl(cursor));
cv.put(InstanceColumns.STATUS, InstanceProviderAPI.STATUS_SUBMITTED);
Collect.getInstance().getContentResolver().update(toUpdate, cv, null, null);
messagesByInstanceId.put(id, Collect.getInstance().getString(R.string.success));
Expand Down Expand Up @@ -421,7 +421,7 @@ private void disallowMissingColumns(List<Object> columnHeaders, List<Object> col
}
}

// This method builds a column name by joining all of the containing group names using "-" as a separator
/** This method builds a column name by joining all of the containing group names using "-" as a separator */
private String getElementTitle(AbstractTreeElement element) {
StringBuilder elementTitle = new StringBuilder();
while (element != null && element.getName() != null) {
Expand Down Expand Up @@ -567,7 +567,7 @@ private String getSheetUrl(Integer sheetId) {
: spreadsheet.getSpreadsheetUrl().substring(0, spreadsheet.getSpreadsheetUrl().lastIndexOf('/') + 1) + "edit#gid=" + sheetId;
}

private String getGoogleSeetsUrl(Cursor cursor) {
private String getGoogleSheetsUrl(Cursor cursor) {
int subIdx = cursor.getColumnIndex(InstanceColumns.SUBMISSION_URI);
String urlString = cursor.isNull(subIdx) ? null : cursor.getString(subIdx);
// if we didn't find one in the content provider, try to get from settings
Expand Down
Expand Up @@ -170,7 +170,7 @@ private boolean uploadOneSubmission(String urlString, String id, String instance
uri = URI.create(submissionUri.toString());
} catch (IllegalArgumentException e) {
Timber.i(e);
outcome.results.put(id, Collect.getInstance().getString(R.string.url_error));
outcome.messagesByInstanceId.put(id, Collect.getInstance().getString(R.string.url_error));
return false;
}

Expand Down

0 comments on commit 3a4f8dd

Please sign in to comment.