Commit Graph

127 Commits (2380d518081c7e003b8737bfd18af40d414ef8ee)

Author SHA1 Message Date
Roger Yang 79cf3fc765
Closes #18253: Bookmark and History open new tabs in the background (#19275) 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
ekager bd2c407943 For #4652 - Remove activityViewModels workarounds 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
ekager 46511d6f8e For #10163 - Adds tab multiselect mode 4 years ago
Mihai Eduard Badea c3041bcb64 For issue #12387 - Display tab tray using .show
Replaced the global navigation action used for displaying the tab tray with the .show() function.
4 years ago
Mihai-Eduard Badea 1823fdb66d
For issue #9949 - Bookmarks/History deletion inconsistencies (#12630)
- Added the undo action for deleting individual history items by creating a new field to the history state containing the id's of the history items that are pending for deletion; This field is used inside the update function from the view to show/hide the items.

 - Added a new check inside the "deleteMulti" method from BookmarkFragment that calls the showRemoveFoldersDialog to prevent the user from being able to delete one or more bookmark folders without being asked for confirmation, as in #8648.

Co-authored-by: Mihai Eduard Badea <mihai.badea@softvision.ro>
4 years ago
Tiger Oakes c99a8f5cfa
Fixes #9832 - Change targetSdkVersion to Android 10 (#11014) 4 years ago
Tiger Oakes 1ab5fe3eb9
Add method to test fragments in roboletric (#12261) 4 years ago
David Walsh c4a4beb6b9 For 11468 - Show tab tray after opening links from history and bookmarks 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
Emily Kager 44ff29bdc0 Revert "For issue #9949 - Bookmarks/History deletion inconsistencies"
This reverts commit 3feab90b19.
4 years ago
David Walsh 3feab90b19 For issue #9949 - Bookmarks/History deletion inconsistencies
- Added the undo action for deleting individual history items by creating a new field to the history state containing the id's of the history items that are pending for deletion; This field is used inside the update function from the view to show/hide the items.

 - Added a new check inside the "deleteMulti" method from BookmarkFragment that calls the showRemoveFoldersDialog to prevent the user from being able to delete one or more bookmark folders without being asked for confirmation, as in #8648.
4 years ago
ValentinTimisica 03284e2da0 Fixes #10674: Add SignInView only once 4 years ago
ekager 138d8e647d No issue - Use ViewLifecycleOwner lifecycleScope for Bookmark deletion scope 4 years ago
Michael Comella 4cf7280916 No issue: add clarifying kdoc for BookmarkFragment. 4 years ago
Simon Chae a851b76ea3
Update Android Components version to 41.0.20200506130132 (#10443) 4 years ago
ekager 52d09930a6 No issue - Update new strings for quarantine 4 years ago
Mihai Eduard Badea 02bd0cc203 For issue #8648 4 years ago
ekager c4e83367f6 For #6832 - Fix various fragment not attached to a context crashes 4 years ago
ekager 5d51c4f059 Don't use ProcessLifecycleOwner for view-tied consume 4 years ago
ekager f801f32027 No issue: Fix leaks in BookmarkFragment 4 years ago
Grisha Kruglov 853a0acab4 Closes #4046: Always display 'Desktop' bookmarks folder
See https://github.com/mozilla-mobile/fenix/issues/4046 for a detailed discussion of this.

In short, this patch removes code that would conditionally hide desktop bookmarks depending
on the signed-in state of the browser.
4 years ago
Jeff Boek 4cbb9aebaf
Cleans up nav_graph.xml (#9829)
* For #9751 - Cleans up homeFragment directions

* For #9751 - Uses global actions for fragments not owned by homeFragment

* For #9751 - Cleans up SearchFragment directions

* For #9751 - Removes settings action from DeleteBrowsingDataFragment

* For #9751 - Removes browser action from SettingsFragment

* For #9751 - Adds ManagePhoneFeature global action

* For #9751 - Clean up unused deletebrowsingfragment actions

* For #9751 - Cleans Up HistoryFragment actions

* For #9751 - Removes Home -> Search action

* For #9751 - Removes the Bookmark -> Browser action

* For #9751 - Cleans up bookmark fragment actions

* For #9751 - Cleans up actions from ShareController

* For #9751 - Removes defaultBrowserFragment to browserFragment action

* For #9751 - Removes about -> browser action

* For #9751 - Adds global action to TrackingProtectionFragment

* For #9751 - Removes exception -> browser action

* For #9751 - Removes login -> browser action

* For #9751 - Fixes LoginFragment directions

* For #9751 - Removes ExternalAppBrowser directions

* for #9751 - Cleans up actions

* For #9751 - Fixes unit tests

* For #9751 - Addresses nits in PR
4 years ago
ekager b8fba63be4 For #9890 - Do not display full screen snackbar with toolbar padding 4 years ago
Sawyer Blatz e3ed7ed268
Issue #9128 & #9222 & #9499: Refactors snackbar creation and fixes placement (#9628) 4 years ago
David Walsh 681d6cf8a1 For #8652 - Allow sharing multiple bookmarks 4 years ago
Sawyer Blatz cc8f34b68b
For #8773: Fixes issue with snackbar placement on ContextMenu (#8942) 4 years ago
Emma Malysz 5e9b753acb For #7473, delay inflation of toolbar
Improve performance of HomeActivity.onCreate by delaying this inflation.
We use a ViewStub and inflate the first time the actionbar is accessed.
4 years ago
Sawyer Blatz c7c4ad051a
For #6413: Adds more snackbar positioning logic (#7444)
* For #6413: Adds more snackbar positioning logic

* Refactor
4 years ago
Sawyer Blatz 3fb060f682
For #6413: Fixes snackbar positionining for bottom toolbar (#7415)
* For #6413: Fixes snackbar positionining for bottom toolbar

* For #6413: Cleans up snackbar usage
4 years ago
Afzal Najam b9656a978e Hide add folder option when in Desktop Bookmarks folder 4 years ago
cesar 4422e3ed39 Closes #6731 - fixed BookmarkNode minus operator and deleteOperation 5 years ago
Jeff Boek 1b1f9348dc No Issue - Fixes warnings / compiler errors with A-C update 5 years ago
Tiger Oakes 7e8f079269
Use ShareData with ShareFragment (#6698) 5 years ago
Tiger Oakes 0a86676563 For #6523 - Remove close button in library 5 years ago
Severin Rudie 8d68317388
4844 fix url elision (#6588)
* For #4844: add test cases for url elision

* For 4844: implement toShortUrl to pass test cases

* For 4844: update plumbing to use toShortUrl

* For 4844: adds/handles suggested url elision test case
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
Pawel Obarzanek 40cda1d758 Closes #2435 Change edit icon to share icon on the book… (#6137)
* Closes mozilla-mobile#2435 Change edit icon to share icon on the bookmark toolbar

* Closes mozilla-mobile#2435 Changed raw string to string resources

* Pass bookmark arguments to share fragment

* Closes mozilla-mobile#2435 add orEmpty
5 years ago
shldhll 8e17ac05b1 Optimized imports. Closes #5876 5 years ago
shldhll f907ec52f0 Removed ObsoleteCoroutinesApi in tests. Closes #5876 5 years ago
Tiger Oakes d028c97112 For #5213 - Use support library attributes 5 years ago
Tiger Oakes ee1f040e53 No issue: Move signedIn tracking to BookmarksSharedViewModel (#4755) 5 years ago
Emily Kager 3f41a4e9c6 No issue: Update navigation library 5 years ago
Mihai Adrian 62ae025d65 For #4991:Ensured deleteSelectedBookmarks deletes all selected bookmarks (#5559)
Moved the deletion to a CoroutineScope(IO) to decouple from fragment lifecycle
Used local val tempStorage to keep reference to bookmarkStorage of outside class
Ran deletions with awaitAll to avoid concurrency issues on storage
5 years ago