Skip to content

Modernize and improve the Android UI#43795

Merged
jdm merged 5 commits into
servo:mainfrom
neighbourhoodie:feat-improve-android-ui
Apr 7, 2026
Merged

Modernize and improve the Android UI#43795
jdm merged 5 commits into
servo:mainfrom
neighbourhoodie:feat-improve-android-ui

Conversation

@espy

@espy espy commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Modernize and improve the Android UI, and add browsing history panel.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 31, 2026
espy added 5 commits March 31, 2026 13:56
Signed-off-by: Alex Feyerke <alex@neighbourhood.ie>
Signed-off-by: Alex Feyerke <alex@neighbourhood.ie>
Signed-off-by: Alex Feyerke <alex@neighbourhood.ie>
Signed-off-by: Alex Feyerke <alex@neighbourhood.ie>
…menu button

Signed-off-by: Alex Feyerke <alex@neighbourhood.ie>
@espy espy force-pushed the feat-improve-android-ui branch from 764479e to 8c64ff8 Compare March 31, 2026 11:56
@jdm

jdm commented Apr 7, 2026

Copy link
Copy Markdown
Member

Duplicating most of the original PR description here, since it doesn't really make sense as a commit message for the final commit when it's all squashed.


Changes

Hello 👋 This is Alex from Neighbourhoodie, submitting our STA work on the Android port. Previous checkin is here.

Changes

  • UI upgraded to Material3 standards using the default theme and generally improved layout, spacing, etc.
  • Moved to using more modern UI elements, e.g. migrating away from the old PreferenceFragmentCompat to a regular Fragment that can be structured and styled more flexibly and using menus where applicable, in the new bottomBar, for example.
  • Added a tablet-and-above size layout that does away with the bottom bar and has all UI at the top.
  • Updated the icons to use Material3 standards or added fitting vector icons (imported from Google Fonts as svg).
  • Added a browser history fragment and a corresponding button. The history stores data in an app-scoped JSON file (conceptually very simple, does not add any new dependencies or require project changes, like a modern DataStore would have.)
  • Added some workarounds to accommodate some Servo quirks: onLoadEnded fires a bunch of times per website, not just once, as one would expect, which required some extra code in the history handling. Also, servoView.stop() currently doesn’t do anything, so clicking the back or forward buttons now also unsets the "cancel loading" state, since there was no way to get out of that when a page got stuck loading. onLoadStarted also doesn’t fire for cached pages, so a bit of working around that in the history handler as well.
  • Various small improvements, e.g. moving all UI strings to strings.xml, adding code comments to make future contributions easier.

Notes

  • No changes to the build process or any of the dependencies that are installed in these instructions, so no need to change the Android contribution or build docs either.

  • Did not go all-in on the newest UI elements and styles yet, like. DockedToolbar or M3 Expressive, instead opted for elements with broader adoption, more examples, discussions and docs.

  • There are some mMediaSession event handlers and some related icons in the project, but I could not figure out how to ever trigger them, in all my attempts I could not get Servo to play any sort of media. So I didn’t touch any of that.

  • Testing was all done in emulators, I don’t have access to a physical Android device.

  • I have included some currently unused code to take screenshots of the servoView, that could later be used for a bookmarks view or proper tabbed browsing support.

  • ✅ Rebased to main

  • ✅ Ran ./mach fmt

  • ✅ test-tidy reported no errors.

  • ✅ Commits are signed off

Testing: No tests were added as this PR is mainly some quality-of-life improvements to existing code that also has no tests.

Screen Recordings

Screenshots aren’t particularly

servo_android_2026_update_phone

servo_android_2026_update_tablet

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read through the changes and don't see anything to keep it from merging. Thanks for doing this work to modernize the code!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 7, 2026
@jdm jdm added this pull request to the merge queue Apr 7, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 7, 2026
Merged via the queue into servo:main with commit f977c06 Apr 7, 2026
31 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants