Commit Graph

197 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
mcarare ba218e638b For #18375: Add experiment for set default browser New Tab card. 3 years ago
rxumoz 46af52d254
Update top sites to add PDD for MozillaOnline builds (#18615) 3 years ago
Mihai Adrian Carare a539f69cb2
For #18260 - Add pin to default sites. (#18618) 3 years ago
Arturo Mejia 869c99afaa For #15372 Optimize the order and messages of onboarding cards 3 years ago
mcarare 62bd3b4f95 For #18009: Correctly report items in adapter for a11y services. 3 years ago
ekager 083fe26f57 For #17542 - Removes flash on renaming top site and fixes title not being updated 3 years ago
mcarare af1af358a3 For #14011: Remove new line character and spaces from string. 3 years ago
ekager b7fe809ae4 For #16351 - Make homescreen interactive when search dialog is up 4 years ago
rxumoz 409041ae3b
For #16451 - Change default top sites to Baidu & JD in China build (#16515)
* Add top sites related strings

* Change default top sites to Baidu & JD in China build
4 years ago
Codrut Topliceanu 6e4393a199
For #15720 - Remove unused telemetry (#15887) 4 years ago
Gabriel Luong 66210469c0
For #9548 - Ability to rename top sites (#16285)
* Ability to rename top sites, closes #9548

* Highlight the "Remove" top site action as destructive

With more menu items in the top site contextual menu, it makes sense to differentiate

* Added test for the top site renaming action

* Fixed lint check (wildcard imports, blank spaces)

* Applied suggestions from code review

* Apply suggestions from code review

Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>

* Implemented dialog click listener with manual dismiss/cancel

Co-authored-by: Lorenzo Stanco <lorenzo.stanco@gmail.com>
4 years ago
ekager 6b8f2001df
For #16084 - Match elevation of Tab in Collection to header (#16100) 4 years ago
Elise Richards 13f3304912
For #8765: Use shared list widget in collections (#15733)
Co-authored-by: Tiger Oakes <toakes@mozilla.com>
4 years ago
Grisha Kruglov 71b51146cb Update breaking changes in the FxA/Sync integration 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
Jonathan Almeida d063cd5396 For #14230: Stop redrawing all top sites when one is removed 4 years ago
Sawyer Blatz 1f17371df6 For #14565: Add telemetry for top sites 4 years ago
Gabriel Luong 05857ba55d For #14145 - Add pinned badge for pinned sites 4 years ago
Tiger Oakes 53d16e78e1
For #14460: Fix PBM notification tint (#14699) 4 years ago
Sören Hentzschel 81dd1a9192
For #8343, #9709 - replace "phone" with "device" in translations (#14083) 4 years ago
Gabriel Luong 4f76699ab7 For #10342 - Part 6: Show "Delete from history" instead of "Remove" for top frecent sites in the top site menu 4 years ago
Gabriel Luong 1f564c10ce For #10342 - Part 4: Use the TopSitesFeature in the HomeFragment for displaying top sites 4 years ago
Gabriel Luong 04dcfa5cab
For #8312 - Show Top Sites in a ViewPager (#14116) 4 years ago
Elise Richards 433a20db50
Update string for FxA signin onboarding header (#14132) 4 years ago
ekager 655d2b8a88 For #12377 - Choice to hide no collections placeholder from homescreen 4 years ago
Elise Richards feae7fff2f
FNX-14498 ⁃ For #9487: improve fxa onboarding manual sign in card (#13317)
* Replace strings, add learn more, hook up button

* Constrain learn more and icon to the text

* View holder tests

* Lint

* Update homescreen ui test
4 years ago
ekager a1a839f237 For #13221 - Update global ETP to include PBM 4 years ago
Mihai Eduard Badea 58e24b81aa For issue #12400 - Refresh swiped collection tab view
Item is now refreshed by calling notifyDataSetChanged on the adapter when the last tab from the collection has been swiped away and the user cancels the deletion by pressing the cancel button from the dialog.
Also added a "wasSwiped" flag to onCollectionRemoveTab in order to check if the tab was deleted from a swipe action and not by pressing the "X" button.
4 years ago
Tiger Oakes d8ff6179fe
For #7992: Use favicon style from AC (#12608) 4 years ago
Tiger Oakes 8f5a37733d
Create ToolbarPosition enum (#12747) 4 years ago
Tiger Oakes c08d375c18
Move settings in components (#12675) 4 years ago
mcarare 8826f99ef7 For #9722: Refactor onboarding buttons with text.
Add title and description to button text, remove extra Textviews.
4 years ago
Tiger Oakes d4bb432e24
Add helper for underlining text (#12520) 4 years ago
Tiger Oakes e9fb1a61c7
Test viewholders in home.sessioncontrol (#12524) 4 years ago
Tiger Oakes 67ce5ad5d9
Add tests for onboarding viewholders (#11522) 4 years ago
Tiger Oakes 8e8e5aea36
Extract radio group logic into helper (#11493) 4 years ago
mcarare 94273bc274 For #12125: Handle visibility updates for add to collection button. 4 years ago
Elise Richards 665fb8d60c
#10824: Onboarding telemetry (#11867)
* Onboarding events and tracking

* Rename metrics for consistency

* Add reference to PR for the data review

* Add default values to onboarding events
4 years ago
mcarare a056e86e4f For #8080: Dismiss menu when swiping away from its anchor. 4 years ago
Jeff Boek 2861421312 For #11112 - Adds save tabs to collection button to the no collections message 4 years ago
mcarare 4b04a140fc For #11229: Update etp strict option title content description. 4 years ago
mcarare a0d9189321 For #11229: Update onboarding ETP copy. 4 years ago
Jeff Boek 52c2fdb310
Remove tab tray feature flag (#11176)
* For #11171 - Removes feature flag for the new tab tray

* For #11171 - Removes all tab references from homeFragment

* For #11171 - Fixes unit tests

* For #11171 - Gets UI tests to compile and HomeScreenTest to pass

* For #11171 - Fixes `deleteMultipleSelectionTest`

* For #11171 - Fixes `openHistoryItemInNewPrivateTabTest`

* For #11171 - Fixes `openHistoryInPrivateTabTest`

* For #11171 - Fixes `openHistoryInNewTabTest`

* For #11171 - Fixes `openNewPrivateTabTest`

* For #11171 - Fixes tabbedBrowsingTests

* For #11171 - Fixes SettingsPrivacyTest

* For #11171 - Fixes TopSitesTest

* For #11171 - Fixes lint errors

* Ignore
4 years ago
mcarare c4f7a32eae For #9583: Increase touch targets for onboarding elements. 4 years ago
Jeff Boek 3946ec11de
Polish homescreen (#11065)
* For #10505 - Adjusts wordmark margins

* For #10505 - Removes topsite header, fixes collections header size and removes divider

* For #10505 - Restyle the top site items on the homescreen
4 years ago
Sawyer Blatz 7067e5c000
For #8125: Add default top site telemetry (#10752) 4 years ago
Christian Sadilek 4e25f41a41 For #1824: Prevent extremely long URLs from locking up HomeFragment 4 years ago
Tiger Oakes f7b4f1c959
Cache findViewById calls in session control (#10575) 4 years ago
Mihai Branescu 6f97e75579 For #8643 and #7606 - illustrations are now connected to their radio buttons 4 years ago