* main:
Bump protobuf from 3.24.4 to 3.25.2 (#1214)
Remove legacy benchmark build type (#1207)
Use androidx.tracing everywhere
Revert fast initialization of Coil
Add comment for Retrofit async OkHttp
Optimize OkHttp initialization for Retrofit
Add braces
Inline initialization
Don't use runBlocking if async init completed
Launch loader directly without additional coroutine scope
Fix comment
Improve lazy loading for Coil + OkHttp
Restores screenshot tests in foryou (#1199)
Fix name and message of dependency guard actions (#1196)
Change-Id: Ifcbfcfba4b7d8c24599e207b4a05dfea6125fde7
* Remove legacy benchmark build type
Now that we have the baseline profile gradle plugin,
there is no need for a benchmark build type.
The plugin does the setup and configuration and runs against the
correct app flavor.
* Remove explicit benchmark build type from benchmark module
* Remove stale build task exclusions
* Fix tracing import location
FYI @mlykotom
- Reduce the visibility of multiple Hilt `Module`s and implementations of public interfaces
- Correctly configure the visibility of dependencies:
- `api` when it's part of it's public `api`
- `implementation` when it's part of it's internal `implementation`
- Remove unnecessary dependencies in build.gradle.kts files
- Remove unnecessary dependencies provided by plugins
- Remove unnecessary applied plugins (i.e. roborazzi)
- Sort dependencies in `build.gradle.kts`
- Delete unused entries in `libs.versions.toml`
- Remove unnecessary nullable types
- Replace no-op method bodies with Unit
- Convert to expression body
- Replace if with when
- Remove braces from 'when' entries
- Remove braces from if statement
- Convert to single line lambda
- oneline if/returns
- Replace 'contains' call with 'in' operator
Following this refactor, it could be great to envision a more "strict" code formatter like ktlint 1.0 (we are currently stuck at 0.48.1)
* Adds screenshot tests using Roborazzi (Robolectric Native Graphics)
- Adds Roborazzi to convention plugins
- Adds Screenshot helper in :core-testing
- Creates screenshot suites for :app and :feature-foryou
* CI and spotless
* Moves :app tests to testDemo and makes NiaAppScreenSizesScreenshotTests prettier
* CI: Moves local tests to their own step
* CI: Adds --rerun to screenshot task
* CI: Moves screenshots before local tests
* CI: Fixes wrong if statement in workflow
* CI WIP: trying to trigger the push step
* CI: Re-enables roborazzi verification
* Fixes flaky screenshot tests by setting LocalInspectionMode on
* CI: screenshot commits now use the original author intead of bot account
* CI: Disables globbing because file_pattern didn't work
* CI: Trying new file pattern for png files
* CI: Adds a check for forks
* 🤖 Updates screenshots
* Code review: toml cleanup, comments
* Use new github.event.pull_request.head.repo.fork
Co-authored-by: Simon Marquis <contact@simon-marquis.fr>
* Uses Robolectric qualifiers to set the dpi, adds section to README
* Spotless
* Delegates creation of repository to Hilt in test
* Revert "Use new github.event.pull_request.head.repo.fork"
* 🤖 Updates screenshots
* Empty commit to trigger GHA on main branch
* Makes time zones deterministic in screenshot tests
* Increases GMD timeout to 90m, but it has to be reduced
---------
Co-authored-by: Simon Marquis <contact@simon-marquis.fr>
The initial reason for this `StringDecoder` was to make sure the AndroidX navigation route would not use incompatible chars in the resulting String.
For that, `Uri.encode(String)` was used, but this is an Android API (`android.net.Uri`).
Unit tests would fail because Uri is not mocked (since we are not using Robolectric).
Therefore, a `StringDecoder` interface was introduced with 2 implementations: `UriDecoder` and `FakeStringDecoder`, Hilt modules were added, etc.
FWIW, the naming of the API was misleading: `StringDecoder.decodeString(encodedString: String)` does not inform how encoded the input is, so `UriDecoder` could "decode" something that was not necessarily uri "encoded".
The solution to this problem was to simply use regular Java APIs:
- `URLDecoder.decode(urlEncodedTopicId, "UTF-8")`
- `URLEncoder.encode(topicId, "UTF-8")`
Permissions should only be called in an Activity context, which is a layoutlib limitation. We need to avoid launching the permission request when in LocalInspectionMode, otherwise we'll have render errors on the ForYouScreen previews.