Skip to content

AC-665 Updated UI for Login Page#743

Merged
f4ww4z merged 5 commits intoopenmrs:masterfrom
rishabh-997:AC-665-loginUI
Jun 6, 2020
Merged

AC-665 Updated UI for Login Page#743
f4ww4z merged 5 commits intoopenmrs:masterfrom
rishabh-997:AC-665-loginUI

Conversation

@rishabh-997
Copy link
Collaborator

Description of what I changed

  1. Created a better UI design
  2. Used constraint layout to flatten the hierarchy as much as possible
  3. Used View Binding instead of binding views explicitly so that changing view type won't affect code.
  4. Refactored code to reduce ~100 lines of code in LoginFragment

Issue I worked on

JIRA Issue: https://issues.openmrs.org/browse/AC-665

Checklist: I completed these to help reviewers :)

  • My pull request only contains ONE single commit
    (the number above, next to the 'Commits' tab is 1).
  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

@rishabh-997
Copy link
Collaborator Author

rishabh-997 commented May 18, 2020

PicsArt_05-19-11 42 34

WhatsApp Image 2020-05-18 at 4 20 27 PM

WhatsApp Image 2020-05-19 at 11 22 11 PM

@rishabh-997 rishabh-997 changed the title AC-995 Updated UI for Login Page AC-665 Updated UI for Login Page May 18, 2020
@codecov-io
Copy link

Codecov Report

Merging #743 into master will increase coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #743      +/-   ##
==========================================
+ Coverage   11.76%   11.79%   +0.03%     
==========================================
  Files         238      238              
  Lines       10646    10602      -44     
  Branches     1027     1025       -2     
==========================================
- Hits         1252     1251       -1     
+ Misses       9312     9269      -43     
  Partials       82       82              
Impacted Files Coverage Δ
...openmrs/mobile/activities/login/LoginFragment.java 5.49% <0.00%> (+1.22%) ⬆️
...penmrs/mobile/activities/login/LoginPresenter.java 65.49% <ø> (-0.25%) ⬇️
.../org/openmrs/mobile/activities/ACBaseActivity.java 0.00% <0.00%> (ø)
...openmrs/mobile/utilities/ApplicationConstants.java 5.26% <0.00%> (ø)
...s/mobile/activities/settings/SettingsActivity.java 0.00% <0.00%> (ø)
...s/mobile/activities/settings/SettingsFragment.java 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3778fdf...fd53abb. Read the comment docs.

Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

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

@rishabh-997 Can you also vertically center the 'Get started with our user guide' text?

loginView.setLocationErrorOccurred(false);
} else {
loginView.showInvalidURLSnackbar("Failed to fetch server's locations");
loginView.showInvalidURLSnackbar("The entered server is currently down, please select a different one.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put this string as a string resource instead

Copy link
Collaborator

Choose a reason for hiding this comment

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

Use snackbar_server_error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done,

  1. Had to pass context from activity to extract string resource from not Activity class.
  2. Had to update tests accordingly.
  3. Uploaded screenshots with the Get Started aligned both ways. It is currently aligned to left in the PR, so if you like the central way, I'll update the PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The test fails due to some reason which I can't figure out why, is it some error from my side ???

@f4ww4z f4ww4z requested a review from VibhorChinda May 19, 2020 15:26
@rishabh-997
Copy link
Collaborator Author

rishabh-997 commented May 19, 2020

I tried it and it wasn't looking appealing. I can add another screenshot here with that text vertically alligned in middle

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2020

Codecov Report

Merging #743 into master will increase coverage by 0.04%.
The diff coverage is 12.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #743      +/-   ##
==========================================
+ Coverage   11.80%   11.85%   +0.04%     
==========================================
  Files         238      238              
  Lines       10650    10598      -52     
  Branches     1028     1025       -3     
==========================================
- Hits         1257     1256       -1     
+ Misses       9311     9260      -51     
  Partials       82       82              
Impacted Files Coverage Δ
...openmrs/mobile/activities/login/LoginActivity.java 0.00% <0.00%> (ø)
...openmrs/mobile/activities/login/LoginFragment.java 5.26% <0.00%> (+1.11%) ⬆️
...penmrs/mobile/activities/login/LoginPresenter.java 65.49% <63.15%> (-0.25%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80c4367...9fc4f1c. Read the comment docs.

@VibhorChinda
Copy link
Collaborator

I tried it and it wasn't looking appealing. I can add another screenshot here with that text vertically alligned in middle

@rishabh-997 if you think that it does not look appealing. Try centre aligning the text and move it closer to the bottom rather than keeping it closer to the switch. Maybe it will look better :)

@rishabh-997
Copy link
Collaborator Author

I tried it and it wasn't looking appealing. I can add another screenshot here with that text vertically alligned in middle

@rishabh-997 if you think that it does not look appealing. Try centre aligning the text and move it closer to the bottom rather than keeping it closer to the switch. Maybe it will look better :)

I have added screenshot as you said, have a look at all three of them. Let me know your suggestions

@f4ww4z
Copy link
Collaborator

f4ww4z commented May 21, 2020

@rishabh-997 It looks more appealing with the get started at the center. The first screenshot looks good. Also make the 'Unable to Login' text look more like a link / button - I suggest to make it an orange color. Please change the code to reflect this.

@rishabh-997
Copy link
Collaborator Author

Screenshot_2020-05-21-22-33-14-91_0b570628ec88a4202b7916ec2df1bebf

Copy link
Collaborator

@dino-saurabh dino-saurabh left a comment

Choose a reason for hiding this comment

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

@rishabh-997 I would like to suggest a thing like to avoid confusion for users can we give them options for alternate refApp server along with the demo server so that users dont have go on looking for alternate servers URl.

@rishabh-997
Copy link
Collaborator Author

@rishabh-997 I would like to suggest a thing like to avoid confusion for users can we give them options for alternate refApp server along with the demo server so that users dont have go on looking for alternate servers URl.

We have now updated the snack bar so when the server is down, there is an apt message regarding server down error along with a link with all the alternate servers... Are you suggesting anything different ????

@dino-saurabh
Copy link
Collaborator

@rishabh-997 I thought the users getting redirected to some external link will be a bad UX maybe have some sort of drop down to select from a list of servers thats what I thought !!

@f4ww4z
Copy link
Collaborator

f4ww4z commented Jun 1, 2020

@rishabh-997 Can you fix the merge conflicts and refactor according to the new localization changes ? Then we can merge.

Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

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

@rishabh-997 Make sure to eliminate these conflicts and that you can build the app locally.

Comment on lines +82 to +85
<<<<<<< HEAD
=======

>>>>>>> removed context from presenter
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rishabh-997 these lines should be removed

Comment on lines +93 to +97
<<<<<<< HEAD
openMRSLogger, authorizationManager);
=======
openMRSLogger, authorizationManager);
>>>>>>> removed context from presenter
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take care of this merge conflict

Comment on lines +236 to +240
<<<<<<< HEAD
.thenReturn(mockErrorCall(401));
=======
.thenReturn(mockErrorCall(401));
>>>>>>> removed context from presenter
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rishabh-997 see above comment

Comment on lines +245 to +249
<<<<<<< HEAD
verify(view).showInvalidURLSnackbar(R.string.failed_fetching_servers_location);
=======
verify(view).showInvalidURLSnackbar(R.string.snackbar_server_error);
>>>>>>> removed context from presenter
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rishabh-997 See above comment

Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

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

Good work @rishabh-997

@f4ww4z f4ww4z merged commit 547cc1e into openmrs:master Jun 6, 2020
@rishabh-997 rishabh-997 deleted the AC-665-loginUI branch June 6, 2020 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants