Skip to content
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

Implement likert option functionality in Collect #3431

Merged
merged 81 commits into from
Nov 21, 2019

Conversation

shouryaj
Copy link
Contributor

@shouryaj shouryaj commented Oct 31, 2019

Closes #1272

What has been done to verify that this works as intended?

We have written espresso tests to verify functionality. We have also extensively stress tested the likert widget with different forms.

Why is this the best possible solution? Were any other approaches considered?

We first started out with using a static XML, but soon realized that this approach would require a lot of XML manipulation from Java. Instead we decided to follow the already existing practices used by the other widgets.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

There should be no regression risks since we simply added an extra widget.

Do we need any specific form for testing your changes? If so, please attach one.

Form is attached. To test images, edit the form with the name of the image you want to test.
likert_test.xlsx

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Link to issue: getodk/docs#1135

Before submitting this PR, please make sure you have:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

PieterBenjamin and others added 30 commits October 7, 2019 12:48
…es correctly now. If there are any errors or there are less or more choices than 5 it will not render.
…, text will be shown if image not found, removed likert_icon variable and number of buttons depend on the number of choices given
…hidden and fixed issue of display name instead of label
…ess if it crosses the limit when it will be capped to 95x95
@andrewsiew2
Copy link
Contributor

@seadowg We actually added the lines because it simplified things more actually. If we were to add margins they would need to be the same length as the lines anyways. The complication with the margins would be getting it to be the right length with different phone sizes while adding a line with the match parent attribute does it for us.

Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

A little bit of cleanup pointed out inline! Otherwise, this looks ready for QA to me. 🎉

likert.xml Outdated Show resolved Hide resolved
collect_app/src/androidTest/assets/forms/likert_test.xml Outdated Show resolved Hide resolved
@shouryaj shouryaj requested a review from lognaturel November 15, 2019 18:55
Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

Looks ready to QA to me!

@kkrawczyk123
Copy link
Contributor

I have tested on Androids 4.2 4.4, 5.1, 6.0, 7.1, 8.1, 9.0 and 10 - and I have noticed just one small issue, when I change the language to RTL the scale is reversed in the proper way but the lines are not, they have gaps, see attached screenshots:
Screenshot_20191118-102933
Screenshot_20191118-103036

@andrewsiew2
Copy link
Contributor

@kkrawczyk123 Is there a way to know if an RTL language has been chosen upon rendering?

@grzesiek2010
Copy link
Member

QuestionWidget which your class extends contains isRTL() method you can check how we use it.

@shouryaj
Copy link
Contributor Author

@kkrawczyk123 This issue should be fixed now!

@grzesiek2010
Copy link
Member

@shouryaj
could you also rebase the branch against master/fix conflict?

@lognaturel
Copy link
Member

@grzesiek2010 @seadowg @shouryaj @andrewsiew2 @estberg @PieterBenjamin @Joseph-Schafer My thinking was that it would take a fair amount of effort to rework the history for not much benefit. Luckily there are no conflicts and since the feature is relatively stand-alone, I think squashing down to one commit on merge will provide sufficient context. The unfortunate thing is that several people contributed to this effort and the single commit would be attributed to @shouryaj. I was thinking that we could credit everyone in the commit details.

@kkrawczyk123
Copy link
Contributor

Tested with success!
Verified on Androids 4.2, 4.4, 5.1, 6.0, 7.1, 8.1, 9.0 and 10.
verified cases:

  • light mode
  • dark mode
  • screen rotation
  • app minimizing
  • RTL language light mode
  • RTL language dark mode

@opendatakit-bot unlabel "needs testing"
@opendatakit-bot label "behavior verified"

@lognaturel lognaturel merged commit bce1410 into getodk:master Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for likert appearance
10 participants