-
Notifications
You must be signed in to change notification settings - Fork 73
Crash fix due to Instances table updated in Collect #301
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return null
.
There was a problem hiding this comment.
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.
Yeah, thats a different issue. |
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:
./gradlew checkCode
and confirmed all checks still pass OR confirm CircleCI build passes