* 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.
Continues the work initiated in #738.
Extract the SDK version check inside a `GrantPostNotificationPermissionRule` class that delegates to a regular `GrantPermissionRule`.
Combine the search result of topics and news resources in one
LazyVerticalGrid so that topics don't get in the way.
Before this change, the result of topics created a LazyColumn and
the result of news resources created the LazyVerticalGrid separately
that made the situation where there were two separete vertical scrolling
lists.
Implement search feature
- Add a feature module named "search"
- Add a SearchScreen that is navigated by tapping the search icon at the top left corner
- Add a data layer that takes care of populating the *Fts tables and querying them by a search query
- Add a SearchViewModel that wires up the data layer of the Fts tables with the SearchScreen
The SearchScreen has following features:
- The user is able to type the search query in the TextField
- The search result is displayed as the user types
- When the search result is clicked, it navigates to:
- The InterestsScreen when a topic is clicked
- Chrome custom tab with the URL of the clicked news resource
- When the search result is clicked or the IME is explicitly closed by the user, the current search query in the TextField is saved as recent searches
- Latest recent searches are displayed in the SearchScreen
When a news resource is unread, display a dot on its card in the news
feed. When the For You section has unread resources, display a dot on
its icon in the navigation bar.
Update the read status when a resource is opened.
This moves the responsibility for joining the UserData and the
NewsResources to UserNewsResourceRepository. This way, the work can be
done once and shared with all consumers in a SharedFlow, rather than
having each consumer perform the join itself by invoking the UseCase.
* goog/main:
Revert "Revert "Revert "Revert "New build trigger""""
Bump versionCode to 5
Remove AD_ID permission
Add Firebase analytics. See go/nia-firebase-services.
Simplify build script
Copy local.properties during build
Fix exit codes
Remove .prod from the applicationIdSuffix in preparation for Play launch
Build aab with play services enabled
Build release artifacts separately, using google-services
Enable use-google-services in release builds
Revert "Revert "Revert "New build trigger"""
Revert "Revert "New build trigger""
Revert "New build trigger"
New build trigger
Increment internal build trigger
Adding a file which can be modified to trigger an internal build
Add Firebase dependencies
Remove API 23 from list of APIs to test in Firebase Test Lab (it's flaky)
Copy google-services.json from prebuilts folder
Change-Id: Ibc76e1b89c6c7e7f58843edb56581e169c9ce14e
* github/main:
Bump version to 4
Remove unused DropdownMenu component
Route topic chip tap events up to NiaNavHost
Apply suggestions from code review
Migrate custom room configuration into a convention plugin
Update docs/ArchitectureLearningJourney.md - User action follow topic
Update docs/ArchitectureLearningJourney.md - Writing data
Change-Id: I417abcaba792bbf297a8156bb1c4cf677dcb8bea
> `Transformations` is now written in Kotlin. This is a *source incompatible change* for those classes written in Kotlin that were directly using syntax such as `Transformations.map`
> Kotlin code *must* now use the Kotlin extension method syntax that was previously only available when using `lifecycle-livedata-ktx`.
> The `collectAsStateWithLifecycle()` APIs of `lifecycle-runtime-compose` are no longer in experimental status. (I09d42, b/258835424)
Changelog: https://developer.android.com/jetpack/androidx/releases/lifecycle#2.6.0-alpha05