Add 3 new widgets for Firefox on Android
Categories
(Firefox for Android :: Search, task)
Tracking
()
People
(Reporter: Gela, Assigned: Gela)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][android-activation-trust])
Attachments
(1 file, 5 external files, 5 obsolete files)
|
1.29 MB,
image/jpeg
|
Details |
Updated•2 months ago
|
Move everything that is not specific to the widget's five layouts into a base
class in org.mozilla.fenix.widget: the pending intents, the app icon, the width
buckets and the hint text. SearchWidgetProvider keeps only the layout it picks
for a width and how it binds that layout, and stays in org.mozilla.gecko.search
because its name is part of the widget's identity on the launcher.
This is behaviour-neutral. The pending intents now travel together in a
SearchWidgetIntents holder rather than as three parameters, and the size and
layout helpers move off the companion object onto the instance, so the tests
call them on an instance.
Firefox is about to ship more than one search widget, and every caller that
refreshes the widget has to reach all of them: a new default search engine, a
new app icon or a voice search toggle changes how each one draws.
Replace SearchWidgetProvider.updateAllWidgets with a SearchWidgets registry
that holds every provider and broadcasts an update to each. The list holds the
one provider that exists today; each new widget appends itself.
This also fixes the installed flag, which onDisabled cleared whenever any one
provider lost its last instance. It now asks the registry whether the user
still has a search widget anywhere on the launcher.
A full-width search bar for the launcher: the Firefox icon, a search hint, and
a private browsing and a voice search button at the end. Unlike the original
widget it keeps one layout at every width and only swaps the hint, so it does
not need a layout per size.
BaseSearchBarWidgetProvider carries what the bar widgets share, since two more
follow: the single layout, the hint, and a set of action buttons that the
widget hides when the action behind one is unavailable. The private tab intent
goes through NewTabShortcutIntentProcessor, the path the launcher's "New
private tab" shortcut already takes.
The same full-width bar, with a row of round shortcut buttons at the end:
Google Lens, private browsing and voice search. Lens joins the set of actions
a bar widget can carry; the widget hides each button whose action is
unavailable, so a device without speech recognition or a user whose default
engine is not Google sees a shorter row rather than a dead button.
A narrow bar for users who cannot spare a full row: the Firefox icon and the
hint sit together in a pill, with the shortcut buttons beside it. The pill
leaves far less room for text than a full-width bar, so this widget keeps the
short hint at every width rather than growing to "Search the web".
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
No behavior change. The Glance search bar widgets added in the next patch
reuse these intents.
Generated previews need Android 15. The system rate limits publishing, so it
runs once per app version, after visual completeness.
Android 14 and earlier cannot show generated previews, so they use these static
images, with night variants for the dark theme.
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Comment 10•1 month ago
|
||
Comment 11•1 month ago
|
||
Comment 12•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/de8182bd0d58
https://hg.mozilla.org/mozilla-central/rev/8ec4a3a0a93a
https://hg.mozilla.org/mozilla-central/rev/2a6fd98e692d
https://hg.mozilla.org/mozilla-central/rev/695187d29a0e
https://hg.mozilla.org/mozilla-central/rev/3d73a47c3243
Comment 13•1 month ago
•
|
||
Verified as implemented on the Firefox for Android Nightly 160.0a1 and 161.0a1 that there are 3 extra widgets. These can be added on the device's home screen and are functioning as expected.
Tested with a Pixel 6 (Android 17), Samsung Galaxy Tab S9 Ultra (Android 16), Xiaomi Mi8 Lite (Android 10), and a Samsung Galaxy S24 (Android 16).
Updated•1 month ago
|
Description
•