Closed Bug 2086549 Opened 21 days ago Closed 6 days ago

[customizable-menu] Support reordering menu sections

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

(7 external files)

Once a user starts to drag they can place it above or below any section, can place it above or below a section.

Any change in the menu structure should automatically be persisted.

Figma specs

Add nonDraggableItems to createListInteractionState.
Items in it cannot be dragged but, unlike ignoredItems, other
items can still be moved next to or dropped onto them.

Items are moved while they are dragged. Until the list is laid out again,
the dragged item's index can still be the old one, so the drop animation
would start from the wrong place. Find the item by its key instead.

With live reordering the dragged item is moved in the list while it
follows the finger. Its placement animation then started from where it
was before the move, making it jump back there and then to the finger.
Same behavior already exist for the tabs tray which also doesn't
animate the placement of the dragged item.

The list gives the position of an item only while it is visible.
Once the dragged item was out of view, it was moved as if at the
top of the list, away from the finger.
Remember its last position instead, similar to the functionality
from the tabs tray.

The order of the items in the customization screen was changed only when
the user let go of the dragged item, not while dragging it.
The list then moved the item to its new place and this meant that it was
drawn in the wrong place for a frame, because the slide started from the
position the item had before the list moved it.
The list also played its own animation on top.
The item should stay where it was let go of and slide into its new place.

To avoid the issue we can offset the item while the list places it, by
the distance between where it was let go of and where the list puts it.
The item is then drawn where it was let go of, and slides into its place
as the offset shrinks to zero.
The list's own animation is turned off for this item, as it would add to
ours and move the item away from where it was let go of.

Dragging list items is only supported for lazy lists, so show all the
items of the customize menu screen in one LazyColumn, keeping the same
spacing between them.

Sections shown in the menu, including the mandatory ones, can be long
pressed and dragged to reorder them. While dragged, a section is faded
and the sections below it take its space. The section is moved, and the
new structure of the menu saved, when the user lets go of it.
Hidden sections cannot be moved, and letting go of a section over them
leaves it where it was.

See Also: → 2088766
Attachment #9672612 - Attachment description: Bug 2086549 - part 4 - Keep dragged list items under the finger when scrolled out of view r=#android-reviewers → Bug 2086549 - part 2 - Keep dragged list items under the finger when scrolled out of view r=#android-reviewers
Attachment #9672610 - Attachment description: Bug 2086549 - part 2 - Stop reordered list items from jumping when dropped r=#android-reviewers → Bug 2086549 - part 3 - Stop list items jumping when moved while dragged or after being dropped r=#android-reviewers
Attachment #9672614 - Attachment description: Bug 2086549 - part 6 - Show the customize menu screen as a lazy list r=#android-reviewers → Bug 2086549 - part 4 - Show the customize menu screen as a lazy list r=#android-reviewers
Attachment #9672615 - Attachment description: Bug 2086549 - part 7 - Reorder the shown sections of the customize menu screen by dragging them r=#android-reviewers → Bug 2086549 - part 5 - Reorder the shown sections of the customize menu screen by dragging them r=#android-reviewers
Pushed by plingurar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/72cd7dbfa371 https://hg.mozilla.org/integration/autoland/rev/4389fb2896d5 part 1 - Allow fixed drop targets in draggable lists r=android-reviewers,jdelorenzo https://github.com/mozilla-firefox/firefox/commit/b2b4c9744e0e https://hg.mozilla.org/integration/autoland/rev/503b4383fbdf part 2 - Keep dragged list items under the finger when scrolled out of view r=android-reviewers,jdelorenzo,android-tabs-reviewers https://github.com/mozilla-firefox/firefox/commit/09138a47bc7a https://hg.mozilla.org/integration/autoland/rev/9882ee4d150c part 3 - Stop list items jumping when moved while dragged or after being dropped r=android-reviewers,jdelorenzo https://github.com/mozilla-firefox/firefox/commit/49e0e5091c97 https://hg.mozilla.org/integration/autoland/rev/cea09d8a6da0 part 4 - Show the customize menu screen as a lazy list r=android-reviewers,jdelorenzo https://github.com/mozilla-firefox/firefox/commit/83db9d7135d0 https://hg.mozilla.org/integration/autoland/rev/33f7de2ed3ef part 5 - Reorder the shown sections of the customize menu screen by dragging them r=android-reviewers,android-build-system-reviewers,jdelorenzo
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: