Page MenuHomePhabricator

Allow opening arbitrary URLs in a Custom Tab activity.
Closed, ResolvedPublic


There have been a few use cases mentioned in the past where we'd like to show an external web page to the user without "leaving the app." Technically this would still be shown in a separate Activity, but the user could more easily navigate "back" to where they were in the app.

It sounds like Custom Tabs will fulfill this use case adequately:

Event Timeline

@JTannerWMF @schoenbaechler
Here is a rough sketch of how this would work:

The user is greeted with a CTA that leads to some URL:

device-2021-09-28-134057.png (2×1 px, 105 KB)

...and a Custom Tab activity is shown, and loads the URL:

device-2021-09-28-132425.png (2×1 px, 1 MB)

The advantage of this approach is that the user only needs to tap the "X" at the top-left to go right back to the app.

However, here are some limitations to keep in mind:

  • The icons in the toolbar are all provided automatically, and can be only minimally customized.
  • The rest of the app is not aware of the "state" of this WebView. e.g. it's not possible to know whether the user has "completed" a survey, or gone off to some other website, and so on.

It does, however, allow us to set custom colors for the toolbar, according to our theme:

device-2021-09-28-132456.png (2×1 px, 1 MB)

@Dbrant where/how can I test this? Thanks!