Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Crash fix due to Instances table updated in Collect #301

Merged
merged 1 commit into from
Aug 18, 2019

Conversation

lakshyagupta21
Copy link
Contributor

Closes #294

What has been done to verify that this works as intended?

Tested in Android 9 and 7.1

Why is this the best possible solution? Were any other approaches considered?

There are some changes done in Collect's instances and the files are not updated for around 1 year so due to that it was crashing.

Before submitting this PR, please make sure you have:

  • run ./gradlew checkCode and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.

Copy link
Contributor

@huangyz0918 huangyz0918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but the duplicate forms issue still exist, maybe it's another issue. I did some tests and found how to reproduce that, you can refer to here and we can address that.

long id = cursor.getLong(cursor.getColumnIndex(InstanceProviderAPI.InstanceColumns._ID));
holder.checkBox.setChecked(selectedInstances.contains(id));
holder.reviewedForms.setVisibility(View.GONE);
holder.unReviewedForms.setVisibility(View.GONE);

}

public static String getDisplaySubtext(Context context, String state, Date date) {
try {
if (state == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can those if-else replaced by switch-case sentences?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want these to be changed because I've copied these things exactly from ODK-Collect code so that if it gets changed in future then we would be able to identify things easily.

}
} catch (IllegalArgumentException e) {
Timber.e(e);
return "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think returning empty string is similar to null value returned.
Because if you call textView.setText(null) and textView.setText(""), they both resets the previous string and sets nothing on the textView.

@lakshyagupta21
Copy link
Contributor Author

Looks good to me, but the duplicate forms issue still exist, maybe it's another issue. I did some tests and found how to reproduce that, you can refer to here and we can address that.

Yeah, thats a different issue.

@lakshyagupta21 lakshyagupta21 merged commit 439dc59 into getodk:master Aug 18, 2019
@lakshyagupta21 lakshyagupta21 deleted the SHARE-294 branch August 18, 2019 07:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App crashes when pressing send button
2 participants