Commit Graph

151 Commits (d9d01db7cc7a9bd66472d2c2dc6b86d6d1a2cc34)

Author SHA1 Message Date
mcarare d9d01db7cc For #25980: Replace deprecated setHasOptionsMenu with MenuProvider. 2 years ago
Roger Yang bc1cfb88e8 Revert "For #11404 - Create open all function"
This reverts commit 9cf42cb7d9.
2 years ago
Roger Yang cfa376e5d2 Revert "For #11404 - Create alert message when a lot of tabs are to be opened."
This reverts commit c75e331a30.
2 years ago
Pg c75e331a30 For #11404 - Create alert message when a lot of tabs are to be opened.
Current threshold is 15.
2 years ago
Pg 9cf42cb7d9 For #11404 - Create open all function
- Create element to be displayed

- Update the interface and bind in the view holder
Set the filter to limit this action to FOLDER.

- Create core function
Main logic is done on the controller (has it should be done). The whole
process is done in one coroutine to be non-blocking as many
(sub)folders & links can be present. If folder is empty, a toast is
displayed. Else iterate on items. When item is:
- a FOLDER -> restart process (without toast) on the folder
- a ITEM -> open it
- a SEPARATOR -> do nothing
Once finished, show the tabs tray.

Toast message is defined in fragment to have access to context.

- Create androidTest for openAllInTabs
- Create tests for handleBookmarkFolderOpening
- Display 'open all' options only if folder has at least on child:
A coroutine and suspended functions have to be used, since `getTree`
is async.
2 years ago
mcarare ffcef5ff2e For #26844: Fix ktlint issues and remove them from baseline. 2 years ago
Roger Yang 7a5e126f24 Issue #24740: Use unified search bar in bookmark search 2 years ago
mcarare ffa1ecd300 For #21292: Remove unused MetricController parameters. 2 years ago
mavduevskiy 602f55b5d2
For #23665 - Make the undo snackbar for the library screens work globally (#24398)
* Closes #23665: make snackbar work after leaving the fragment it was initiated from

* Closes #23665: bring back the removed bookmark navigation test, sort imports alphabetically

Co-authored-by: mike a <mavduevskiy@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2 years ago
Arturo Mejia 5982990e17 For #20872: Prevent crash when updating pending Bookmarks to be deleted without a selected folder. 2 years ago
Mugurell a6871f9b7e For #11753 - Update compose to 1.1.1 and Kotlin to 1.6.10
The needed changes are around supporting exhaustive whens for sealed classes
as a new kotlin feature - https://kotlinlang.org/docs/whatsnew1530.html#exhaustive-when-statements-for-sealed-and-boolean-subjects

androidx_activity_compose was removed as a dependency since it isn't used.

Used 1.6.10 for Kotlin although 1.6.20 is available to prevent any issues with
Compose 1.1.1 reported as an error at compile time:
"e: This version (1.1.1) of the Compose Compiler requires Kotlin version 1.6.10
but you appear to be using Kotlin version 1.6.20 which is not known to be
compatible. Please fix your configuration (or
`suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!)."
2 years ago
Alexandru2909 82901297cb For #24214 - Move bookmark removal events to BookmarkController 2 years ago
Alexandru2909 0a5b8c49a0 For #24214 - Remove Event.wrapper for BookmarksManagement metrics 2 years ago
Roger Yang ed71b8a92c Close #12717: Add bookmark search 2 years ago
Gabriel Luong a6c8f8b313 For #24252 - Rename destructive attribute to textWarning 2 years ago
Mugurell 4cc9a74c3d Revert "For #23871 - Update compose to 1.1.0 and kotlin to 1.6.10"
This reverts commit 23f41c9c68.
2 years ago
Mugurell 23f41c9c68 For #23871 - Update compose to 1.1.0 and kotlin to 1.6.10 2 years ago
Arturo Mejia 7b7ef2e661 For issue #22537 crash: BookmarkFragment is attached to a context 3 years ago
Gabriel Luong 660300f770 For #21776 - Replace 'isEmpty' with 'ifEmpty' 3 years ago
Sebastian Kaspari 170fa9705e Update Kotlin and Jetpack Compose versions. 3 years ago
codrut.topliceanu f9d6380ab3 For #17917: Use View binding in bookmarks screen 3 years ago
Sebastian Kaspari 971b419d77 Run ktlintFormat to adapt to latest formatting rules. 3 years ago
Sebastian Kaspari 8b5aef7def Update Kotlin to 1.5.10 (and Coroutines to 1.5.0). 3 years ago
Roger Yang 049811fabb Issue #20307: Clear sharedViewModel selectedFolder when backing out of bookmark fragment 3 years ago
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