Closed Bug 2090877 Opened 14 days ago Closed 12 days ago

[customizable-menu] Let the draggable list decide where dragged menu sections are dropped

Categories

(Firefox for Android :: Menu, task)

All
Android
task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: petru, Assigned: petru)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][android-core])

Attachments

(1 external file)

The customize menu screen measures where the "Hidden sections" title, the area to drag sections into to hide them, the reset button and the last hidden section are placed, to change where the draggable list would drop a dragged section. This is a second way of finding drop targets, next to the list's own, as pointed out by Julie here.

Add interceptInteractionMode to createListInteractionState in compose-draggable. It is called with what the list finds for a dragged item and returns the interaction to use instead, which the list shows and acts upon when the item is let go of.

Use it in the customize menu screen for its rules: sections are hidden only when dragged over the hidden sections, mandatory sections cannot be hidden, and a section let go of below the hidden sections is put back. Show the area to drag sections into as its own list item, so that where the hidden sections are is read from the layout of the list instead of being measured.

No change for the user is expected.

The customize menu screen measured where the hidden sections title, the
area to drag sections into, the reset button and the last hidden section
were placed, to change where the list would drop a dragged section. That
was a second way of finding drop targets, next to the list's own.

Add interceptInteractionMode to createListInteractionState. It is called
with what the list finds for a dragged item whenever the item is dragged,
and returns the interaction to use instead, which the list shows and acts
upon when the item is let go of.
The screen uses it for its rules: sections are hidden only when dragged
over the hidden sections, mandatory sections cannot be hidden, and a
section let go of below the hidden sections is put back. The area to drag
sections into is its own list item, so where the hidden sections are is
read from the layout of the list instead of being measured. The list now
tells the screen where the section is moved to when it is let go of.

As for the list's own targets, the drop target is found again only when
the dragged section moves, and from where the items are laid out rather
than from where they are drawn while animated.

Pushed by plingurar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4fe43bf0e840 https://hg.mozilla.org/integration/autoland/rev/777c420b0089 Let the draggable list decide where dragged sections of the customize menu screen are dropped r=android-reviewers,jdelorenzo
Status: ASSIGNED → RESOLVED
Closed: 12 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: