-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Bug]: The search engine selector should have a 4px padding top and left #27998
Comments
…ome fragment Correctly anchor the search selector menu depending on the orientation it opens in.
I have worked on this task for a while. During this time I realized there are multiple issues that make fixing this more difficult than it seems. There are four cases here: When opened from When opened from When toolbar at top After testing each of these, I noticed none of them had the right alignment, but case 2a was the closest. I supposed there was a problem witht the offsets. The menu that pops up is an element from Android Components, After asking for help from Petru, he suggested we check the anchor for the menu. There are two views that act as anchors, identified by "@+id/search_selector”". We tried changing the anchor to the parent, which led to an improvement but not the expected result, therefore we figured that creating a new anchor and positioning it where we want would solve the issue. It did fix the problem, but only in case 1a: But when the toolbar is at the top, because the constraint was bottom to bottom of parent it appeared as follows: A solution is to programmatically change the constraint to top to top of parent The current solution presented in the draft is only for case 1a,b. Arguably, this is a “hacky” implementation, but after many hours of trial and error, it is the only one we have reached for now. For now this will remain as a draft and if anyone can suggest a better implementation please do. Link to PR: #27999 |
It appears we worked on that in parallel! I worked on adding the unified search icon to the HomeFragment, but missed the spacing requirement. working with @t-p-white on the cutting the last item in half made me realize that's an issue. After digging into it, I realized that actually the anchoring works correctly, but we are passing the wrong anchor and also the menu itself has paddings from elevation that we don't account for. If you look at this picture closely, you will see that the bottom edge of the popup aligns perfectly with the corner of the view we are passing – search_selector. It has margins, so the x coordinate is shifted to teach the start of the margin of the view. Bottom aligns with the anchor bottom. My solution was to calculate the spacing between the menu and it's container, and offset the container accordingly. The behavior of the old menu is the same, by the way. It is aligned over the anchor completely, but spacing between the container and menu "shifts" the menu a bit, creating spacing. Btw, achieving right position is not possible without reducing elevation by at least 1dp – 8dp is too much to have enough space at the TOP orientation. But luckily the design has updated elevation. |
Thank you for the update. |
Synced with Michael Verdi about the status of unified search and this issue also. |
changed the order to keep DataSync calm and tranquil on the Jira side |
Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1815548 Change performed by the Move to Bugzilla add-on. |
Steps to reproduce
Expected behaviour
The menu should have 4dp padding left and bottom/top (depending on toolbar position)
Actual behaviour
The menu is not placed correctly
In
SearchDialogFragment
In
HomeFragment
Device name
No response
Android version
11
Firefox release type
Firefox Nightly
Firefox version
109.0a1
Device logs
No response
Additional information
No response
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: