SDPCoachMe / SDP-2023

1 stars 0 forks source link

Refresh of profile activity #112

Closed brygotti closed 1 year ago

brygotti commented 1 year ago

This PR contains a nearly complete rewrite of ProfileActivity to make it more user-friendly. Information is presented in rows, and clicking on a row opens an auxiliary activity that allows to edit the given field. For the location field, the location autocomplete activity opens up, for the sports field, it is the SelectSportsActivity, and for text valued fields, it is a newly created EditTextActivity that shows a text field and allows to edit it. To see how EditTextActivity works, please take a look at the javadoc.

Moreover, when the activity is launched with isViewingCoach set to true, the rows are no longer editable, but instead clicking on a row opens an activity to handle the given field: clicking on the coach's email launches the email app and creates a new draft with the email address set as the recipient address, clicking on the coach's location opens the location in the Google Maps app, and clicking on the phone number opens the phone app and dials the number.

Lastly, all activities have been moved to packages to have a clearer structure of the app, as adviced by the SDP coaches in their last feedback.

All ProfileActivity tests were updated, some new tests were added for new behaviors like launching external apps, and tests for EditTextActivity were added too. Given the restructuring of packages, some tests no longer passed in the CI, which seems to be related to some nondeterministic behavior of the tests depending on the order of test runs. Those tests were fixed. Note that the fixes are not ideal but they would require a big refactor of the testing codebase to be made properly, which is not a priority as of now.

This fixes #95 but not #89 given that #89 requires refactoring SelectSportsActivity.

brygotti commented 1 year ago

Thanks. Two more tests have been added as suggested.