immadisairaj / CodeforcesApp

An android application which uses Codeforces Api.
Apache License 2.0
15 stars 7 forks source link

fix: Handle missing fields #30

Closed Kshitij09 closed 4 years ago

Kshitij09 commented 4 years ago

Fixes #29

Changes:

Handled every field in the API call's response and handled missing field with defualt 'N/A' values. This guarantees that app will never crash again for this cause. If the user account exists on codeforces, it'll be shown in the app. I've made following changes:

  1. Handled fields for null values and replaced them with default (N/A) strings to avoid app crash.
  2. Updated strings.xml names as per the naming convention.
  3. Used parameterized strings for textview.setText() instead of appending them programmatically.

Please make sure these boxes are checked before submitting your pull request - thank you!

Please add screenshots/GIFs here if there are any changes to the UI below.

All Fields example Fields empty example Location Empty example

Kshitij09 commented 4 years ago

Is there anything wrong with the commits included in this PR ?

immadisairaj commented 4 years ago

@Kshitij09 this PR also has the commits from #27(closed) which fixes #22. So, if you want to fix #22 then send a separate PR. This PR only has to fix #29. Hope you'll fix it soon. 👍

immadisairaj commented 4 years ago

Please add screenshots/GIFs here if there are any changes to the UI below.

All Fields example Fields empty example Location Empty example

These screenshots have no image content. So, also make sure the images appear properly.

Kshitij09 commented 4 years ago

All Fields

accessibility text

No Rating

accessibility text

No Address, No Name

accessibility text
immadisairaj commented 4 years ago

@Kshitij09 can you squash the commits into one

Kshitij09 commented 4 years ago

Yes, I'll do that soon

Kshitij09 commented 4 years ago

@Kshitij09 can you squash the commits into one

I guess it has to be done by you while merging the pull request (reference) I can only squash all commits before creating a pull request.

immadisairaj commented 4 years ago

@Kshitij09 can you squash the commits into one

I guess it has to be done by you while merging the pull request (reference) I can only squash all commits before creating a pull request.

You can squash after creating a PR and then force push to the branch from which you are sending the PR.

And the file is not yet reverted. Can you check that once