-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Convert hierarchy to Fragment #6516
Conversation
c0b1039
to
a44178c
Compare
@getodk/testers marking this ready for testing before review as it'd be good to get a first pass before I clean things up in case there are some fundamental problems here I've missed. |
a01cd5a
to
a2fa91f
Compare
I think this was the intention of #6303, but please correct me if I'm wrong @alyblenkin. |
This is a good catch! The goal was just to update the east arrow icon, not the up icon as well. I think the up arrow is still a helpful visual indicator that you're going back up to the table of contents. |
That makes sense. Just to be sure though before I unwind anything, the Figma link shows the hierarchy with the list icon in the top right: I'm guessing that's a mistake? |
Sorry I think the group folder icon in the first mockup is a mistake. However, now I'm second guessing myself because we discussed this a while back. @lognaturel correct me if I'm wrong here, but our goal was just update the east arrow, not the up arrow icon as well. |
To clarify, I think the list icon would work on it's own if we didn't already have the up arrow, but I think it's a pretty ingrained pattern now. I think the list icon would suggest you go back to the top level given the current pattern where there is more of this concept of moving up or down, but you could also imagine tapping to keep going to the main table of contents. I don't think this is a stronger design choice, rather it could be another option. Not worth considering given we haven't had folks bring up any issues. |
Feels right to me to leave the up arrow as it is. I think navigating up a level feels relatively clear. I don't think the table of contents icon works well there because it would suggest you go all the way back to the top level. |
@seadowg - sorry that you have to unwind things there! I've update the design. |
No worries! I just wanted to double check. |
@getodk/testers that should be good to go again! |
Tested with success! Verified on devices with Android 10, 14 Verified cases:
|
...ct_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormHierarchyTest.java
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/formhierarchy/FormHierarchyFragment.java
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/formhierarchy/FormHierarchyFragment.java
Outdated
Show resolved
Hide resolved
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="?colorSurface" |
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.
Why not colorOnSurface
?
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.
I'm pretty sure they're flipped from what you'd think here: the tint is colorOnSurface
and the path is colorSurface
. Everything looks correct right?
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.
But why not to use colorOnSurface
in both as we do in every other icon? What's the point of using colorSurface
here?
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.
Good question! It looks like we just don't need tint
. I'd always get confused by this, but the tint color is "blended" in with the others so here the path
was being rendered with colorSurface
but then it would just be "blended" (just overridden in this case) with colorOnSurface
. If I remove tint
and set the path to colorOnSurface
it seems to work as expected.
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.
If I remove tint and set the path to colorOnSurface it seems to work as expected.
Yes, but when you change themes it might not work as expected see this pr #5537
Maybe now as removed changing the theme in the app it is no longer needed but I'm not sure. If you want to remove it please make sure it is not needed or maybe a better idea is to keep it and file an issue to investigate if we still need it.
..._app/src/main/java/org/odk/collect/android/formentry/repeats/DeleteRepeatDialogFragment.java
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/formhierarchy/FormHierarchyFragment.java
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/formhierarchy/FormHierarchyFragment.java
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/formhierarchy/FormHierarchyFragment.java
Outdated
Show resolved
Hide resolved
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.
Work towards #5420
Closes #6303
Why is this the best possible solution? Were any other approaches considered?
I've tried to keep changes to a minimal here with the main goal just being to get the majority of the hierarchy code into a
Fragment
. There's only two structural changes to highlight really:MenuProvider
API. I felt like this made more sense than rewriting it to use the deprecatedFragment
methods.FormHierarchyViewModel
to manage state. This will most likely get merged intoFormEntryViewModel
, but I think that'll make more sense once form entry has also been moved to a Fragment.I also added some new tests for code that I found had none.
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 shouldn't change any behaviour and the big risk here is that it either does or introduces bugs to flows using the form hierarchy. A general test of using the hierarchy (during form entry and viewing) would be good here.
This also changes the jump/summary icon to the new one!
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still passDateFormatsTest