Commit Graph

175 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
Jonathan Almeida 22e7410e4a Issue #18931: Move dialog adapter to collections package 3 years ago
Jonathan Almeida f1e7c1130b Issue #18931: Rename class to CollectionsListAdapter 3 years ago
Jonathan Almeida 9078139e40 Close #18774: Migrate mutli-selection to store
Removes the recyclerview-selection library and replaces it with the
SelectionHolder/SelectionInteractor with a Store.

This is an implementation that's similar to what we have in other UI
lists (library).
3 years ago
Jonathan Almeida 9ce4adaa32 Close #18443: Use recyclerview-selection for multi-select mode in tray
Add multi-select mode to the BrowserTabsAdapter. It has the
functionality to:
 - Enable multi-select mode on long-press.
 - Enable multi-select mode when changed by an external function.
 - Only works for normal tabs (as we currently have it).

Co-authored-by: "codrut.topliceanu" <codrut.topliceanu@softvision.ro>
3 years ago
Jonathan Almeida 05aa948dc7 Issue #17822: Create a tabs tray layout and fragment
Co-authored-by: Kate Glazko <kglazko@Kates-MacBook-Pro.local>
3 years ago
Vitaly V. Pinchuk 8f5244d528
Closes #18150: select tabs button not displayed (#18216)
For #18150: Improve showing/hiding of "Select tabs" button in tabs tray

Payload argument is unavailable after first call of notifyItemChanged() as the
whole View need to be updated.
Inject a "isPrivate" lambda in the adapter so it will always know what tabs are
currently showing and so always ensure the expected behavior.
3 years ago
Arturo Mejia 0e8dc6164d Target Android 11 3 years ago
Jonathan Almeida 2f6fcbf196 Close #13892: Remove Synced Tabs appended to tabs tray 3 years ago
mcarare af9c32983f For #17807: Fix systemWindowInset deprecation. 3 years ago
Mugurell 3311e68d14 For #17686 - Use a custom behavior to scroll InfoBanner with the top toolbar
Previously when the toolbar was on top the banner was inflated in the toolbar's parent - an AppBarLayout.
After migrating to use a custom behavior for scrolling the toolbar and not use
anymore the AppbarLayout for this we needed a new solution.
Using a new behavior to keep this banner in sync with the y translation of the
toolbar gives us most of the old behavior back.
3 years ago
Roger Yang 993cf74e72
Closes #17174: Remove the New Media Session API Feature Flag (#17863) 3 years ago
ekager f5b068a453 For #17785 - Use screenshots setting when adding secure flag 3 years ago
Sebastian Kaspari f4a7b4c066 Remove TabsUseCases methods that take a Session object. 3 years ago
Elise Richards f7b7b25213
For #16485: Tabs tray grid view telemetry (#17442)
* Tabs tray CFR telemetry interactions

* Create CFR events and implementation

* Tests for tab tray controller
3 years ago
Christian Sadilek c34d68d915 Closes #17548: Remove SessionManager reference from TabTrayDialogFragment 3 years ago
Christian Sadilek 7358a313bf Issue #17548: Remove SessionManager reference from FenixTabsAdapter 3 years ago
Sebastian Kaspari d2b8decaeb Switch to new feature-tab-collections API. 4 years ago
mcarare 93b13ac977 For #15369: Add synced tabs usage metrics. 4 years ago
mcarare 2f360eb474 For #15366: Add recently closed tabs metrics. 4 years ago
Elise Richards 813693f1d3
Remove hidden fab in tabs tray (#16972) 4 years ago
Mugurell f2191bdbb5 For #13427 - Disable the "selected tab" decoration when in Multiselect
Selecting a tab while in Multiselect would add a different decoration to the one
already set for the last tab opened and this would confuse users.
Let's avoid this.
4 years ago
Roger Yang 2ff7ba75c7
Closes #16896: Integrate new MediaSession API to nightly or debug builds (#16909) 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
Codrut Topliceanu 79d1c08402
For #16629 - Fix for collection snackbar View button (#16679) 4 years ago
mcarare 0bd3654bc7 For #16759: Prevent crash on showing info banner. 4 years ago
Mihai Adrian Carare 34b4dad614
For #16735 - Do not show grid view CFR if grid view is already selected. (#16740) 4 years ago
Codrut Topliceanu 4b56aeb12f
For #16592 - Fix missing collection snackbar for a11y (#16593)
Set null anchor for snackbar when using a11y services
4 years ago
Mugurell ef5846dc3e
For #16614 - Ensure a stable order for the items in tabs tray. (#16618)
Items should follow the following ordering:
- current session open tabs
- collections options - currently the "Select tabs" button
- synced tabs items

This order should also be kept after returning from Multiselect mode.
4 years ago
Bryan Kok 5f9de1e261 Replace @string/tab_tray_menu_item_save with @string/tab_tray_menu_select, Remove "Share all tabs" option from tab tray's private browsing menu 4 years ago
Mihai Adrian Carare 85dd2f8313
For #16511 - Change a11y parent of button without breaking the tab list. (#16555) 4 years ago
mcarare d45bdfb0f4 For #16477: Switch to using an extension to update a11y collection info. 4 years ago
mcarare e2322a18f9 For #16477: Migrate updateAccessibilityCollectionItemInfo to extension. 4 years ago
mcarare b52f069573 For #16477: Update a11y info to collection item for both grid and list. 4 years ago
Mugurell c6de8632de
For #16461 - Ensure the proper items order after exiting Multiselect (#16482) 4 years ago
Gabriel Luong 27ee2ba4f6
For #15761 - [Grid View] Enable the grid view and remove its feature flag (#16546)
* For #15761 - Part 1: Turn ON the showGridViewInTabsSettings feature flag

* For #15761 - Part 2: Remove the showGridViewInTabsSettings feature flag and show the Tab view preference category
4 years ago
ekager 1ed9ebf622 For #16132 - Rename normal mode menu item, remove telemetry 4 years ago
Gabriel Luong ebadbdb352
For #14920 - Show a Tabs Tray CFR Banner for grid view tip (#16466) 4 years ago
Codrut Topliceanu f3edce5f16
For #11376 - Reverse tabs list order (#16245) 4 years ago
mcarare c427ebf8d5 For #16416: Remove save to collection button from tab a11y list. 4 years ago
ekager a8db85fc22 For #16132 - Revise multiselect mode UI 4 years ago
Mugurell 5e58377948
For #16424 - Focus the right item in tabs tray when using Talkback (#16472)
To get the index of the current selected browser tab when using reverse layout
we should also account for items placed below of the browser tabs.
The patch here unifies the logic already used for some calls but not all.
4 years ago
Mugurell 172977f698
For #14980 - Effectively disable tabs tray STATE_HALF_EXPANDED (#16052)
STATE_HALF_EXPANDED cannot be disabled while also keeping fitToContents = true
based on which the tabs tray layout is currently set.
To work around this we'll set a a minuscule height for the tab tray when in
this state and then immediately advance to STATE_HIDDEN so to make it
imperceptible to the users.
Since I couldn't write unit tests because of InflateExceptions in Robolectric
I've written UI tests to protect against regressions.
4 years ago
Rafał Opiłowski 96fb9f4676
For #12971 - Show collection saved snackbar above FAB (#16311) 4 years ago
ekager bd2c407943 For #4652 - Remove activityViewModels workarounds 4 years ago
Mugurell a6092c34cc For #15963 - Increase touch target for the close button in the tabs tray grid layout
We need to ensure it has at least 48dp while also not appearing too big.
4 years ago
Mugurell 83bd80c873 For #15757 - Avoid the double spacing issues for grid items in tabs tray
Items should have a 16dp all around padding.
Have them have a 8dp padding that will add to 16 when placed together.
Have the parent have another 8dp that will add to 16 for when items are placed
to the edge of the available screen.
4 years ago
Mugurell 0324baef03 For #15968 - Show a border for the selected tab in the grid based tabs tray
The border for the grid item will now be updated in the same method that
updates the background for the list item.
4 years ago
Mugurell 358ca2c87f
For #15543 - Adjust the height of the tabs tray depending on the number of tabs (#15749) 4 years ago
mcarare 1a10215caf For #14619: Show half a tab top offset when scrolling to selected tab. 4 years ago