Closed lime124 closed 4 years ago
Feel free to ping me for help on viewing all the options available in a Custom Tabs.
We also need to consider the position of the toolbar for custom tabs. The browser is meant to look more like the native app itself to give the illusion of not leaving the context of the calling app, so we might want to think about re-positioning the toolbar to the top like most apps would have.
cc: @lime124
Short status update:
To open a Fenix custom tab:
CustomTabsIntent
A Fenix custom tab contains:
By default, Fenix custom tabs have an address bar that’s positioned on the top of the screen. This is to maintain continuity between many third-party apps (that have top app bar) and the custom tabs they’ve requested.
Continuity has a cost. Our custom tabs app bar no longer appears on the bottom of the screen, making it hard for the thumb to reach.
In the address bar, we show both site title and its host name. Site protocol/scheme, path and query are all hidden, so the address bar doesn’t get filled up.
Users can navigate back and forward to other websites within a custom tab, so the “Close Custom Tab” action is conveyed through a Quit ✕ button, not a Back ← button.
If a third-party app wants to change this icon, they are free to do so. For example, some apps may want a back icon to maintain an impression of continuity.
See section 2.
We normally follow our measurements diligently. However, custom tabs have to break some rules in order to give more space for the page title.
Notable measurements:
The rest of the measurements are standard.
This menu contains various common actions. To open it, tap the menu ⫶ icon.
It contains:
A consequence of placing the address bar on top is that the menu is ordered in reverse.
Pay particular attention to these menu items:
To open the current website in Fenix, go to the overflow menu, then tap “Open in Fenix”.
In the process, the UI will animate to signal switching from one app to another.
Our custom tab is designed to be customisable by third-party app developers who can easily request for it.
For now, three aspects of custom tabs will be customisable:
A developer can have the colour of Fenix app bar match their own app bar, to indicate better continuity.
A developer can have one of their own icon as a tappable action on the app bar.
When another app bar icon exists, the space for page title and URL has to reduce.
A developer can add their own item on the overflow menu.
@vesta0 The custom tab specs is posted above, and @colintheshots this issue is now ready for feedback and breakdown.
@brampitoyo Those look great. I'm a bit worried though that we are breaking one of the value propositions of Custom Tabs (from the app developer's point of view): "make transitions between native and web content more seamless without having to resort to a WebView.".
From the mocks I wonder, is it correct that:
If you are interested in other customization options of custom tabs then scroll a bit through the list of methods here: https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.Builder
I'd suggest feature parity with Focus, i.e. most of the issues @pocmo mentioned should be addressed then.
@brampitoyo mocks looks great! What will the back button in the Custom tab overflow menu be used for, as oppose to the browser back button?
@brampitoyo Reviewing these designs with Stephen - for the Powered by Fenix label type can you use the Material Design Caption spec? Also, this share icon is different than the page action buttons icons. Need to decide which we are using and apply consistently.
Please use sentence case - Desktop site and Find in page
@pocmo wrote:
I'm a bit worried though that we are breaking one of the value propositions of Custom Tabs (from the app developer's point of view): "make transitions between native and web content more seamless without having to resort to a WebView.".
That’s a really good point!
I suppose I look at it more from the user’s point of view, which is: “Why should I manually switch my default browser to Fenix, if it’s not going to offer any special benefit?”
Therefore, I decided to put a few differentiating features in our custom tabs:
But you’ve made two really good points:
What if, for v1, we just make our custom tabs functionally similar to Focus or Chrome (as @bbinto has suggested)?
- If we follow Focus/Chrome’s implementations, do we still need to come up with our own default style, in case the app doesn’t specify anything?
Some aspects, yes. For example, if the toolbar colour isn't provided by the app, then we would show the native browser app's theme colour.
- Can third-party apps specify their own custom font to use in Custom Tab app bar and menu? Can Fenix uses its own font (which is not Roboto)?
Unfortunately, no. These are the only options available as linked above: https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.Builder
Another thing to consider is which menu and action buttons do we want to consistently be there. For example, in Focus (and RB now) we always show the 'share' menu item but an app also has an option to ask to show the share button or not. With Focus + RB, this means that if they choose yes, then we have two share buttons. We've also taken away the ability for the app to choose to share a link where they would not want to expose this functionality (intranet links, internal sites, etc.)
@jonalmeida @pocmo I’ve updated our Custom Tabs specs so that they have better continuity with third-party apps. As a result, the app bar is moved up top, and it carries some consequences.
@mheubusch I’ve updated the caption text style, Share icon and sentence case as you recommended.
See the updated specs just up above, or click https://github.com/mozilla-mobile/fenix/issues/203#issuecomment-463426620.
@brampitoyo Are users going to know the Fenix logo is a button and not simply a brand mark or a favicon? I almost want to put something around it. Maybe a rounded button border?
How will back and forward work? I'd expect they're both gray initially and only activate later. Is that correct?
@brampitoyo What will the back button in the Custom tab overflow menu be used for, as oppose to the browser back button?
@brampitoyo What will the back button in the Custom tab overflow menu be used for, as oppose to the browser back button?
In a Custom Tab, you can still click links on that page so the back button would be used for site navigation. It would be greyed out if there is nothing to go back to.
@brampitoyo I share Colin's concern that the Fenix button looks like a logo and competes with the space given to the URL, but am not sure if what you are suggesting is that this is the default and a developer could move this action to the overflow menu or are you suggesting that this would be a text link in the overflow menu and a developer could add whatever they want there?
@colintheshots wrote:
Are users going to know the Fenix logo is a button and not simply a brand mark or a favicon?
@mheubusch wrote:
I share Colin's concern that the Fenix button looks like a logo and competes with the space given to the URL
Originally, I was going to give users one-tap access to open links from third-party apps in Fenix (which will then save that link into a session). This is our default state.
But your points are both very good:
So now I’m thinking that, by default, our custom tab shouldn’t come with any toolbar button:
”Open in Firefox Fenix” is now the last link inside the overflow menu.
Doing this frees up quite a bit of additional space that we can use to show page title. What do you think?
@mheubusch wrote:
[…] am not sure if what you are suggesting is that this is the default and a developer could move this action to the overflow menu or are you suggesting that this would be a text link in the overflow menu and a developer could add whatever they want there?
Even without our own toolbar action, a developer can still have their own. Doing this will leave less space for page title, but it means more flexibility for developers – and many developers will choose not to use that precious space:
We have moved our “Open in Fenix” action into the overflow menu, but a developer can also have their own item there. Hopefully, most developers will choose this option!
It should be noted that a developer can have both a custom toolbar action and a custom overflow menu item.
Just for completion’s sake, a developer can also recolour the toolbar to make it more seamless with their app:
Nice overview of all the Custom Tab options! \o/
Thanks, Bram! This looks good. I'll mark this closed.
@colintheshots @jonalmeida Thanks. I’ve updated my specs up above, so it contains the most recent mocks.
https://github.com/mozilla-mobile/fenix/issues/203#issuecomment-463426620
@brampitoyo I really liked the one-tap access to open links from third-party apps in Fenix but I have to defer to UX experts on this.
@vesta0 You’re right. “Open link in Browser” is an important action to have. However, it will come at the cost of hiding some of the page title (ie. we’ll have to truncate many titles if we have so little space for it). For the moment, page title takes priority.
@brampitoyo am I able to get font size for the title as well as the host name? I also need the "elevation" value for the URL bar (relevant for the shadow)
@sblatz
The URL bar elevation value is 1 dp.
Exact dimensions and spacings are posted just below. It had to be relatively narrow to give as much space as possible for title and host name, which can run long.
As discussed here https://github.com/mozilla-mobile/fenix/issues/1727#issuecomment-488541929, we want to support hiding URL bar when 3rd party apps request it https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.html#EXTRA_ENABLE_URLBAR_HIDING – @vesta0 IMO that is something we can do post MVP, please prioritize. Thanks!
User Story: As a user...
Current Design Status:
Design Priority: P?
┆Issue is synchronized with this Jira Task