[customizable-menu] Add a MenuListItem composable to compose-menu
Categories
(Firefox for Android :: Menu, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox157 | --- | fixed |
People
(Reporter: petru, Assigned: petru)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][android-core])
Attachments
(1 file, 1 external file)
|
15.40 KB,
image/png
|
Details |
Based on the recent investigation most menu items share a similar structure and UI.
While Fenix has different menu items composables to handle separately every small difference it might be easier to support a generic menu item structure with some elements optional.
The general structure of the MenuListItem: icon? · title + summary · "New" badge · state badge · action button (+ optional divider).
States: Default / Active / Disabled / Warning (for the item as a whole, the state badge and the summary also)
Two tap targets, each its own a11y node; only the container draws shape and background.
Note: This same structure is used by the addons items in the "Extensions" menu also. The only difference is that those items support a spinning action button while an addon is installing. We can support the same by adding another state to the action button: inProgress
Attached is an example design of all the elements this button should support.
IPProtectionMenuItem supports already most of this.
| Assignee | ||
Updated•2 months ago
|
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
This supports all details that Fenix might want to show in a menu item shown as a row.
Updated•2 months ago
|
| Assignee | ||
Comment 2•2 months ago
|
||
Investigating the colors used by all the menu items in Fenix to find the commonalities I see there is quite a bit of disparity I saw the following configuration for the 4 possible states an item could be in:
| Element | DEFAULT | ACTIVE | DISABLED | WARNING |
|---|---|---|---|---|
| Title | onSurface |
tertiary |
onSurface @38% |
error |
| Summary | onSurfaceVariant |
tertiary |
onSurface @38% |
error |
| Icon tint | onSurfaceVariant |
tertiary |
onSurface @38% |
error |
| Badge container | surfaceContainerHigh |
tertiaryContainer |
surfaceContainerHigh |
surfaceContainerHigh |
| Badge text | onSurface |
tertiary |
onSurface @38% |
error |
| "New" indicator container | information |
information |
information @38% |
information |
| "New" indicator text | onPrimary |
onPrimary |
onPrimary |
onPrimary |
| Row background | surfaceBright |
surfaceBright |
surfaceBright |
surfaceBright |
| Divider | outlineVariant |
outlineVariant |
outlineVariant |
outlineVariant |
All values are MaterialTheme.colorScheme roles. @38% is .copy(alpha = 0.38f).
Only the badge container varies by state, and only for ACTIVE. Title and summary/icon differ only
in DEFAULT; in every other state they share a colour.
Sources
Element state is independent of item state
Summary, badge and action button each carry their own MenuItemState; they do not inherit the
item's.
ExtensionsMenuItem.kt:155greys the summary while the row stays enabled.IPProtectionMenuItem.kt:207gives the badgeACTIVEorWARNINGwhile the row stays
enabled.
Updated•2 months ago
|
Comment 4•2 months ago
|
||
| bugherder | ||
Description
•