-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implemented flexbox layout #3925
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this seems a lot nicer. Really happy to be getting rid of the GridWidget
hierarchy 😄
@grzesiek2010 I can see an unnecessary search text field on widgets:
There is also a difference in displayed answers in columns. |
You are using
don't you think it's better and expected? You are using compact (which is the same like columns-pack) appearance and it should accommodate as many elements in one row as possible. |
@grzesiek2010 I agree that it looks better on devices with a bigger screen, not on smaller one but they are so rare so I don't think it's worth to do something about that. I've continued my testing and I have noticed that it looks badly in RTL language - answers are missing and scroll is deformed on Androids from 7-10, see the gif: It looks in the best way on Android 5.1( list or huge space between questions): |
What appearance is that? Does that look worse than on master? |
I am bothered by the left side of the choices not matching up with the question text. I would be ok with treating that as a separate issue, though, as I do think the benefits here far outweigh the inconvenience of that visual change. Looking at it in more contexts, I also wish the vertical spacing were a little less. @grzesiek2010 I'm guessing you matched what was there for image grids? What about matching the text select vertical spacing? How does that look with images? |
The easiest solution that we could share across all widgets would be to have a global margin. The thing is that we decided to make the whole screen clickable for selects. I agreed on that but I wasn't totally convinced and now it's a problem here.
Where is it too big? Generally spacing is the same for all elements it differs only between columns-pack (compact) appearance and the others Another question: can we get rid of that arrow icon that indicates it's the quick appearance? It is used only with normal selects but requires a separate layout. We don't use it with no-buttons appearance and here in case of columns-pack it doesn't make much sense too. I think there is no need to display it. The separate layout which is required just to handle that arrow cause problems with rtl languages so that's why I'm asking about here too. |
Ah, yes, now I remember what this refers to. We've seen people try to tap the very left of their screen while holding their devices and having to tap again. I do think it's important to have the tap region extend all the way to the left of the screen. I don't have enough of the layouts loaded in my brain to know what's possible. The left spacing looks great with
You know what, I was wrong and the vertical spacing now matches all other selects which is what we want. I was referring to the vertical space between elements.
I think I had advocated for keeping it but really, it's not very clear what it means. Given the trouble it's causing I'm up for removing it. |
I fixed one issue: the case where in rtl languages items were displayed in separate rows despite the fact column-pack appearance was used. However I'm not able to fix that empty space which is visible also with rtl languages:
I think we can ignore it for now, as @lognaturel said:
so @kkrawczyk123 please file a separate issue.
I got rid of it, @kkrawczyk123 keep it in mind.
|
Quick thing for the RTL The spacing for |
66aee6a
to
967537f
Compare
@kkrawczyk123 I think it's ready for testing again. and I fixed it but generally there are many more bugs in rtl so it's something for separate prs as long as it's not a big regression caused by this pr. |
Tested with success! Tested scenarios:
@getodk-bot unlabel "needs testing" |
Closes #3744
What has been done to verify that this works as intended?
I tested some widgets manually and ran all automated tests.
Why is this the best possible solution? Were any other approaches considered?
I was able to get rid of a lot of code removing Grid widgets that didn't use recyclerview. That was something I had always wanted to do. I used google FlexboxLayout which allowed me not only improved the behavior described in the issue but also get rid of those Grid 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?
This change should improve the behavior described in the issue and also improve the way we build compact (columns-pack no buttons) widgets (widgets with images instead of radio buttons/checkboxes). It would be good to test as many select widgets as possible since the risk is related to almost all of them.
Do we need any specific form for testing your changes? If so, please attach one.
All widgets form
SelectsTestColumnsPack.xml.txt
and generally any form with select widgets.
The form I prepared some time ago to document selects might be helpful https://docs.google.com/spreadsheets/d/1uA6NeUbE51WACiKUjErFUxYFeJdGGWglNGKivuzei7I/edit#gid=1181650558
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Probably we need to update some screenshots only but it's not very important.
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.