From 769c1e422dd54919a0ef5c1f4956f0c86e8aa334 Mon Sep 17 00:00:00 2001 From: Sawyer Blatz Date: Mon, 25 Nov 2019 16:43:32 -0800 Subject: [PATCH] For #5694 & #6054: Allows users to change toolbar position (#6608) * For #5694 & #6054: Adds preference screen for toolbar * For #5694: Adds changing toolbar position functionality * No issue: Updates telemetry links to actually work lol :grimacing: * For #6054: Adds toolbar position to core ping --- app/metrics.yaml | 252 ++++++++++-------- .../fenix/browser/BaseBrowserFragment.kt | 8 +- .../mozilla/fenix/browser/BrowserFragment.kt | 25 +- .../browser/BrowserToolbarTopBehavior.kt | 2 +- .../components/metrics/GleanMetricsService.kt | 8 +- .../fenix/components/metrics/Metrics.kt | 7 + .../components/toolbar/BrowserToolbarView.kt | 22 +- .../components/toolbar/DefaultToolbarMenu.kt | 9 +- .../customtabs/ExternalAppBrowserFragment.kt | 2 +- .../fenix/search/toolbar/ToolbarView.kt | 39 ++- .../fenix/settings/SettingsFragment.kt | 19 +- .../fenix/settings/ToolbarSettingsFragment.kt | 54 ++++ .../java/org/mozilla/fenix/utils/Settings.kt | 19 ++ ...l => component_bottom_browser_toolbar.xml} | 3 +- .../layout/component_browser_top_toolbar.xml | 27 ++ app/src/main/res/layout/fragment_browser.xml | 3 +- app/src/main/res/navigation/nav_graph.xml | 7 + app/src/main/res/values/preference_keys.xml | 5 + app/src/main/res/values/strings.xml | 10 +- app/src/main/res/xml/preferences.xml | 4 + app/src/main/res/xml/toolbar_preferences.xml | 14 + docs/metrics.md | 2 + 22 files changed, 405 insertions(+), 136 deletions(-) create mode 100644 app/src/main/java/org/mozilla/fenix/settings/ToolbarSettingsFragment.kt rename app/src/main/res/layout/{component_search.xml => component_bottom_browser_toolbar.xml} (89%) create mode 100644 app/src/main/res/layout/component_browser_top_toolbar.xml create mode 100644 app/src/main/res/xml/toolbar_preferences.xml diff --git a/app/metrics.yaml b/app/metrics.yaml index 2c3ccff6c..a9b11cb8f 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -17,7 +17,7 @@ events: source: description: "The method used to open Fenix. Possible values are: `app_icon`, `custom_tab` or `link`" bugs: - - https://github.com/mozilla-mobile/fenix/issue/968 + - https://github.com/mozilla-mobile/fenix/issues/968 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673 notification_emails: @@ -32,7 +32,7 @@ events: source: description: "The view the user was on when they initiated the search (For example: `Home` or `Browser`)" bugs: - - https://github.com/mozilla-mobile/fenix/issue/959 + - https://github.com/mozilla-mobile/fenix/issues/959 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673 notification_emails: @@ -46,7 +46,7 @@ events: autocomplete: description: "A boolean that tells us whether the URL was autofilled by an Autocomplete suggestion" bugs: - - https://github.com/mozilla-mobile/fenix/issue/959 + - https://github.com/mozilla-mobile/fenix/issues/959 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673 notification_emails: @@ -65,7 +65,7 @@ events: * shortcut.action * shortcut.suggestion bugs: - - https://github.com/mozilla-mobile/fenix/issue/959 + - https://github.com/mozilla-mobile/fenix/issues/959 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673 - https://github.com/mozilla-mobile/fenix/pull/1677 @@ -84,7 +84,7 @@ events: Private Tab, Share, Report Site Issue, Back/Forward button, Reload Button, Quit, Reader Mode On, Reader Mode Off, Open In App bugs: - - https://github.com/mozilla-mobile/fenix/issue/1024 + - https://github.com/mozilla-mobile/fenix/issues/1024 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708 - https://github.com/mozilla-mobile/fenix/pull/5098#issuecomment-529658996 @@ -99,7 +99,7 @@ events: send_in_pings: - baseline bugs: - - https://github.com/mozilla-mobile/fenix/issue/1301 + - https://github.com/mozilla-mobile/fenix/issues/1301 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1785 notification_emails: @@ -118,8 +118,8 @@ events: enabled: description: "Whether or not the preference is *now* enabled" bugs: - - https://github.com/mozilla-mobile/fenix/issue/975 - - https://github.com/mozilla-mobile/fenix/issue/5094 + - https://github.com/mozilla-mobile/fenix/issues/975 + - https://github.com/mozilla-mobile/fenix/issues/5094 - https://github.com/mozilla-mobile/fenix/issues/5737 - https://github.com/mozilla-mobile/fenix/issues/5586 data_reviews: @@ -139,7 +139,7 @@ events: source: description: "The location from which the user selected the what's new button. Either 'about' or 'home'" bugs: - - https://github.com/mozilla-mobile/fenix/issue/5021 + - https://github.com/mozilla-mobile/fenix/issues/5021 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5090 notification_emails: @@ -153,7 +153,7 @@ events: mode: description: "The mode the link was opened in. Either 'PRIVATE' or 'NORMAL'" bugs: - - https://github.com/mozilla-mobile/fenix/issue/5737 + - https://github.com/mozilla-mobile/fenix/issues/5737 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5975 notification_emails: @@ -169,20 +169,36 @@ search_shortcuts: engine: description: "The name of the built-in search engine the user selected as a string" bugs: - - https://github.com/mozilla-mobile/fenix/issue/793 + - https://github.com/mozilla-mobile/fenix/issues/793 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1202#issuecomment-476870449 notification_emails: - fenix-core@mozilla.com expires: "2020-03-01" +toolbar_settings: + changed_position: + type: event + description: > + The user selected a new position for the toolbar + extra_keys: + position: + description: "A string that indicates the new position of the toolbar TOP or BOTTOM" + bugs: + - https://github.com/mozilla-mobile/fenix/issues/6054 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/6608 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-03-01" + crash_reporter: opened: type: event description: > The crash reporter was displayed bugs: - - https://github.com/mozilla-mobile/fenix/issue/1040 + - https://github.com/mozilla-mobile/fenix/issues/1040 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708 notification_emails: @@ -196,7 +212,7 @@ crash_reporter: crash_submitted: description: "A boolean that tells us whether or not the user submitted a crash report" bugs: - - https://github.com/mozilla-mobile/fenix/issue/1040 + - https://github.com/mozilla-mobile/fenix/issues/1040 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708 notification_emails: @@ -217,7 +233,7 @@ context_menu: save_image, share_link, copy_link, copy_image_location ``` bugs: - - https://github.com/mozilla-mobile/fenix/issue/957 + - https://github.com/mozilla-mobile/fenix/issues/957 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010 notification_emails: @@ -230,7 +246,7 @@ find_in_page: description: > A user opened the find in page UI bugs: - - https://github.com/mozilla-mobile/fenix/issue/1036 + - https://github.com/mozilla-mobile/fenix/issues/1036 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010 notification_emails: @@ -241,7 +257,7 @@ find_in_page: description: > A user closed the find in page UI bugs: - - https://github.com/mozilla-mobile/fenix/issue/1036 + - https://github.com/mozilla-mobile/fenix/issues/1036 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010 notification_emails: @@ -252,7 +268,7 @@ find_in_page: description: > A user clicked the "next result" button bugs: - - https://github.com/mozilla-mobile/fenix/issue/1036 + - https://github.com/mozilla-mobile/fenix/issues/1036 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010 notification_emails: @@ -263,7 +279,7 @@ find_in_page: description: > A user clicked the "previous result" button bugs: - - https://github.com/mozilla-mobile/fenix/issue/1036 + - https://github.com/mozilla-mobile/fenix/issues/1036 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010 notification_emails: @@ -274,7 +290,7 @@ find_in_page: description: > A user searched the page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1036 + - https://github.com/mozilla-mobile/fenix/issues/1036 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010 notification_emails: @@ -290,7 +306,7 @@ metrics: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/960 + - https://github.com/mozilla-mobile/fenix/issues/960 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673 notification_emails: @@ -309,7 +325,7 @@ metrics: - metrics - baseline bugs: - - https://github.com/mozilla-mobile/fenix/issue/1158 + - https://github.com/mozilla-mobile/fenix/issues/1158 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1677 - https://github.com/mozilla-mobile/fenix/pull/5216 @@ -326,7 +342,7 @@ metrics: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/1192 + - https://github.com/mozilla-mobile/fenix/issues/1192 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1953/ - https://github.com/mozilla-mobile/fenix/pull/5216 @@ -341,7 +357,7 @@ metrics: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/1192 + - https://github.com/mozilla-mobile/fenix/issues/1192 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1953/ - https://github.com/mozilla-mobile/fenix/pull/5216 @@ -357,7 +373,7 @@ metrics: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/1298 + - https://github.com/mozilla-mobile/fenix/issues/1298 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5579 notification_emails: @@ -371,12 +387,26 @@ metrics: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/4456 + - https://github.com/mozilla-mobile/fenix/issues/4456 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/6003 notification_emails: - fenix-core@mozilla.com expires: "2020-03-01" + toolbar_position: + type: string + lifetime: application + description: > + A string that indicates the new position of the toolbar TOP or BOTTOM + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/6054 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/6608 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-03-01" search.default_engine: @@ -391,7 +421,7 @@ search.default_engine: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/800 + - https://github.com/mozilla-mobile/fenix/issues/800 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1606 - https://github.com/mozilla-mobile/fenix/pull/5216 @@ -409,7 +439,7 @@ search.default_engine: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/800 + - https://github.com/mozilla-mobile/fenix/issues/800 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1606 - https://github.com/mozilla-mobile/fenix/pull/5216 @@ -428,7 +458,7 @@ search.default_engine: send_in_pings: - metrics bugs: - - https://github.com/mozilla-mobile/fenix/issue/800 + - https://github.com/mozilla-mobile/fenix/issues/800 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1606 - https://github.com/mozilla-mobile/fenix/pull/5216 @@ -442,7 +472,7 @@ bookmarks_management: description: > A user opened a bookmark in a new tab. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -453,7 +483,7 @@ bookmarks_management: description: > A user opened multiple bookmarks at once in new tabs. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -464,7 +494,7 @@ bookmarks_management: description: > A user opened a bookmark in a new private tab. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -475,7 +505,7 @@ bookmarks_management: description: > A user opened multiple bookmarks at once in new private tabs. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -486,7 +516,7 @@ bookmarks_management: description: > A user edited the title and/or URL of an existing bookmark. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -497,7 +527,7 @@ bookmarks_management: description: > A user moved an existing bookmark or folder to another folder. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -508,7 +538,7 @@ bookmarks_management: description: > A user removed a bookmark item. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -519,7 +549,7 @@ bookmarks_management: description: > A user removed multiple bookmarks at once. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -530,7 +560,7 @@ bookmarks_management: description: > A user shared a bookmark. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -541,7 +571,7 @@ bookmarks_management: description: > A user copied a bookmark. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -552,7 +582,7 @@ bookmarks_management: description: > A user added a new bookmark folder. bugs: - - https://github.com/mozilla-mobile/fenix/issue/974 + - https://github.com/mozilla-mobile/fenix/issues/974 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1708 notification_emails: @@ -563,7 +593,7 @@ bookmarks_management: description: > A user removed a bookmark folder. bugs: - - https://github.com/mozilla-mobile/fenix/issue/3174 + - https://github.com/mozilla-mobile/fenix/issues/3174 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3724 notification_emails: @@ -576,7 +606,7 @@ custom_tab: description: > A user closed the custom tab bugs: - - https://github.com/mozilla-mobile/fenix/issue/977 + - https://github.com/mozilla-mobile/fenix/issues/977 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1697 notification_emails: @@ -587,7 +617,7 @@ custom_tab: description: > A user pressed the action button provided by the launching app bugs: - - https://github.com/mozilla-mobile/fenix/issue/977 + - https://github.com/mozilla-mobile/fenix/issues/977 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1697 notification_emails: @@ -598,7 +628,7 @@ custom_tab: description: > A user opened the custom tabs menu bugs: - - https://github.com/mozilla-mobile/fenix/issue/977 + - https://github.com/mozilla-mobile/fenix/issues/977 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1697 notification_emails: @@ -645,7 +675,7 @@ qr_scanner: description: > A user opened the QR scanner bugs: - - https://github.com/mozilla-mobile/fenix/issue/1857 + - https://github.com/mozilla-mobile/fenix/issues/1857 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2524#issuecomment-492739967 notification_emails: @@ -656,7 +686,7 @@ qr_scanner: description: > A user scanned a QR code, causing a confirmation prompt to display asking if they want to navigate to the page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1857 + - https://github.com/mozilla-mobile/fenix/issues/1857 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2524#issuecomment-492739967 notification_emails: @@ -667,7 +697,7 @@ qr_scanner: description: > A user tapped "allow" on the prompt, directing the user to the website scanned bugs: - - https://github.com/mozilla-mobile/fenix/issue/1857 + - https://github.com/mozilla-mobile/fenix/issues/1857 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2524#issuecomment-492739967 notification_emails: @@ -678,7 +708,7 @@ qr_scanner: description: > A user tapped "deny" on the prompt, putting the user back to the scanning view bugs: - - https://github.com/mozilla-mobile/fenix/issue/1857 + - https://github.com/mozilla-mobile/fenix/issues/1857 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2524#issuecomment-492739967 notification_emails: @@ -691,7 +721,7 @@ library: description: > A user opened the library bugs: - - https://github.com/mozilla-mobile/fenix/issue/976 + - https://github.com/mozilla-mobile/fenix/issues/976 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2538#issuecomment-492830242 notification_emails: @@ -702,7 +732,7 @@ library: description: > A user closed the library bugs: - - https://github.com/mozilla-mobile/fenix/issue/976 + - https://github.com/mozilla-mobile/fenix/issues/976 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2538#issuecomment-492830242 notification_emails: @@ -716,7 +746,7 @@ library: item: description: "The library item the user selected" bugs: - - https://github.com/mozilla-mobile/fenix/issue/976 + - https://github.com/mozilla-mobile/fenix/issues/976 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2538#issuecomment-492830242 notification_emails: @@ -732,7 +762,7 @@ error_page: error_type: description: "The error type of the error page encountered" bugs: - - https://github.com/mozilla-mobile/fenix/issue/1242 + - https://github.com/mozilla-mobile/fenix/issues/1242 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2491#issuecomment-492414486 notification_emails: @@ -745,7 +775,7 @@ sync_auth: description: > A user opened the sync authentication page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -756,7 +786,7 @@ sync_auth: description: > A user closed the sync page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -767,7 +797,7 @@ sync_auth: description: > A user pressed the sign in button on the sync authentication page and was successfully signed in to FxA bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -778,7 +808,7 @@ sync_auth: description: > A user pressed the sign out button on the sync account page and was successfully signed out of FxA bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -789,7 +819,7 @@ sync_auth: description: > User registered a new Firefox Account, and was signed into it bugs: - - https://github.com/mozilla-mobile/fenix/issue/4971 + - https://github.com/mozilla-mobile/fenix/issues/4971 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4931#issuecomment-529740300 notification_emails: @@ -800,7 +830,7 @@ sync_auth: description: > User signed into FxA by pairing with a different Firefox browser, using a QR code bugs: - - https://github.com/mozilla-mobile/fenix/issue/4971 + - https://github.com/mozilla-mobile/fenix/issues/4971 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4931#issuecomment-529740300 notification_emails: @@ -811,7 +841,7 @@ sync_auth: description: > User signed into FxA via an account shared from another locally installed Mozilla application (e.g. Fennec) bugs: - - https://github.com/mozilla-mobile/fenix/issue/4971 + - https://github.com/mozilla-mobile/fenix/issues/4971 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4931#issuecomment-529740300 notification_emails: @@ -822,7 +852,7 @@ sync_auth: description: > Account manager automatically recovered FxA authentication state without direct user involvement bugs: - - https://github.com/mozilla-mobile/fenix/issue/4971 + - https://github.com/mozilla-mobile/fenix/issues/4971 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4931#issuecomment-529740300 notification_emails: @@ -833,7 +863,7 @@ sync_auth: description: > User authenticated via FxA using an unknown mechanism. "Known" mechanisms are currently sign-in, sign-up and pairing bugs: - - https://github.com/mozilla-mobile/fenix/issue/4971 + - https://github.com/mozilla-mobile/fenix/issues/4971 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4931#issuecomment-529740300 notification_emails: @@ -844,7 +874,7 @@ sync_auth: description: > A user pressed the scan pairing button on the sync authentication page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -857,7 +887,7 @@ sync_account: description: > A user opened the sync account page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -868,7 +898,7 @@ sync_account: description: > A user closed the sync account page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -879,7 +909,7 @@ sync_account: description: > A user pressed the sync now button on the sync account page bugs: - - https://github.com/mozilla-mobile/fenix/issue/1190 + - https://github.com/mozilla-mobile/fenix/issues/1190 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532 notification_emails: @@ -890,7 +920,7 @@ sync_account: description: > A user sent the current tab to another FxA device bugs: - - https://github.com/mozilla-mobile/fenix/issue/4908 + - https://github.com/mozilla-mobile/fenix/issues/4908 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5106 notification_emails: @@ -901,7 +931,7 @@ sync_account: description: > A user pressed the "sign in to send tab" button inside the share tab menu bugs: - - https://github.com/mozilla-mobile/fenix/issue/4908 + - https://github.com/mozilla-mobile/fenix/issues/4908 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5106 notification_emails: @@ -914,7 +944,7 @@ history: description: > A user opened the history screen bugs: - - https://github.com/mozilla-mobile/fenix/issue/2362 + - https://github.com/mozilla-mobile/fenix/issues/2362 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3940 notification_emails: @@ -925,7 +955,7 @@ history: description: > A user removed a history item bugs: - - https://github.com/mozilla-mobile/fenix/issue/2362 + - https://github.com/mozilla-mobile/fenix/issues/2362 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3940 notification_emails: @@ -936,7 +966,7 @@ history: description: > A user removed all history items bugs: - - https://github.com/mozilla-mobile/fenix/issue/2362 + - https://github.com/mozilla-mobile/fenix/issues/2362 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3940 notification_emails: @@ -947,7 +977,7 @@ history: description: > A user shared a history item bugs: - - https://github.com/mozilla-mobile/fenix/issue/2362 + - https://github.com/mozilla-mobile/fenix/issues/2362 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3940 notification_emails: @@ -958,7 +988,7 @@ history: description: > A user opened a history item bugs: - - https://github.com/mozilla-mobile/fenix/issue/2362 + - https://github.com/mozilla-mobile/fenix/issues/2362 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3940 notification_emails: @@ -971,7 +1001,7 @@ reader_mode: description: > Reader mode is available for the current page bugs: - - https://github.com/mozilla-mobile/fenix/issue/2267 + - https://github.com/mozilla-mobile/fenix/issues/2267 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3941 notification_emails: @@ -982,7 +1012,7 @@ reader_mode: description: > A user opened reader mode bugs: - - https://github.com/mozilla-mobile/fenix/issue/2267 + - https://github.com/mozilla-mobile/fenix/issues/2267 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3941 notification_emails: @@ -993,7 +1023,7 @@ reader_mode: description: > A user closed reader mode bugs: - - https://github.com/mozilla-mobile/fenix/issue/2267 + - https://github.com/mozilla-mobile/fenix/issues/2267 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4328 notification_emails: @@ -1004,7 +1034,7 @@ reader_mode: description: > A user tapped the appearance button bugs: - - https://github.com/mozilla-mobile/fenix/issue/2267 + - https://github.com/mozilla-mobile/fenix/issues/2267 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3941 notification_emails: @@ -1017,7 +1047,7 @@ collections: description: > A user renamed a collection bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1028,7 +1058,7 @@ collections: description: > A user restored a tab from collection tab list bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1039,7 +1069,7 @@ collections: description: > A user tapped "open tabs" from collection menu bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1050,7 +1080,7 @@ collections: description: > A user tapped remove tab from collection tab list bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1061,7 +1091,7 @@ collections: description: > A user tapped share collection bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1072,7 +1102,7 @@ collections: description: > A user tapped delete collection from collection menu bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1088,7 +1118,7 @@ collections: tabs_selected: description: "The number of tabs added to the collection" bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1104,7 +1134,7 @@ collections: tabs_selected: description: "The number of tabs added to the collection" bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1115,7 +1145,7 @@ collections: description: > A user opened the select tabs screen (the first step of the collection creation flow) bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/3935 notification_emails: @@ -1126,7 +1156,7 @@ collections: description: > A user tapped the "add tab" button in the three dot menu of collections bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4358 notification_emails: @@ -1137,7 +1167,7 @@ collections: description: > A user long pressed on a tab, triggering the collection creation screen bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4358 notification_emails: @@ -1149,7 +1179,7 @@ collections: A user pressed the "save to collection" button on either the home or browser screen, triggering the collection creation screen to open (tab_select_opened) bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4358 notification_emails: @@ -1165,7 +1195,7 @@ collections: description: > A user pressed the "rename collection" button in the three dot menu bugs: - - https://github.com/mozilla-mobile/fenix/issue/969 + - https://github.com/mozilla-mobile/fenix/issues/969 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4539 notification_emails: @@ -1179,7 +1209,7 @@ search_widget: A user pressed anywhere from the Firefox logo until the start of the microphone icon, opening a new tab search screen. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4457 + - https://github.com/mozilla-mobile/fenix/issues/4457 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4714 notification_emails: @@ -1190,7 +1220,7 @@ search_widget: description: > A user pressed the microphone icon, opening a new voice search screen. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4457 + - https://github.com/mozilla-mobile/fenix/issues/4457 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4714 notification_emails: @@ -1204,7 +1234,7 @@ private_browsing_mode: A user pressed the garbage can icon on the private browsing home page, deleting all private tabs. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4968 notification_emails: @@ -1216,7 +1246,7 @@ private_browsing_mode: A user pressed the "undo" button in the snackbar that is shown when the garbage icon is tapped. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4968 notification_emails: @@ -1227,7 +1257,7 @@ private_browsing_mode: description: > A user pressed the private browsing mode notification itself. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4968 notification_emails: @@ -1238,7 +1268,7 @@ private_browsing_mode: description: > A user pressed the private browsing mode notification's "Open" button. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4968 notification_emails: @@ -1249,7 +1279,7 @@ private_browsing_mode: description: > A user pressed the private browsing mode notification's "Delete and Open" button. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/4968 notification_emails: @@ -1262,7 +1292,7 @@ tracking_protection: description: > A user added a tracking protection exception through the TP toggle in the panel. bugs: - - https://github.com/mozilla-mobile/fenix/issue/5312 + - https://github.com/mozilla-mobile/fenix/issues/5312 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188 notification_emails: @@ -1273,7 +1303,7 @@ tracking_protection: description: > A user opened tracking protection settings from the panel. bugs: - - https://github.com/mozilla-mobile/fenix/issue/5312 + - https://github.com/mozilla-mobile/fenix/issues/5312 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188 notification_emails: @@ -1284,7 +1314,7 @@ tracking_protection: description: > A user pressed the tracking protection shield icon in toolbar. bugs: - - https://github.com/mozilla-mobile/fenix/issue/5312 + - https://github.com/mozilla-mobile/fenix/issues/5312 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188 notification_emails: @@ -1295,7 +1325,7 @@ tracking_protection: description: > A user pressed into a list of categorized trackers in tracking protection panel. bugs: - - https://github.com/mozilla-mobile/fenix/issue/5312 + - https://github.com/mozilla-mobile/fenix/issues/5312 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188 notification_emails: @@ -1306,7 +1336,7 @@ tracking_protection: description: > A user opened tracking protection settings through settings. bugs: - - https://github.com/mozilla-mobile/fenix/issue/5312 + - https://github.com/mozilla-mobile/fenix/issues/5312 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188 notification_emails: @@ -1320,7 +1350,7 @@ tracking_protection: etp_setting: description: "The new setting for ETP: strict, standard" bugs: - - https://github.com/mozilla-mobile/fenix/issue/5312 + - https://github.com/mozilla-mobile/fenix/issues/5312 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188 notification_emails: @@ -1333,7 +1363,7 @@ private_browsing_shortcut: description: > A user pressed the "Add private browsing shortcut" button in settings. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5194 notification_emails: @@ -1344,7 +1374,7 @@ private_browsing_shortcut: description: > A user pressed the "Add shortcut" button when the contextual feature recommender appeared. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5194 notification_emails: @@ -1355,7 +1385,7 @@ private_browsing_shortcut: description: > A user pressed the "No thanks" button when the contextual feature recommender appeared. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5194 notification_emails: @@ -1366,7 +1396,7 @@ private_browsing_shortcut: description: > A user pressed the pinned private shortcut in Android home screen, opening up a new private search. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5194 notification_emails: @@ -1377,7 +1407,7 @@ private_browsing_shortcut: description: > A user pressed the long-press shortcut "Open new tab", opening up a new search. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5194 notification_emails: @@ -1388,7 +1418,7 @@ private_browsing_shortcut: description: > A user pressed the long-press shortcut "Open new private tab", opening up a new private search. bugs: - - https://github.com/mozilla-mobile/fenix/issue/4658 + - https://github.com/mozilla-mobile/fenix/issues/4658 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5194 notification_emails: @@ -1401,7 +1431,7 @@ tab: description: > A user pressed the play icon on a tab from the home screen bugs: - - https://github.com/mozilla-mobile/fenix/issue/5197 + - https://github.com/mozilla-mobile/fenix/issues/5197 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5266 notification_emails: @@ -1415,7 +1445,7 @@ tab: description: > A user pressed the pause icon on a tab from the home screen bugs: - - https://github.com/mozilla-mobile/fenix/issue/5197 + - https://github.com/mozilla-mobile/fenix/issues/5197 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5266 notification_emails: @@ -1428,7 +1458,7 @@ media_notification: description: > A user pressed the play icon on the media notification bugs: - - https://github.com/mozilla-mobile/fenix/issue/5197 + - https://github.com/mozilla-mobile/fenix/issues/5197 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5520 notification_emails: @@ -1439,7 +1469,7 @@ media_notification: description: > A user pressed the pause icon on the media notification bugs: - - https://github.com/mozilla-mobile/fenix/issue/5197 + - https://github.com/mozilla-mobile/fenix/issues/5197 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5520 notification_emails: diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index fc6a34044..0160a29dc 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -22,7 +22,6 @@ import androidx.lifecycle.lifecycleScope import androidx.navigation.NavDirections import androidx.navigation.fragment.findNavController import com.google.android.material.snackbar.Snackbar -import kotlinx.android.synthetic.main.component_search.* import kotlinx.android.synthetic.main.fragment_browser.* import kotlinx.android.synthetic.main.fragment_browser.view.* import kotlinx.coroutines.Dispatchers.IO @@ -197,6 +196,7 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs browserToolbarView = BrowserToolbarView( container = view.browserLayout, + shouldUseBottomToolbar = context.settings().shouldUseBottomToolbar, interactor = browserInteractor, customTabSession = customTabSessionId?.let { sessionManager.findSessionById(it) } ) @@ -213,7 +213,7 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs sessionId = customTabSessionId, stub = view.stubFindInPage, engineView = view.engineView, - toolbar = toolbar + toolbar = browserToolbarView.view ), owner = this, view = view @@ -361,14 +361,14 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE activity?.enterToImmersiveMode() - toolbar.visibility = View.GONE + browserToolbarView.view.visibility = View.GONE } else { activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER activity?.exitImmersiveModeIfNeeded() (activity as? HomeActivity)?.let { activity -> activity.themeManager.applyStatusBarTheme(activity) } - toolbar.visibility = View.VISIBLE + browserToolbarView.view.visibility = View.VISIBLE } updateLayoutMargins(inFullScreen) }, diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt index 441fb6c7b..e6d3938ae 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt @@ -12,10 +12,12 @@ import android.view.View import android.view.ViewGroup import android.widget.Button import android.widget.RadioButton +import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.content.ContextCompat import androidx.lifecycle.Observer import androidx.transition.TransitionInflater import com.google.android.material.snackbar.Snackbar +import kotlinx.android.synthetic.main.fragment_browser.* import kotlinx.android.synthetic.main.fragment_browser.view.* import kotlinx.coroutines.ExperimentalCoroutinesApi import mozilla.components.browser.session.Session @@ -27,6 +29,7 @@ import mozilla.components.feature.tabs.WindowFeature import mozilla.components.lib.state.ext.consumeFrom import mozilla.components.support.base.feature.BackHandler import mozilla.components.support.base.feature.ViewBoundFeatureWrapper +import org.jetbrains.anko.dimen import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R import org.mozilla.fenix.components.FenixSnackbar @@ -45,7 +48,7 @@ import org.mozilla.fenix.trackingprotection.TrackingProtectionOverlay * Fragment used for browsing the web within the main app. */ @ExperimentalCoroutinesApi -@Suppress("TooManyFunctions") +@Suppress("TooManyFunctions", "LargeClass") class BrowserFragment : BaseBrowserFragment(), BackHandler { private val windowFeature = ViewBoundFeatureWrapper() @@ -117,6 +120,24 @@ class BrowserFragment : BaseBrowserFragment(), BackHandler { override fun onStart() { super.onStart() subscribeToTabCollections() + val toolbarSessionObserver = TrackingProtectionOverlay( + context = requireContext(), + settings = requireContext().settings() + ) { + browserToolbarView.view + } + getSessionById()?.register(toolbarSessionObserver, this, autoPause = true) + updateEngineBottomMargin() + } + + private fun updateEngineBottomMargin() { + val browserEngine = swipeRefresh.layoutParams as CoordinatorLayout.LayoutParams + + browserEngine.bottomMargin = if (requireContext().settings().shouldUseBottomToolbar) { + requireContext().dimen(R.dimen.browser_toolbar_height) + } else { + 0 + } val toolbarSessionObserver = TrackingProtectionOverlay( context = requireContext(), @@ -256,8 +277,6 @@ class BrowserFragment : BaseBrowserFragment(), BackHandler { ) companion object { - private const val THREE = 3 - private const val BUTTON_INCREASE_DPS = 12 private const val SHARED_TRANSITION_MS = 200L private const val TAB_ITEM_TRANSITION_NAME = "tab_item" const val REPORT_SITE_ISSUE_URL = diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserToolbarTopBehavior.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserToolbarTopBehavior.kt index 58e6a82a9..c42d33979 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserToolbarTopBehavior.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BrowserToolbarTopBehavior.kt @@ -111,7 +111,7 @@ class BrowserToolbarTopBehavior( val params = view.layoutParams as CoordinatorLayout.LayoutParams // Position the snackbar below the toolbar so that it doesn't overlay the toolbar. - params.anchorId = R.id.quick_action_sheet + params.anchorId = R.id.toolbar params.anchorGravity = Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL params.gravity = Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt index 0f1ca812f..a29842b2f 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt @@ -6,8 +6,8 @@ package org.mozilla.fenix.components.metrics import android.content.Context import kotlinx.coroutines.Job -import kotlinx.coroutines.launch import kotlinx.coroutines.MainScope +import kotlinx.coroutines.launch import mozilla.components.service.glean.BuildConfig import mozilla.components.service.glean.Glean import mozilla.components.service.glean.config.Configuration @@ -40,6 +40,7 @@ import org.mozilla.fenix.GleanMetrics.SearchWidget import org.mozilla.fenix.GleanMetrics.SyncAccount import org.mozilla.fenix.GleanMetrics.SyncAuth import org.mozilla.fenix.GleanMetrics.Tab +import org.mozilla.fenix.GleanMetrics.ToolbarSettings import org.mozilla.fenix.GleanMetrics.TrackingProtection import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.settings @@ -445,6 +446,10 @@ private val Event.wrapper: EventWrapper<*>? is Event.ViewLoginPassword -> EventWrapper( { Logins.viewPasswordLogin.record(it) } ) + is Event.ToolbarPositionChanged -> EventWrapper( + { ToolbarSettings.changedPosition.record(it) }, + { ToolbarSettings.changedPositionKeys.valueOf(it) } + ) // Don't record other events in Glean: is Event.AddBookmark -> null is Event.OpenedBookmark -> null @@ -502,6 +507,7 @@ class GleanMetricsService(private val context: Context) : MetricsService { mozillaProducts.set(MozillaProductDetector.getInstalledMozillaProducts(context)) adjustCampaign.set(context.settings().adjustCampaignId) totalUriCount.set(context.settings().totalUriCount.toString()) + toolbarPosition.set(context.settings().toolbarSettingString) } SearchDefaultEngine.apply { diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt index 9bf6f8354..e1e7136a3 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt @@ -27,6 +27,7 @@ import org.mozilla.fenix.GleanMetrics.ErrorPage import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.GleanMetrics.Library import org.mozilla.fenix.GleanMetrics.SearchShortcuts +import org.mozilla.fenix.GleanMetrics.ToolbarSettings import org.mozilla.fenix.GleanMetrics.TrackingProtection import org.mozilla.fenix.R import java.util.Locale @@ -165,6 +166,12 @@ sealed class Event { } } + data class ToolbarPositionChanged(val position: Position) : Event() { + enum class Position { TOP, BOTTOM } + override val extras: Map? + get() = hashMapOf(ToolbarSettings.changedPositionKeys.position to position.name) + } + data class OpenedLink(val mode: Mode) : Event() { enum class Mode { NORMAL, PRIVATE } override val extras: Map? diff --git a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt index 37ff701e3..a1e9ce8da 100644 --- a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt +++ b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt @@ -10,14 +10,13 @@ import android.view.View import android.view.ViewGroup import android.widget.LinearLayout import android.widget.PopupWindow +import androidx.annotation.LayoutRes import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.core.view.isVisible import com.google.android.material.snackbar.Snackbar import kotlinx.android.extensions.LayoutContainer -import kotlinx.android.synthetic.main.browser_toolbar_popup_window.view.copy -import kotlinx.android.synthetic.main.browser_toolbar_popup_window.view.paste -import kotlinx.android.synthetic.main.browser_toolbar_popup_window.view.paste_and_go +import kotlinx.android.synthetic.main.browser_toolbar_popup_window.view.* import mozilla.components.browser.domains.autocomplete.ShippedDomainsProvider import mozilla.components.browser.session.Session import mozilla.components.browser.toolbar.BrowserToolbar @@ -29,6 +28,8 @@ import org.mozilla.fenix.components.FenixSnackbar import org.mozilla.fenix.customtabs.CustomTabToolbarMenu import org.mozilla.fenix.ext.bookmarkStorage import org.mozilla.fenix.ext.components +import org.mozilla.fenix.ext.settings +import org.mozilla.fenix.search.toolbar.setScrollFlagsForTopToolbar import org.mozilla.fenix.theme.ThemeManager interface BrowserToolbarViewInteractor { @@ -41,6 +42,7 @@ interface BrowserToolbarViewInteractor { class BrowserToolbarView( private val container: ViewGroup, + private val shouldUseBottomToolbar: Boolean, private val interactor: BrowserToolbarViewInteractor, private val customTabSession: Session? ) : LayoutContainer { @@ -48,11 +50,16 @@ class BrowserToolbarView( override val containerView: View? get() = container - private val urlBackground = LayoutInflater.from(container.context) - .inflate(R.layout.layout_url_background, container, false) + private val settings = container.context.settings() + + @LayoutRes + private val toolbarLayout = when { + settings.shouldUseBottomToolbar -> R.layout.component_bottom_browser_toolbar + else -> R.layout.component_browser_top_toolbar + } val view: BrowserToolbar = LayoutInflater.from(container.context) - .inflate(R.layout.component_search, container, true) + .inflate(toolbarLayout, container, true) .findViewById(R.id.toolbar) val toolbarIntegration: ToolbarIntegration @@ -118,6 +125,8 @@ class BrowserToolbarView( val sessionManager = components.core.sessionManager view.apply { + setScrollFlagsForTopToolbar() + elevation = TOOLBAR_ELEVATION.dpToFloat(resources.displayMetrics) if (!isCustomTabSession) { @@ -180,6 +189,7 @@ class BrowserToolbarView( readerModeStateProvider = { sessionManager.selectedSession?.readerMode ?: false }, + shouldReverseItems = !shouldUseBottomToolbar, onItemTapped = { interactor.onBrowserToolbarMenuItemTapped(it) }, lifecycleOwner = container.context as AppCompatActivity, sessionManager = sessionManager, diff --git a/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt b/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt index 2c2a1ced2..8e98c7130 100644 --- a/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt +++ b/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt @@ -12,15 +12,15 @@ import kotlinx.coroutines.launch import mozilla.components.browser.menu.BrowserMenuBuilder import mozilla.components.browser.menu.item.BrowserMenuDivider import mozilla.components.browser.menu.item.BrowserMenuHighlightableItem +import mozilla.components.browser.menu.item.BrowserMenuImageSwitch import mozilla.components.browser.menu.item.BrowserMenuImageText import mozilla.components.browser.menu.item.BrowserMenuItemToolbar -import mozilla.components.browser.menu.item.BrowserMenuImageSwitch import mozilla.components.browser.session.Session import mozilla.components.browser.session.SessionManager import mozilla.components.concept.storage.BookmarksStorage -import org.mozilla.fenix.browser.browsingmode.BrowsingMode import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R +import org.mozilla.fenix.browser.browsingmode.BrowsingMode import org.mozilla.fenix.ext.asActivity import org.mozilla.fenix.ext.components import org.mozilla.fenix.theme.ThemeManager @@ -31,6 +31,7 @@ class DefaultToolbarMenu( private val context: Context, private val hasAccountProblem: Boolean = false, private val requestDesktopStateProvider: () -> Boolean = { false }, + private val shouldReverseItems: Boolean, private val onItemTapped: (ToolbarMenu.Item) -> Unit = {}, private val lifecycleOwner: LifecycleOwner, private val bookmarksStorage: BookmarksStorage, @@ -146,7 +147,7 @@ class DefaultToolbarMenu( fun shouldShowReaderAppearance(): Boolean = sessionManager.selectedSession?.readerMode ?: false - listOfNotNull( + val menuItems = listOfNotNull( help, settings, library, @@ -164,6 +165,8 @@ class DefaultToolbarMenu( BrowserMenuDivider(), menuToolbar ) + + if (shouldReverseItems) { menuItems.reversed() } else { menuItems } } private val help = BrowserMenuImageText( diff --git a/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt index 891ca637c..d0fb0e085 100644 --- a/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt @@ -9,7 +9,7 @@ import android.view.Gravity import android.view.View import androidx.core.view.isGone import androidx.navigation.fragment.navArgs -import kotlinx.android.synthetic.main.component_search.* +import kotlinx.android.synthetic.main.component_browser_top_toolbar.* import kotlinx.android.synthetic.main.fragment_browser.view.* import kotlinx.coroutines.ExperimentalCoroutinesApi import mozilla.components.browser.session.Session diff --git a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt index 1d4cd214a..42dbeb45c 100644 --- a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt +++ b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt @@ -9,8 +9,14 @@ import android.graphics.drawable.BitmapDrawable import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.annotation.LayoutRes import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.content.ContextCompat +import com.google.android.material.appbar.AppBarLayout +import com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS +import com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED +import com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL +import com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP import kotlinx.android.extensions.LayoutContainer import mozilla.components.browser.domains.autocomplete.ShippedDomainsProvider import mozilla.components.browser.toolbar.BrowserToolbar @@ -19,6 +25,7 @@ import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature import mozilla.components.support.ktx.android.util.dpToPx import org.mozilla.fenix.R import org.mozilla.fenix.ext.getColorFromAttr +import org.mozilla.fenix.ext.settings import org.mozilla.fenix.search.SearchFragmentState /** @@ -58,8 +65,16 @@ class ToolbarView( override val containerView: View? get() = container + private val settings = container.context.settings() + + @LayoutRes + private val toolbarLayout = when { + settings.shouldUseBottomToolbar -> R.layout.component_bottom_browser_toolbar + else -> R.layout.component_browser_top_toolbar + } + val view: BrowserToolbar = LayoutInflater.from(container.context) - .inflate(R.layout.component_search, container, true) + .inflate(toolbarLayout, container, true) .findViewById(R.id.toolbar) private var isInitialized = false @@ -68,6 +83,8 @@ class ToolbarView( view.apply { editMode() + setScrollFlagsForTopToolbar() + elevation = TOOLBAR_ELEVATION_IN_DP.dpToPx(resources.displayMetrics).toFloat() setOnUrlCommitListener { @@ -146,3 +163,23 @@ class ToolbarView( private const val TOOLBAR_ELEVATION_IN_DP = 16 } } + +/** + * Dynamically sets scroll flags for the top toolbar when the user does not have a screen reader enabled + * Note that the bottom toolbar is currently fixed and will never have scroll flags set + */ +fun BrowserToolbar.setScrollFlagsForTopToolbar() { + // Don't set scroll flags for bottom toolbar + if (context.settings().shouldUseBottomToolbar) { + return + } + + val params = layoutParams as AppBarLayout.LayoutParams + params.scrollFlags = when (context.settings().shouldUseFixedTopToolbar) { + true -> 0 + false -> { + SCROLL_FLAG_SCROLL or SCROLL_FLAG_ENTER_ALWAYS or SCROLL_FLAG_SNAP or + SCROLL_FLAG_EXIT_UNTIL_COLLAPSED + } + } +} diff --git a/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt index 46c5af70e..484caf2ed 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt @@ -48,6 +48,7 @@ import org.mozilla.fenix.R.string.pref_key_search_settings import org.mozilla.fenix.R.string.pref_key_sign_in import org.mozilla.fenix.R.string.pref_key_site_permissions import org.mozilla.fenix.R.string.pref_key_theme +import org.mozilla.fenix.R.string.pref_key_toolbar import org.mozilla.fenix.R.string.pref_key_tracking_protection_settings import org.mozilla.fenix.R.string.pref_key_your_rights import org.mozilla.fenix.components.PrivateShortcutCreateManager @@ -114,6 +115,10 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver { showToolbar(getString(R.string.settings_title)) + update() + } + + private fun update() { val trackingProtectionPreference = findPreference(getPreferenceKey(pref_key_tracking_protection_settings)) trackingProtectionPreference?.summary = context?.let { @@ -124,11 +129,15 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver { } } + val toolbarPreference = + findPreference(getPreferenceKey(pref_key_toolbar)) + toolbarPreference?.summary = context?.settings()?.toolbarSettingString + val themesPreference = findPreference(getPreferenceKey(pref_key_theme)) themesPreference?.summary = context?.settings()?.themeSettingString - val aboutPreference = findPreference(getPreferenceKey(R.string.pref_key_about)) + val aboutPreference = findPreference(getPreferenceKey(pref_key_about)) val appName = getString(R.string.app_name) aboutPreference?.title = getString(R.string.preferences_about, appName) @@ -241,6 +250,9 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver { resources.getString(pref_key_theme) -> { navigateToThemeSettings() } + resources.getString(pref_key_toolbar) -> { + navigateToToolbarSettings() + } resources.getString(pref_key_privacy_link) -> { requireContext().let { context -> val intent = SupportUtils.createCustomTabIntent( @@ -321,6 +333,11 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver { Navigation.findNavController(view!!).navigate(directions) } + private fun navigateToToolbarSettings() { + val directions = SettingsFragmentDirections.actionSettingsFragmentToToolbarSettingsFragment() + Navigation.findNavController(view!!).navigate(directions) + } + private fun navigateToSitePermissions() { val directions = SettingsFragmentDirections.actionSettingsFragmentToSitePermissionsFragment() diff --git a/app/src/main/java/org/mozilla/fenix/settings/ToolbarSettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/ToolbarSettingsFragment.kt new file mode 100644 index 000000000..75447a8b9 --- /dev/null +++ b/app/src/main/java/org/mozilla/fenix/settings/ToolbarSettingsFragment.kt @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.fenix.settings + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import androidx.preference.PreferenceFragmentCompat +import org.mozilla.fenix.R +import org.mozilla.fenix.components.metrics.Event +import org.mozilla.fenix.ext.components +import org.mozilla.fenix.ext.getPreferenceKey + +class ToolbarSettingsFragment : PreferenceFragmentCompat() { + private lateinit var topPreference: RadioButtonPreference + private lateinit var bottomPreference: RadioButtonPreference + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setPreferencesFromResource(R.xml.toolbar_preferences, rootKey) + } + + override fun onResume() { + super.onResume() + (activity as AppCompatActivity).title = getString(R.string.preferences_toolbar) + (activity as AppCompatActivity).supportActionBar?.show() + + setupClickListeners() + setupRadioGroups() + } + + private fun setupClickListeners() { + val keyToolbarTop = getPreferenceKey(R.string.pref_key_toolbar_top) + topPreference = requireNotNull(findPreference(keyToolbarTop)) + topPreference.onClickListener { + requireContext().components.analytics.metrics.track(Event.ToolbarPositionChanged( + Event.ToolbarPositionChanged.Position.TOP + )) + } + + val keyToolbarBottom = getPreferenceKey(R.string.pref_key_toolbar_bottom) + bottomPreference = requireNotNull(findPreference(keyToolbarBottom)) + bottomPreference.onClickListener { + requireContext().components.analytics.metrics.track(Event.ToolbarPositionChanged( + Event.ToolbarPositionChanged.Position.BOTTOM + )) + } + } + + private fun setupRadioGroups() { + topPreference.addToRadioGroup(bottomPreference) + bottomPreference.addToRadioGroup(topPreference) + } +} diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index 5bcd59cf2..7cbfcca50 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -8,6 +8,7 @@ import android.app.Application import android.content.Context import android.content.Context.MODE_PRIVATE import android.content.SharedPreferences +import android.view.accessibility.AccessibilityManager import androidx.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting.PRIVATE import mozilla.components.feature.sitepermissions.SitePermissionsRules @@ -198,11 +199,29 @@ class Settings private constructor( true ) + val shouldUseFixedTopToolbar: Boolean + get() { + val accessibilityManager = + appContext.getSystemService(Context.ACCESSIBILITY_SERVICE) as? AccessibilityManager + return accessibilityManager?.isTouchExplorationEnabled ?: false + } + var shouldDeleteBrowsingDataOnQuit by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_delete_browsing_data_on_quit), default = false ) + var shouldUseBottomToolbar by booleanPreference( + appContext.getPreferenceKey(R.string.pref_key_toolbar_bottom), + default = true + ) + + val toolbarSettingString: String + get() = when { + shouldUseBottomToolbar -> appContext.getString(R.string.preference_bottom_toolbar) + else -> appContext.getString(R.string.preference_top_toolbar) + } + fun getDeleteDataOnQuit(type: DeleteBrowsingDataOnQuitType): Boolean = preferences.getBoolean(type.getPreferenceKey(appContext), false) diff --git a/app/src/main/res/layout/component_search.xml b/app/src/main/res/layout/component_bottom_browser_toolbar.xml similarity index 89% rename from app/src/main/res/layout/component_search.xml rename to app/src/main/res/layout/component_bottom_browser_toolbar.xml index a6f1a508d..f1ce15a53 100644 --- a/app/src/main/res/layout/component_search.xml +++ b/app/src/main/res/layout/component_bottom_browser_toolbar.xml @@ -2,7 +2,8 @@ - + + + + + + diff --git a/app/src/main/res/layout/fragment_browser.xml b/app/src/main/res/layout/fragment_browser.xml index 80a9d1fe3..0f6f70d49 100644 --- a/app/src/main/res/layout/fragment_browser.xml +++ b/app/src/main/res/layout/fragment_browser.xml @@ -14,8 +14,7 @@ android:id="@+id/swipeRefresh" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginBottom="@dimen/browser_toolbar_height"> - + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + diff --git a/app/src/main/res/values/preference_keys.xml b/app/src/main/res/values/preference_keys.xml index 46e30ce5d..5da7b3189 100644 --- a/app/src/main/res/values/preference_keys.xml +++ b/app/src/main/res/values/preference_keys.xml @@ -38,6 +38,7 @@ pref_key_account_auth_error pref_key_private_mode pref_key_theme + pref_key_toolbar pref_key_leakcanary pref_key_remote_debugging pref_key_experimentation @@ -91,6 +92,10 @@ pref_key_category_phone_feature pref_key_exceptions_clear_site_permissions + + pref_key_toolbar_top + pref_key_toolbar_bottom + pref_key_light_theme pref_key_dark_theme diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 98762d164..205068335 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -179,6 +179,8 @@ Account Sign in + + Toolbar Theme @@ -316,6 +318,12 @@ Cancel + + + Top + + Bottom + Light @@ -940,7 +948,7 @@ Paste URL copied to clipboard - + Add to Home screen diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 63da0050c..f96fbd6a3 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -50,6 +50,10 @@ android:icon="@drawable/ic_internet" android:key="@string/pref_key_make_default_browser" android:title="@string/preferences_set_as_default_browser" /> + + + + + + + diff --git a/docs/metrics.md b/docs/metrics.md index 8523c5a08..6fa313a8a 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -149,6 +149,7 @@ The following metrics are added to the ping: | sync_auth.sign_up |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |User registered a new Firefox Account, and was signed into it |[1](https://github.com/mozilla-mobile/fenix/pull/4931#issuecomment-529740300)||2020-03-01 | | tab.media_pause |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the pause icon on a tab from the home screen |[1](https://github.com/mozilla-mobile/fenix/pull/5266)||2020-03-01 | | tab.media_play |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the play icon on a tab from the home screen |[1](https://github.com/mozilla-mobile/fenix/pull/5266)||2020-03-01 | +| toolbar_settings.changed_position |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user selected a new position for the toolbar |[1](https://github.com/mozilla-mobile/fenix/pull/6608)|
  • position: A string that indicates the new position of the toolbar TOP or BOTTOM
|2020-03-01 | | tracking_protection.etp_setting_changed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user changed their tracking protection level setting to either strict or standard. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188)|
  • etp_setting: The new setting for ETP: strict, standard
|2020-03-01 | | tracking_protection.etp_settings |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened tracking protection settings through settings. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188)||2020-03-01 | | tracking_protection.etp_shield |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the tracking protection shield icon in toolbar. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188)||2020-03-01 | @@ -169,6 +170,7 @@ The following metrics are added to the ping: | metrics.default_moz_browser |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The name of the default browser on device if and only if it's a Mozilla owned product |[1](https://github.com/mozilla-mobile/fenix/pull/1953/), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-03-01 | | metrics.mozilla_products |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |A list of all the Mozilla products installed on device. We currently scan for: Firefox, Firefox Beta, Firefox Aurora, Firefox Nightly, Firefox Fdroid, Firefox Lite, Reference Browser, Reference Browser Debug, Fenix, Focus, and Lockwise. |[1](https://github.com/mozilla-mobile/fenix/pull/1953/), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-03-01 | | metrics.search_count |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |The labels for this counter are `.`. If the search engine is bundled with Fenix `search-engine-name` will be the name of the search engine. If it's a custom search engine (defined: https://github.com/mozilla-mobile/fenix/issues/1607) the value will be `custom`. `source` will either be `action` or `suggestion` |[1](https://github.com/mozilla-mobile/fenix/pull/1677), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-03-01 | +| metrics.toolbar_position |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A string that indicates the new position of the toolbar TOP or BOTTOM |[1](https://github.com/mozilla-mobile/fenix/pull/6608)||2020-03-01 | | metrics.total_uri_count |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A counter of URIs visited by the user in the current session, including page reloads. This does not include background page requests and URIs from embedded pages or private browsing. |[1](https://github.com/mozilla-mobile/fenix/pull/6003)||2020-03-01 | | search.default_engine.code |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |If the search engine is pre-loaded with Fenix this value will be the search engine identifier. If it's a custom search engine (defined: https://github.com/mozilla-mobile/fenix/issues/1607) the value will be "custom" |[1](https://github.com/mozilla-mobile/fenix/pull/1606), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-03-01 | | search.default_engine.name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |If the search engine is pre-loaded with Fenix this value will be the search engine name. If it's a custom search engine (defined: https://github.com/mozilla-mobile/fenix/issues/1607) the value will be "custom" |[1](https://github.com/mozilla-mobile/fenix/pull/1606), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-03-01 |