Commit Graph

380 Commits (c667cfa0aed57854f5a67c9a9be89810c338096b)

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 499aa858b2 Issue #18774: Move SelectionInteractor to new package
The interactor and holder are useful outside of the `library` package, so
let's move it up a package level for other components.
3 years ago
Roger Yang 9049513017
Closes #18178: Rework History Telemetry (#18261) 3 years ago
Codrut Topliceanu ec54397637
For #17352 - Fixes deleted downloads reappearing (#17930)
* For #17352 - Fixes deleted downloads reappearing

The `getDeleteDownloadItemsOperation` job would check fragment context not null after the fragment was stopped. Removing that check and only passing the downloadUseCase as a parameter fixes the problem.
3 years ago
Grisha Kruglov 3ce9bf93bc Exclude separators from the bookmarks UI 3 years ago
Christian Sadilek eb4beb252f Remove unused SessionManager reference from RecentlyClosedController 3 years ago
Sebastian Kaspari 0761f391fc Update to latest feature-intent and feature-recentlyclosed APIs (and update Android Components). 3 years ago
Mihai Adrian Carare 3bb074b133
For #13522: Also remove history entries from tab history. (#17392)
* For #13522: Also remove history entries from tab history.

* For #13522: Test that deleting history also removes it from tab history.
3 years ago
ekager 30df43d057
For #13321 - Do not hide toolbar when opening multiple bookmarks (#17038) 4 years ago
mcarare d233229ce4 For #15366: Add recently closed tabs metrics from history fragment. 4 years ago
Mugurell 574eac4636
For #15367 - DownloadsFragment telemetry (#16728)
Adds a counter for how many times the user does the following action:
- opens the Downloads section inside the app
- tap to open an item from inside Downloads / from the download dialog
- tap to delete one or more downloads at once
4 years ago
Kate Glazko ef01cdcefe For #16541: Download UX Updates 4 years ago
Philipp Klein 2be3fd05f2
For #15362: Remove swipe to delete for bookmarks (#16646)
Removed now obsolete feature flag and tests.
Removed obsolete swipe refresh state from BookmarkFragmentState
Also adapted tests and remove obsolete ones.
4 years ago
ekager 614471495d
For #15091 - Fixes RecentlyClosedAdapter DiffCallback (#16608) 4 years ago
Kate Glazko 6c68e79a22 For #14772: Crash in Downloads 4 years ago
Kate Glazko 0ae268914b For #352: Delete a download 4 years ago
ekager c0e01373e1 No issue: Update stable androidx and material versions 4 years ago
ekager bd2c407943 For #4652 - Remove activityViewModels workarounds 4 years ago
Jocelyne Abi Haidar 1b204158e5
For #15931: Sort Downloads from newest to oldest (#15939) 4 years ago
Jocelyne Abi Haidar f514f6099a
For #15508: Show error when trying to save empty or invalid bookmark URL (#15674) 4 years ago
Juan C. Goncalves eb0712d9b4
For #11397 - Add lint rule for AppCompatResources instead of ContextCompat (#16011) 4 years ago
Shen 45e3f7805b For #13168 - Removed the close button from history navigation bar 4 years ago
Sijan Rijal 70908307fc
For #15497: Hide and remove the three dot menu from the Desktop Bookmarks folder (#15649)
For #15497: Remove and disable the three dot menu button
4 years ago
mcarare b696fc4c4b For #13031: Show size in KB for smaller downloaded files. 4 years ago
Jocelyne 0154c81f81
For #10107: Show Today and Yesterday labels in History (#15415) 4 years ago
Jocelyne e74a12b442
For #15471: Show Delete button in red in multi-select overflow menu (#15576) 4 years ago
Grisha Kruglov 51dab196c4 Closes #15443: Use fragment's lifecycleScope for AlertDialog actions 4 years ago
Sebastian Kaspari 4de466883b Revert "For #12565: Pass bookmark storage to controller" for debug test failures.
This reverts commit 3c22100b84.
4 years ago
Tiger Oakes 3c22100b84 For #12565: Pass bookmark storage to controller 4 years ago
Grisha Kruglov f1b0827a0b For #15296: Allow excluding bookmark subtrees when editing parent folder
I'm really not a fan of how title overwriting and structure processing are mangled together,
but will leave clearing that up for another day.
4 years ago
Grisha Kruglov 71b51146cb Update breaking changes in the FxA/Sync integration 4 years ago
Grisha Kruglov f51b570654 For #15284: Process root titles when creating new folders
This also simplifies how we do this. We're no longer creating instances of `DesktopFolder` class
nor creating copies of BookmarkNodes just to display root titles correctly for the 'edit folder' UI.
4 years ago
ekager f16ade33df For #15089 - Disable recently closed in multiselect 4 years ago
ekager b5f1e772bd For #15112 - Still show recently closed when history empty 4 years ago
Grisha Kruglov 5691088787 For #15286: Don't crash when separators are long-touched 4 years ago
Grisha Kruglov b7b3ee5ce6 For #2792: Display bookmark folders at the top of the bookmarks UI 4 years ago
Grisha Kruglov 078843675b For #15211: Make sure bookmarks are moved to the end of folders 4 years ago
Grisha Kruglov 027c1f9ea7 Closes #15206: Only track 'move' event if bookmark parent was changed 4 years ago
Grisha Kruglov b5b32ba6ea For #11502: Make sure to always process root titles for parent folders during edit
This also switches to a simpler bookmarks query API ('getBookmark') which doesn't fetch
children. We don't need 'children' for this dialog, and so don't need to do the extra work.
4 years ago
Grisha Kruglov 958474f9fb For #13157: Filter out folder being edited from 'select folder' dialog 4 years ago
Grisha Kruglov fe288edb5d Rename 'visitedAddBookmark' arg to a less confusing name 4 years ago
Grisha Kruglov 24de85f805 Remove unused nav arg from 'select folder' 4 years ago
Tiger Oakes b563576335
Closes #14131: Move constants to dimens.xml (#14135)
Co-authored-by: Elise Richards <erichards@mozilla.com>
4 years ago
Tiger Oakes b927b688c9 Merge bookmark item and folder view holders 4 years ago
Tiger Oakes 3059a57747 Change separator to use its own view holder 4 years ago
Jeff Boek c632b6b0a1
For #15007 - Puts swipe to delete behind a feature flag (#15009) 4 years ago
ekager 09fbb43f80 For #2486 - Adds Recently Closed Tabs 4 years ago
mcarare 410980fe27 For #11425: Improve editing bookmarks flow. 4 years ago
Tiger Oakes ac2d65cc5e
Replace setPadding with updatePadding (#14137) 4 years ago
kglazko 5ecab0f48a
For #13935: Enhanced File Type List Icons (#14036)
* For #13935: Enhanced File Type List Icons

* For #13935 - Pulls out and tests logic for getting the icon for a DownloadItem

Co-authored-by: Kate Glazko <kglazko@Kates-MacBook-Pro.local>
Co-authored-by: Jeff Boek <jeff@jeffboek.com>
4 years ago