Commit Graph

27 Commits (74c1cc82fb4975f63c20a718f09367149bcc3c70)

Author SHA1 Message Date
Roger Yang 74c1cc82fb Closes #19921: Update appcompat and fragment dependencies to 1.3.x 3 years ago
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
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
Jeff Boek c632b6b0a1
For #15007 - Puts swipe to delete behind a feature flag (#15009) 4 years ago
Kainalu Hagiwara 6d8cfe1a50 For #13156, #13280 - Use payloads to bind bookmark viewholders.
Change the DiffUtil callback for bookmarks to use the generated equals()
method instead of only checking the title and url fields. This prevents
the BookmarkNode in our state from getting out of sync with the
BookmarkNode the viewholder is bound to.
4 years ago
ankur dd5bb94f8c For #13301, #13038: hide overflow menu for all bookmark items in selected mode 4 years ago
Kainalu Hagiwara 30c7b5ea5e For #12831 - Disable SwipeRefreshLayout while swiping a bookmark. 4 years ago
Kainalu Hagiwara 5318d64911 For #12906 - Fix swipe-to-delete bookmark folder. 4 years ago
Kainalu Hagiwara cd2532349d For #12551 - Implement swipe to delete for bookmarks. 4 years ago
ValentinTimisica 9f5c8819d3 For #11892: Remove dynamic calls to setupNavigationToolbar
This is a speculative fix for 11892 crash.
The side effect is that the back button will be visible in bookmarks root.
4 years ago
person808 ad90625b48 For #2165 - Add swipe to refresh gesture to bookmarks view. 4 years ago
Hakkı Kaan Çalışkan c8d36ddc36 For #8649: No bookmarks here strings are close to the top 4 years ago
ValentinTimisica c75ab3f720
For #10462: Removes back button from bookmarks and history fragments (#11721) 4 years ago
David Walsh 26137f63a2
Prevent favicons from flashing when items are selected in History (#9233) 4 years ago
Afzal Najam b9656a978e Hide add folder option when in Desktop Bookmarks folder 4 years ago
Jeff Boek 1b1f9348dc No Issue - Fixes warnings / compiler errors with A-C update 5 years ago
mcarare f6a66562dd For #4487 Set activity title only once in Bookmark fragment
Removed label from nav_graph that caused label to be set for each navigation
Removed title setting in onCreate() called for each navigation
Changed logic for checking current root when setting UI for normal mode
5 years ago
Severin Rudie fbdd537bc7 Closes #4513: show progress bar when loading bookmarks 5 years ago
Mihai Adrian c8bc144114 For #2570: Hide 3-dots menu when in select mode for bookmarks and history (#5173)
Show or hide overflow menu for entire list is triggered when mode is changed
For bookmarks, due to implementation of selection and diffUtil,
additional check is necessary for current item (last selected) that is redrawn
5 years ago
Sebastian Kaspari 76063e307a Rename BookmarkStore/State/Action to BookmarkFragmentStore/State/Action. 5 years ago
Mugurell 645674c9bd Closes #4396 - Add a Bookmarks Controller (#4593)
* For #4396 - Rename BookmarkInteractor methods

Following the naming model used in other Interactors this too will use reactive
method names in the form of "on..." instead of the previous imperative model.

Kept the imperative naming model for the methods from `SelectionInteractor` as
they are a new addition and I'm not sure about the future direction.

* For #4396 - Add a BookmarkController

It abstracts the Fragment behavior in a contract through which various
Interactors can inform about the specific View changes and can ask for
modifications in their container Fragment.

This contract and it's implementation - `DefaultBookmarkController` are the
result of extracting the container Fragment's business logic from
`BookmarkFragmentInteractor` in it's own standalone component.

* For #4396 - Refactored Bookmark related tests

Added a new `BookmarkControllerTest` tests class which complements the new
`BookmarkController` to ensure that it properly operates on `BookmarkFragment`

Also refactored the existing `BookmarkFragmentInteractorTest` to accommodate
`BookmarkFragmentInteractor`'s now more specialized behavior.
5 years ago
Tiger Oakes 3c1ce90f6f Fixes #2379 - Generic library selection 5 years ago
Tiger Oakes c342a680d8 Fix crash for bookmarks 5 years ago
Tiger Oakes ccae66c08a Issue #2379 - Use LibraryPageView in history 5 years ago
Tiger Oakes c2e6e25bef Fixes #4005 - Move getColorFromAttr to Context 5 years ago
Colin Lee 3dc20543e3
For #4128: Migrate Bookmarks to LibState (#4254) 5 years ago