Commit Graph

354 Commits (990bfa7e6dd5894d61473a41da6129e6947974e2)

Author SHA1 Message Date
MarcLeclair 990bfa7e6d
16900 make navgraph inflation asynchronous (#18889)
* For #16900: implement async navgraph inflation

For #16900: removed nav graph from xml

For #16900: inflate navGraph programatically

For #16900: Made NavGraph inflation asynchronous

For #16900: Changed to block with runBlocking

For #16900: Refactored blocking call into a function

For 16900: NavGraph inflation is now async

We now attach the nav graph (or check if its attached) on every nav call ( an extension function for NavController).
This is done by checking the value of the job stored in PerfNavController.map which keeps track of the job with the NavController as a Key.
If the job hasn't been completed, it will block the main thread until the job is done. The job itself is responsible for attaching the navgraph
to the navcontroller (and the inflation of the latter too)

For 16900: rebased upstream master

For 16900: Rebase on master

For #16900: Fixed Async Navgraph navigation per review comments.

1)The Asynchronous method is now found in NavGraphProvider.kt. It creates a job on the IO dispatcher
2)The Job is tracked through a WeakHashMap from Controller --> NavGraph
3)The Coroutine scope doesn't use MainScope() anymore
4)The Coroutine is cancelled if the Activity is destroyed
5)The tests mockk the blockForNavGraphInflation method through the FenixReoboelectricTestApplication instead of calling the mock every setup()

For #16900: inflateNavGraphAsync now takes navController

For #16900: Pass lifecycleScope to NavGraphProvider

For #16900: removed unused mock

For #16900: Added linter rules for navigate calls

We need linting rules to make sure no one calls the NavController.navigate() methods

For #16900: Added TestRule to help abstract the mocks in the code

For 16900: Fix linting problems

For #16900: Cleaned duplicated code in tests

For #16900: cleaned up NavGraphTestRule for finished test

For #16900: had to revert an accidentally edited file

For #16900: rebased master

* For #16900: Review nits for async navgraph

This is composed of squash commits, the original messages can be found below:

-> DisableNavGraphProviderAssertionRule + kdoc.

Use test rule in RobolectricApplication.

Fix failing CrashReporterControllerTest

Fix blame by -> navigate in tests.

This commit was generated by the following commands only:
```
find app/src/test -type f -exec sed -i '' "/import org.mozilla.fenix.ext.navigateBlockingForAsyncNavGraph/d" {} \;
find app/src/test -type f -exec sed -i "" "s/navigateBlockingForAsyncNavGraph/navigate/g" {} \;
git checkout app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
```

Fix various blame

This is expected to be squashed into the first commit so, if so, it'd
fix the blame.

Move test rule to helpers pkg.

add missing license header

Add import change I missed

fix unused imports

Replace robolectricTestrunner with test rule.

Improve navGraphProvider docs

Remove unnecessary rule as defined by robolectric.

add clarifying comment to robolectric

remove unnecessary space

* For #16900: nit fixes for MozillaNavigateCheck and lint fixes

3 squash commits:
 *Changed violation message and fixed the lint rule for MozillaNavigateCheck
 *Added suppression to NavController.kt
 *Fixed detekt violations

* For 16900: Fixed failing tests

Co-authored-by: Michael Comella <michael.l.comella@gmail.com>
3 years ago
Elise Richards 761d6babb9
For #18806: Show sync tabs or sync account sign in based on feature flag (#18859)
* Show sync tabs or sync account sign in based on feature flag. Sign in navigates to account settings on click.

* lint and nits
3 years ago
Arturo Mejia fc1739624d For #18608 only show the experiment for set default browser MenuItem when Nightly, Beta, Release are not the default browser 3 years ago
Sören Hentzschel 51df37cde5
For #18898 - implement quit button in page menu (#18942) 3 years ago
mcarare c30d0f9240 For #18829: Adjust bookmark item color to UX specs. 3 years ago
Arturo Mejia db9b3676d3 For #18608 Add experiment for set default browser MenuItem. 3 years ago
Elise Richards e5e9ceba5a
Settings menu item should be tinted if there is an account issue (#18849) 3 years ago
Elise Richards ba111dabaa
PWA install to homescreen is available in main menu (#18850) 3 years ago
Elise Richards 547a843c5c
For #18770 - Correct addons position in three dot menu based on toolbar position (#18828) 3 years ago
Kate Glazko 841dacb69e For 17798: Sync Menu Item 3 years ago
Gabriel Luong 1f320fd2ad
No issue - Remove generic strings for more specificity (#18769) 3 years ago
Mugurell 0f0c319896 For #17772 - Collapse browser menu to "Add to Home screen"
The menu will start as collapsed.
Users can then swipe up to expand it.
3 years ago
Gabriel Luong 3f21a63c3c
For #18729 - Use consistent string naming for generic strings (#18730) 3 years ago
Elise Richards ca33aef036
For #17770: New tab three-dot menu reorder (#18427)
* Create new menu order for new tab

* Add new tab menu navigation. Dynamically update menu when sync auth is needed. Make new tab menu and browser menu consistent.

* Lint

Lint and refactoring tests

* Tests for default toolbar menu

* Feature flag for request desktop site

Add todos for UI test issue 17979

Add todos for UI tests
3 years ago
mcarare 6f17e329c4 For #17797: Add bookmarks menu item. 3 years ago
Roger Yang a8c53c6bf1
Closes #17791: Use updated URL with custom tabs when copying to clipboard (#18590) 3 years ago
mcarare d0a45bab21 For #17799: Add extensions submenu item. 3 years ago
Elise Richards b15c3ff864
Add open in app to main three dot menu (#18462) 3 years ago
Elise Richards f5a1a01e06 Remove sync sign in and keep it as synced tabs 3 years ago
Elise Richards d34848a5d9 Add report site issue to new three dot menu 3 years ago
Elise Richards 4b84503813 Remove disabled color for icons 3 years ago
Mihai Adrian Carare 5c7a01ba6f
For #17971: Add Reader view appearance controls in three-dot main menu. (#18340) 3 years ago
Elise Richards 42cc4cb452
For #17802: Match the design for three-dot menu navigation (#17875)
* Feature flag for toolbar menu redesign. Add new items to menu and reorder.

* Handle toolbar items in menu controller

* Remove bookmark from toolbar nav

* Respect toolbar position

* Inline toolbar orientation checks

* Add Todos for bookmark UI tests

* Make variable names consistent
3 years ago
Mugurell cf483ef580 For #18034 - Don't animate the toolbar while the tab is loading
Use the new controller offered by AC to resolve some browser layout issues and
also offer an experience consistent with that of other browsers.
3 years ago
Mugurell 0a0f75d2ab For #18027 - Also fix the bottom toolbar in place when a11y is enabled
We previously only set the top toolbar as fixed if an a11y service was running.
3 years ago
Jonathan Almeida 2f6fcbf196 Close #13892: Remove Synced Tabs appended to tabs tray 3 years ago
Mugurell 6e0a64897b For #17899 - Expand toolbar when returning from fullscreen video
This was the previous behavior for both the top and bottom toolbars.
Regressed when changing to use a new custom behavior for the top toolbar.

When entering fullscreen we will now collapse and hide the toolbar, allow the
browser to expand to the entire screen estate and then, when exiting fullscreen
expand the toolbar.
Collapsing and then expanding the toolbar will trigger the
EngineViewBrowserToolbarBehavior to place the browser below the toolbar.
3 years ago
Christian Sadilek 2d87307144 Remove remaining usages of Session[Manager] in BrowserFragment 3 years ago
Christian Sadilek c9b8f57f96 Refactor BrowserToolbarMenuController to use browser store 3 years ago
Christian Sadilek 5a5cf9cd12 Refactor BrowserToolbarController to use browser store 3 years ago
Elise Richards d0fd3e82c5
For #17771: three-dot menu reorder (#17838)
* Feature flag for toolbar menu redesign. Add new items to menu and reorder.

* Handle toolbar items in menu controller

* Menu controller tests

* Make icons invisible

* Lint

* UI tests reflect design change

* Refactor test names

* Lint fixes

* UI tests
3 years ago
Sebastian Kaspari a3b556aa35 ToolbarIntegration: Use global public suffix list instance. 3 years ago
Mugurell 8bf1cae2ca For #10686 - Use the AC custom behavior for both the top and bottom toolbars
This comes to unify the experience (with improvements but also specific issues)
for the url toolbar irrespective of it being placed at the bottom or at the top
Going further this will ease development and ensure the best UX for users.
3 years ago
Roger Yang d434ff13a5
For #17092: Dismiss toolbar menu when configuration change occurs (#17682) 3 years ago
Arturo Mejia f99c175ceb Remove autoplay indicator FeatureFlags 3 years ago
Arturo Mejia 570383a54d Add dot notification for autoplay blocked content 3 years ago
Jonathan Almeida d3dcf69064 A-C 71.0.20210118134928: Fix breaking API in TabCounterToolbarButton 3 years ago
Sebastian Kaspari 051988ecff Migrate some "selected tab" reads from SessionManager to BrowserStore. 3 years ago
Arturo Mejia f263b7333a For issue #16847 Show the autoplay icon in the toolbar 4 years ago
mcarare 0a77f4bccf For #16775: Fallback to light mode drawable when ui mode is not resolved 4 years ago
Christian Sadilek d1345e8f93 Closes #11290: Refactor ToolbarMenu to use browser store 4 years ago
Sebastian Kaspari 2cada405d8 Update Android Components to 69.0.20201207103252. 4 years ago
Elise Richards 77f061c362 Closes #8791: Use A-C tab counter and upgrades to A-C 69.0.20201203202830
Upgrades to A-C 69.0.20201203202830 and addresses breaking changes:
- Upgrades androidx workmanager to 2.4.0 in line with A-C.
- RecordingDevicesNotificationFeature was removed
- SearchUseCases accept parent session ID instead of session itself
4 years ago
Sebastian Kaspari 788a8309c2 Issue #16435: Open custom tab in Fenix: Force launch outside of and remove current task. 4 years ago
ekager d49d710343 For #16676 - Do not switch mode on last private tab via tab context menu 4 years ago
Christian Sadilek 88f3f3564e Issue #16587: Make sure tab counter correctly reflects private/normal tab counts 4 years ago
Christian Sadilek fbbc25b54e Closes #16053: Fix crash when closing private tabs via notification 4 years ago
LeoMaldonado a06b30a73d Fixes Comment on #16563: DefaultToolbarMenu registering for bookmark changes
comment link: https://github.com/mozilla-mobile/fenix/pull/16536#discussion_r522387945
4 years ago
LeoMaldonado 2d8fe7a9ad Closes #16345: Update share icon shape
updating share icon to a filled shape, like default toolbar menu across all app
4 years ago
LeoMaldonado 84eda3d38f For #16345: use same share icon across all app
replace mozac_ic_share for ic_hollow_share on DefaultToolbarMenu
4 years ago