From 2f1b903005c93f56c1d99618cf09b9eedd6750eb Mon Sep 17 00:00:00 2001 From: mcarare Date: Fri, 28 Aug 2020 16:15:05 +0300 Subject: [PATCH 01/28] For #14289: Check if toolbar is initialised before setting flags. --- .../java/org/mozilla/fenix/browser/BaseBrowserFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 61372d2ac..41f90d6f2 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -1162,6 +1162,8 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session } override fun onAccessibilityStateChanged(enabled: Boolean) { - browserToolbarView.setScrollFlags(enabled) + if (_browserToolbarView != null) { + browserToolbarView.setScrollFlags(enabled) + } } } From dcb99856f93f09cc5445a57ef6a6078748f1173f Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Mon, 31 Aug 2020 11:14:37 -0400 Subject: [PATCH 02/28] For #13264 - Scroll to the tab above the selected tab in the tabs tray (#14372) --- app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt index 4963c044e..b45b9332b 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt @@ -543,9 +543,11 @@ class TabTrayView( // We offset the tab index by the number of items in the other adapters. // We add the offset, because the layoutManager is initialized with `reverseLayout`. + // We also add 1 to display the tab item above the selected browser tab. val recyclerViewIndex = selectedBrowserTabIndex + collectionsButtonAdapter.itemCount + - syncedTabsController.adapter.itemCount + syncedTabsController.adapter.itemCount + + 1 layoutManager?.scrollToPosition(recyclerViewIndex) } From 8f71704c1f4aa2e4cf94ae2c0ba42b16226759ec Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 31 Aug 2020 12:39:39 -0400 Subject: [PATCH 03/28] Fix a typo in metric expiry. (#14530) This was changed to 2020-04-01 in b01dbeeebf2b54dabbb1b60916bee4ec2c837b5f I assume this was just a typo, since a lot of metrics got changed to 2021-04-01 in the same commit. --- app/metrics.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index 202d3face..46572d058 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -3284,7 +3284,7 @@ app_theme: - interaction notification_emails: - fenix-core@mozilla.com - expires: "2020-04-01" + expires: "2021-04-01" pocket: pocket_top_site_clicked: From 1e7faa693fcb87fdac6e3432cde7eacb180cd62b Mon Sep 17 00:00:00 2001 From: Oana Horvath Date: Mon, 31 Aug 2020 15:55:58 +0300 Subject: [PATCH 04/28] Closes #14522: item 'Open link in apps' moved --- .../org/mozilla/fenix/ui/SettingsAdvancedTest.kt | 2 ++ .../org/mozilla/fenix/ui/SettingsPrivacyTest.kt | 4 ---- .../org/mozilla/fenix/ui/robots/SettingsRobot.kt | 13 +++++++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt index c0a87fe13..381cc9862 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt @@ -52,6 +52,8 @@ class SettingsAdvancedTest { // ADVANCED verifyAdvancedHeading() verifyAddons() + verifyOpenLinksInAppsButton() + verifyOpenLinksInAppsSwitchDefault() verifyRemoteDebug() verifyLeakCanaryButton() } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt index a963f5c51..a61808773 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt @@ -147,10 +147,6 @@ class SettingsPrivacyTest { verifyNavigationToolBarHeader() verifyDataCollectionSubMenuItems() }.goBack { - - // OPEN LINKS IN APPS - verifyOpenLinksInAppsButton() - verifyOpenLinksInAppsSwitchDefault() }.goBack { verifyHomeComponent() } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt index 073148cde..5976ed4ac 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt @@ -345,11 +345,16 @@ private fun assertDataCollectionButton() = onView(withText("Data collection")) private fun openLinksInAppsButton() = onView(withText("Open links in apps")) -private fun assertOpenLinksInAppsButton() = openLinksInAppsButton() - .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) +private fun assertOpenLinksInAppsButton() { + scrollToElementByText("Open links in apps") + openLinksInAppsButton() + .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) +} -private fun assertOpenLinksInAppsValue() = openLinksInAppsButton() - .assertIsEnabled(isEnabled = true) +private fun assertOpenLinksInAppsValue() { + scrollToElementByText("Open links in apps") + openLinksInAppsButton().assertIsEnabled(isEnabled = true) +} // DEVELOPER TOOLS SECTION private fun assertDeveloperToolsHeading() { From 4a00131fa15bdf8d1144e25642a318377b2fa797 Mon Sep 17 00:00:00 2001 From: Oana Horvath Date: Mon, 31 Aug 2020 16:31:29 +0300 Subject: [PATCH 05/28] Closes #13218: adds IdlingResources for the Addons list --- .../org/mozilla/fenix/ui/SettingsAddonsTest.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt index 7dd20c944..4c6f93a8a 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt @@ -1,5 +1,6 @@ package org.mozilla.fenix.ui +import androidx.test.espresso.IdlingRegistry import org.mozilla.fenix.helpers.TestAssetHelper /* This Source Code Form is subject to the terms of the Mozilla Public @@ -11,8 +12,10 @@ import org.junit.Rule import org.junit.Before import org.junit.After import org.junit.Test +import org.mozilla.fenix.R import org.mozilla.fenix.helpers.AndroidAssetDispatcher import org.mozilla.fenix.helpers.HomeActivityTestRule +import org.mozilla.fenix.helpers.RecyclerViewIdlingResource import org.mozilla.fenix.ui.robots.homeScreen import org.mozilla.fenix.ui.robots.navigationToolbar @@ -25,6 +28,7 @@ class SettingsAddonsTest { /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. private lateinit var mockWebServer: MockWebServer + private var addonsListIdlingResource: RecyclerViewIdlingResource? = null @get:Rule val activityTestRule = HomeActivityTestRule() @@ -40,6 +44,10 @@ class SettingsAddonsTest { @After fun tearDown() { mockWebServer.shutdown() + + if (addonsListIdlingResource != null) { + IdlingRegistry.getInstance().unregister(addonsListIdlingResource!!) + } } // Walks through settings add-ons menu to ensure all items are present @@ -51,6 +59,9 @@ class SettingsAddonsTest { verifyAdvancedHeading() verifyAddons() }.openAddonsManagerMenu { + addonsListIdlingResource = + RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.add_ons_list), 1) + IdlingRegistry.getInstance().register(addonsListIdlingResource!!) verifyAddonsItems() } } @@ -65,6 +76,9 @@ class SettingsAddonsTest { }.openNewTabAndEnterToBrowser(defaultWebPage.url) { }.openThreeDotMenu { }.openAddonsManagerMenu { + addonsListIdlingResource = + RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.add_ons_list), 1) + IdlingRegistry.getInstance().register(addonsListIdlingResource!!) clickInstallAddon(addonName) verifyAddonPrompt(addonName) cancelInstallAddon() @@ -85,6 +99,9 @@ class SettingsAddonsTest { verifyAdvancedHeading() verifyAddons() }.openAddonsManagerMenu { + addonsListIdlingResource = + RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.add_ons_list), 1) + IdlingRegistry.getInstance().register(addonsListIdlingResource!!) clickInstallAddon(addonName) acceptInstallAddon() verifyDownloadAddonPrompt(addonName, activityTestRule) From cfd799a6af1b0d9b5ac92f23f3f9af6231488578 Mon Sep 17 00:00:00 2001 From: Codrut Topliceanu <60002907+codrut-topliceanu@users.noreply.github.com> Date: Mon, 31 Aug 2020 20:13:27 +0300 Subject: [PATCH 06/28] For #13765 - Fix TopSites layout and item sizes (#14278) --- .../main/res/layout/component_top_sites.xml | 32 ++++++++++++------- app/src/main/res/layout/top_site_item.xml | 14 ++++---- app/src/main/res/values/dimens.xml | 7 ++++ app/src/main/res/values/styles.xml | 8 +++++ 4 files changed, 44 insertions(+), 17 deletions(-) diff --git a/app/src/main/res/layout/component_top_sites.xml b/app/src/main/res/layout/component_top_sites.xml index b9e0861f8..41f5a29b7 100644 --- a/app/src/main/res/layout/component_top_sites.xml +++ b/app/src/main/res/layout/component_top_sites.xml @@ -3,18 +3,28 @@ - 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/. --> - + + android:gravity="center_horizontal"> + + + diff --git a/app/src/main/res/layout/top_site_item.xml b/app/src/main/res/layout/top_site_item.xml index 80303aa69..84c926480 100644 --- a/app/src/main/res/layout/top_site_item.xml +++ b/app/src/main/res/layout/top_site_item.xml @@ -5,25 +5,27 @@ + + android:layout_marginTop="@dimen/top_sites_text_margin_top" /> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 6c01291ef..7a493a52c 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -169,6 +169,13 @@ 16dp 48dp + + 40dp + 4dp + 64dp + 12dp + 8dp + 48dp diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index cc7d78fb7..163e64e1c 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -622,6 +622,14 @@ 0.4 + +