You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iceraven-browser/app/src/main/res
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
..
anim For #12287: Address review comments 4 years ago
animator Closes #4012 - Animate quick settings (#4047) 5 years ago
color For #8312 - Show Top Sites in a ViewPager (#14116) 4 years ago
drawable For #18515 - Added Icon and sync functionality 3 years ago
drawable-hdpi For #8643 - removed all onboarding-related PNGs 4 years ago
drawable-ldrtl For #8643 and #7606 - added new svgs for onboarding illustrations 4 years ago
drawable-mdpi For #8643 - removed all onboarding-related PNGs 4 years ago
drawable-night No issue: Remove duplicate wordmark and update about page (#3590) 5 years ago
drawable-v24 For #7345 - Update new shield icons, remove lottie (#15909) 4 years ago
drawable-v26 FNX-14661 ⁃ Delete drawables (#13481) 4 years ago
drawable-xhdpi For # 15929: Remove the search widget discoverability experiment. (#16081) 4 years ago
drawable-xxhdpi For #8643 - removed all onboarding-related PNGs 4 years ago
drawable-xxxhdpi For #8643 - removed all onboarding-related PNGs 4 years ago
font For 3687 Use Metropolis Font for Header 4 years ago
layout 16900 make navgraph inflation asynchronous (#18889) 3 years ago
menu No issue - Remove generic strings for more specificity (#18769) 3 years ago
mipmap-anydpi-v26 For #419: Create launch icon for private browsing (#4948) 5 years ago
mipmap-hdpi Optimize PNGs. 4 years ago
mipmap-mdpi Optimize PNGs. 4 years ago
mipmap-xhdpi Optimize PNGs. 4 years ago
mipmap-xxhdpi Optimize PNGs. 4 years ago
mipmap-xxxhdpi Optimize PNGs. 4 years ago
navigation For #18806: Show sync tabs or sync account sign in based on feature flag (#18859) 3 years ago
values For #18375: Add experiment for set default browser New Tab card. 3 years ago
values-an Import l10n. 4 years ago
values-ar Import l10n. 3 years ago
values-ast Import l10n. 3 years ago
values-az Import l10n. 4 years ago
values-be Import l10n. 3 years ago
values-bg Import l10n. 3 years ago
values-bn Import l10n. 3 years ago
values-br Import l10n. 3 years ago
values-bs Import l10n. (#14650) 4 years ago
values-ca Import l10n. 3 years ago
values-cak Import l10n. 3 years ago
values-co Import l10n. 3 years ago
values-cs Import l10n. 3 years ago
values-cy Import l10n. 3 years ago
values-da Import l10n. 3 years ago
values-de Import l10n. 3 years ago
values-dsb Import l10n. 3 years ago
values-el Import l10n. 3 years ago
values-en-rCA Import l10n. 3 years ago
values-en-rGB Import l10n. 3 years ago
values-eo Import l10n. 3 years ago
values-es Import l10n. 3 years ago
values-es-rAR Import l10n. 3 years ago
values-es-rCL Import l10n. 3 years ago
values-es-rES Import l10n. 3 years ago
values-es-rMX Import l10n. 3 years ago
values-et Import l10n. 4 years ago
values-eu Import l10n. 3 years ago
values-fa Import l10n. 3 years ago
values-ff Import l10n. 4 years ago
values-fi Import l10n. 3 years ago
values-fr Import l10n. 3 years ago
values-fy-rNL Import l10n. 3 years ago
values-ga-rIE Import l10n. 4 years ago
values-gd Import l10n. 3 years ago
values-gl Import l10n. 3 years ago
values-gn Import l10n. 3 years ago
values-gu-rIN Import l10n. 4 years ago
values-hi-rIN Import l10n. 3 years ago
values-hr Import l10n. 3 years ago
values-hsb Import l10n. 3 years ago
values-hu Import l10n. 3 years ago
values-hy-rAM Import l10n. 3 years ago
values-ia Import l10n. 3 years ago
values-in Import l10n. 3 years ago
values-is Import l10n. 4 years ago
values-it Import l10n. 3 years ago
values-iw Import l10n. 3 years ago
values-ja Import l10n. 3 years ago
values-ka Import l10n. 3 years ago
values-kab Import l10n. 3 years ago
values-kk Import l10n. 3 years ago
values-kmr Import l10n. 3 years ago
values-kn Import l10n. 4 years ago
values-ko Import l10n. 3 years ago
values-ldrtl For #10525 - Remove tab tray item dividers. 4 years ago
values-lij Import l10n. 4 years ago
values-lo Import l10n. 3 years ago
values-lt Import l10n. 3 years ago
values-ml Import l10n. 4 years ago
values-mr Import l10n. (#12766) 4 years ago
values-my Import l10n. 4 years ago
values-nb-rNO Import l10n. 3 years ago
values-night For #18829: Adjust bookmark item color to UX specs. 3 years ago
values-night-v23 For #11099 For #12189 For #7532 - Clean up bottom navigation bar colors 4 years ago
values-nl Import l10n. 3 years ago
values-nn-rNO Import l10n. 3 years ago
values-oc Import l10n. 3 years ago
values-pa-rIN Import l10n. 3 years ago
values-pl Import l10n. 3 years ago
values-pt-rBR Import l10n. 3 years ago
values-pt-rPT Import l10n. 3 years ago
values-rm Import l10n. 3 years ago
values-ro Import l10n. (#14200) 4 years ago
values-ru Import l10n. 3 years ago
values-sat Import l10n. 3 years ago
values-sk Import l10n. 3 years ago
values-sl Import l10n. 3 years ago
values-sq Import l10n. 3 years ago
values-sr Import l10n. 3 years ago
values-su Import l10n. 3 years ago
values-sv-rSE Import l10n. 3 years ago
values-szl Import l10n. 3 years ago
values-ta Import l10n. 3 years ago
values-te Import l10n. 3 years ago
values-tg Import l10n. 3 years ago
values-th Import l10n. 3 years ago
values-tl Import l10n. 3 years ago
values-tr Import l10n. 3 years ago
values-trs Import l10n. 3 years ago
values-tt Import l10n. 3 years ago
values-uk Import l10n. 3 years ago
values-ur Import l10n. 3 years ago
values-uz Import l10n. 4 years ago
values-v23 For #11099 For #12189 For #7532 - Clean up bottom navigation bar colors 4 years ago
values-v27 For #11099 For #12189 For #7532 - Clean up bottom navigation bar colors 4 years ago
values-v28 For #1399 - Only show battery saver theme preference for API <P 5 years ago
values-vec Import l10n. 4 years ago
values-vi Import l10n. 3 years ago
values-zh-rCN Import l10n. 3 years ago
values-zh-rTW Import l10n. 3 years ago
xml For #18940 - Remove reserved icon spacing for "Nimbus Experiments" setting preference (#18949) 3 years ago