Skip to content

Enable screen for visited polling stations #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 28, 2020

Conversation

lukstbit
Copy link
Contributor

@lukstbit lukstbit commented Nov 21, 2020

What does it fix?

Closes #234
Closes #235

This implements the visited polling stations UI and all the requests from the issue. For this I created a new activity, I wanted to reuse The PollingStationsActivity but it seemed difficult to incorporate it in the current code so I chose the easier solution. At this moment I'm making it a draft to discuss :

  • if this is the correct UI implementation
  • add other things to the code(like analytics?)
  • check the strings I used and add the proper icon for this new menu entry(I used the change polling station icon menu as a placeholder)

How has it been tested?

Manually, as I created the UI.

@lukstbit lukstbit requested a review from aniri as a code owner November 21, 2020 13:06
@lukstbit lukstbit marked this pull request as draft November 21, 2020 13:14
@aniri
Copy link
Member

aniri commented Nov 23, 2020

Hey @lukstbit thanks! I'll test the implementation and get back on the UI part, just to answer your questions:

Menu with history

@lukstbit
Copy link
Contributor Author

@aniri I don't have a Figma account so I can't access the icon(unless I'm missing something). Anyway this is a minor issue.

I pushed another commit with the implementation for #235

@aniri
Copy link
Member

aniri commented Nov 23, 2020

@lukstbit awesome! I just made a small commit with the icon from figma. It's faster like this 😄

I'll test everything tomorrow and let you know ;)

@aniri
Copy link
Member

aniri commented Nov 25, 2020

hey @lukstbit I've started testing the UI changes for these, I've found the following:

  • the menu icon from the top should be visible in the visited stations screen
  • the > icon is missing from the polling station item
  • I think we can add a bit more vertical spacing between the polling station items
  • we need to put in a scroll view since there could be more visited polling stations than they fit in the screen

@lukstbit
Copy link
Contributor Author

I implemented the requested changes.

the > icon is missing from the polling station item

I've left this out on purpose. Are you sure this should be implemented? A list item with an arrow to its right is a iOS UX pattern and not something really found/used in Android. If you do want to implement this tell me and also mention if the arrow button should have a special action.

@aniri
Copy link
Member

aniri commented Nov 26, 2020

I implemented the requested changes.

@lukstbit Woooh! Looks awesome! 🚀 Just a nitpick though :/ could you put a menu icon in the visited section topbar instead of the back action? Just to keep it consistent with the other screens 😃

the > icon is missing from the polling station item

I've left this out on purpose. Are you sure this should be implemented? A list item with an arrow to its right is a iOS UX pattern and not something really found/used in Android. If you do want to implement this tell me and also mention if the arrow button should have a special action.

Good point! I'll get back to you on this, but I think we can ignore it :D

@aniri
Copy link
Member

aniri commented Nov 27, 2020

I implemented the requested changes.

the > icon is missing from the polling station item

I've left this out on purpose. Are you sure this should be implemented? A list item with an arrow to its right is a iOS UX pattern and not something really found/used in Android. If you do want to implement this tell me and also mention if the arrow button should have a special action.

@lukstbit ok, I got an ok from the UX team, there's no use for the arrow icon on android :D nice catch! thanks!

@aniri
Copy link
Member

aniri commented Nov 27, 2020

Also, one more nitpick :/ Would it be possible to hide the 'select from visited stations' text from the polling station details screen when first loading the app? Since it's a bit weird if there are no visited station added yet.

@lukstbit
Copy link
Contributor Author

could you put a menu icon in the visited section topbar instead of the back action? Just to keep it consistent with the other screens smiley

As I said in the first comment, I decided to use an Activity instead of a fragment because it was easier to implement. I can put an independent menu in the app bar but is not going to look/work good because it's another activity and the user will see clearly that he's using another "screen of the app". If it's a must I can refactor it into a fragment and plug it in the activity with the forms or with the polling stations selection but it is going to take time. Also, I want to point out that the menu doesn't appear in the polling station selection activity.

ok, I got an ok from the UX team, there's no use for the arrow icon on android :D nice catch! thanks!

Imagine the outrage if the users would have seen that arrow 😆 On a more serious note, yes I will implement disabling the station selection for the first time, there's no point for the user to see that when first starting.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@lukstbit
Copy link
Contributor Author

@aniri The user will now not see the option to select from visited stations when he hasn't selected at least on station.

Also, I noticed something which doesn't seems right:

Go to forms screen -> select one form -> select a question -> choose an answer -> hit BACK(the system button) -> app makes an empty POST request to /answers(which is successful)-> the app shows the question with green(as answered). Are these answers registered on the backend? I'm asking this because if you select and answer multiple questions then hitting BACK it will make a POST request to /answers with all the answers except the last selected one(from the screen where we hit BACK).

The behavior seems inconsistent and could be a bug which makes us miss answers.

@lukstbit lukstbit marked this pull request as ready for review November 28, 2020 09:42
@aniri
Copy link
Member

aniri commented Nov 28, 2020

As I said in the first comment, I decided to use an Activity instead of a fragment because it was easier to implement. I can put an independent menu in the app bar but is not going to look/work good because it's another activity and the user will see clearly that he's using another "screen of the app". If it's a must I can refactor it into a fragment and plug it in the activity with the forms or with the polling stations selection but it is going to take time. Also, I want to point out that the menu doesn't appear in the polling station selection activity.

Aaarghh, right. We already have the polling station selection activity with no menu. Yep, this will be tricky to refactor. But we'll keep it in mind for later :D For now it is perfect 😄

Imagine the outrage if the users would have seen that arrow

Madness! 🤣

On a more serious note, yes I will implement disabling the station selection for the first time, there's no point for the user to see that when first starting.

Awesome, thanks! Also please mark this PR as ready for review after this last change :D I'll go through the code again for a quick check and then it can be merged 🚀

@aniri
Copy link
Member

aniri commented Nov 28, 2020

Also, I noticed something which doesn't seems right:

Go to forms screen -> select one form -> select a question -> choose an answer -> hit BACK(the system button) -> app makes an empty POST request to /answers(which is successful)-> the app shows the question with green(as answered). Are these answers registered on the backend? I'm asking this because if you select and answer multiple questions then hitting BACK it will make a POST request to /answers with all the answers except the last selected one(from the screen where we hit BACK).

The behavior seems inconsistent and could be a bug which makes us miss answers.

OMG, yes, it is a bug! The post request should send the answer in this case and not make an empty post :/ Nice catch!

I'll add an issue for it!

@aniri aniri merged commit cb2aefd into code4romania:develop Nov 28, 2020
@lukstbit lukstbit deleted the implement_234 branch November 28, 2020 12:20
aniri added a commit that referenced this pull request Dec 12, 2020
* fix send note on question

* Add simple usage for values from remote config at "About page"

* Use values from remote config for menu

* Copy files to cache instead of using directly. Fixes #178

* Remove file from cache after sending in any sync case

* Fix null string property

* Made font for selected item in the menu bold (#195)

* added collapse keyboard function (#215)

* added collapse keyboard function

* fix: keyboard collapse and opens again while switching multiple inputs

* refactor: collapseKeyboardIfFocusOutsideEditText() to Utils.kt

* Use the orderNumber field for sorting (#222)

* Use the orderNumber field for sorting

* Remove duplication for sonar

* Fix sorting for forms (#227)

* Sending firebase token on the login call (#225)

* Use filesDir instead of cacheDir (#230)

* Enable upload of multiple files with note (#231)

* Enable uploading multiple files with note

* Allow user to select multiple files

* Improve error strings for note files

* Update app/src/main/res/values-ro-rRO/strings.xml

Co-authored-by: Irina Borozan <anirib@gmail.com>

* replace: `this` with appropriate lifecycle owner (#224)

Co-authored-by: Irina Borozan <anirib@gmail.com>

* check db reset remote config flag on startup

* cleanups and add default value for remote config param

* Add sync related UI changes (#233)

* Add sync related UI changes

* small layout adjustments

* Add latest changes

Co-authored-by: Irina Borozan <anirib@gmail.com>

* removed extra activate

* Allow user to delete note files (#237)

* Allow user to delete note files

* Handle file deletion failure

* Send count of unsynced items to analytics (#244)

* Send count of unsynced items to analytics

* renamed variable to keep it consistent

Co-authored-by: Irina Borozan <anirib@gmail.com>

* fixed remote config init error and add min interval setting (#245)

* Fix RxJava null values usage (#240)

* Fix incorrect selection of counties (#247)

* Enable screen for visited polling stations (#241)

* Enable screen for visited polling stations

* Enable selecting from previously visited stations

* added visited stations icon from figma

* Implement requested changes

* Hide station selection on first run

Co-authored-by: Irina Borozan <anirib@gmail.com>

* Enable details screen for user's notes (#242)

* Enable details screen for user's notes

* Implement UI requested changes

* Fix issues with form-question codes

* Fix adding notes directly from forms list

* Tweak UI and save codes for note into database

* Update app/src/main/java/ro/code4/monitorizarevot/ui/notes/NoteDetailsFragment.kt

* Update app/src/main/res/values/strings.xml

* Apply suggestions from code review

Co-authored-by: Irina Borozan <anirib@gmail.com>

* Add info for visited stations screen (#256)

* Fix UI for notes after changing stations (#254)

* Bugfix/cleanups on app update (#257)

* refactored has selected stations shared pref

* fixed db cleanups after app update

* Add checks for empty answers list to sync (#252)

* added new link in menu and new guide (#259)

* changed logout display in menu and default safety link (#260)

Co-authored-by: Dmitriy <dekanszn@gmail.com>
Co-authored-by: caldareanda <61616802+caldareanda@users.noreply.github.com>
Co-authored-by: Avadhut Tanugade <30384908+mrwhoknows55@users.noreply.github.com>
Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>
Co-authored-by: Pedro Francisco de Sousa Neto <pedrokra@gmail.com>
Co-authored-by: AlexandraDaraban <AlexandraDaraban@users.noreply.github.com>
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.

Add link to polling stations list from choose polling station screen Show list of visited polling stations
2 participants