Don Turner
707117a4f2
Merge branch 'main' into kotlinify
2 years ago
Simon Marquis
f27a2e176e
Reduce overall build complexity
...
- 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`
2 years ago
Simon Marquis
caa482bc71
Kotlinify codebase
...
- 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)
2 years ago
Simon Marquis
a33dafccad
Migrate from `java` to `kotlin` sourceSet directory
2 years ago
Don Turner
d0909a9c8f
Merge pull request #925 from SimonMarquis/remove-dispatcher
...
Remove unnecessary dispatcher switch in `DefaultRecentSearchRepository`
3 years ago
Simon Marquis
0ddcf0b4ab
Remove unnecessary dispatcher switch in `DefaultRecentSearchRepository`
...
As mentioned in the following discussion: https://github.com/android/nowinandroid/discussions/818
Room already takes care of switching dispatchers if the DAO method is correctly annotated with the `suspend` modifier.
3 years ago
Roy Matero
4e6cda1965
Renamed toggle function signature with boolean parameters
...
Change-Id: I0d6c0ed4d4c0ee4bd387e5645fc558970f5f202b
3 years ago
blackbracken
805914dade
Call getNewsResourceIds instead of getNewsResources
3 years ago
Simon Marquis
27154ef38a
Apply changes from review comments
3 years ago
Simon Marquis
fecab96e4c
Keep track of matching `Network`s inside `NetworkCallback`
...
This will ensure the connectivity state remains synchronized with the `ConnectivityManager`.
Fixes #714
3 years ago
TJ Dahunsi
cd6ad7d575
Ensure DAO exposes only reactive types
...
Change-Id: I8992ccf6525cd4c5ea9503d532b500e4d310b7fb
3 years ago
Adetunji Dahunsi
ba1d9e14df
Merge pull request #716 from SimonMarquis/SimonMarquis-patch-3
...
Simplify handling of nullability in `ConnectivityManagerNetworkMonitor`
3 years ago
James Rose
2f2dfb00a4
Mark all news resources read on first sync
...
Otherwise, there will be unread articles until the user clicks through
every article that has ever been published.
3 years ago
Simon Marquis
ec9155fef9
Update ConnectivityManagerNetworkMonitor.kt
3 years ago
Simon Marquis
7819a0c6bc
Extract common code to update the Flow value
3 years ago
Simon Marquis
def5c4e881
Update ConnectivityManagerNetworkMonitor.kt
3 years ago
Simon Marquis
76c249a651
Update ConnectivityManagerNetworkMonitor.kt
3 years ago
Simon Marquis
f34ee1c01b
Update ConnectivityManagerNetworkMonitor.kt
3 years ago
Simon Marquis
de6545f5d7
Simplify handling of nullability in `ConnectivityManagerNetworkMonitor`
3 years ago
TJ Dahunsi
9562f7707d
Route notification deep link through for you screen, with spotless fixes
3 years ago
TJ Dahunsi
ef97cb941c
Route notification deep link through for you screen
3 years ago
Takeshi Hagikura
b3cdc172cd
Implement search feature ( #685 )
...
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
3 years ago
Adetunji Dahunsi
73a38720d8
Merge pull request #649 from android/tj/backend-requested-sync
...
Wire up backend requested sync
3 years ago
Adetunji Dahunsi
337c940d66
Add comments explaining backend sync and made variable names easier to grok
...
Change-Id: I90cd7444de95efa20bf243a922a772f7849a23ec
3 years ago
Adetunji Dahunsi
022cd92f4c
Update core/data/src/main/java/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstNewsRepository.kt
...
Co-authored-by: Don Turner <dturner@users.noreply.github.com>
3 years ago
Adetunji Dahunsi
05be2855d8
Wire up backend requested sync
...
Change-Id: I1d4485b589c7e94527a2a02f371cd3f030231622
3 years ago
James Rose
93953c2206
Add missing method doc
3 years ago
James Rose
050db2cb72
Merge branch 'main' into jr/track-viewed
3 years ago
James Rose
b49767a88c
Rename getUserNewsResources to observeAll
3 years ago
Adetunji Dahunsi
08956492c8
Backend triggered sync
...
Change-Id: I53c43b136ebb755f6258b1e815301dddb3b536a3
3 years ago
James Rose
57c13d84bd
Incorporate code review changes: Move UserNewsResourceRepository to data
...
module; move UserNewsResource to model module. Implement unread dot for
bookmarked articles. Keep the flows cold in UserNewsResourceRepository.
3 years ago
James Rose
9ee2acf327
Add viewed status for news resources to data layer
3 years ago
Adetunji Dahunsi
8765d3ac57
Fix tests for batched news resource sync
...
Change-Id: I37545eba8618edc936eb12fa38628d98f85f52ed
3 years ago
Adetunji Dahunsi
1e8d1d9810
Spotless fix
...
Thought I was cool enough to edit code in the browser. Spotless said no.
3 years ago
Adetunji Dahunsi
267adfd27f
Batch sync news resources from remote
...
Batch sync news resources from remote to reduce json payload size.
3 years ago
Adetunji Dahunsi
09f5c3bc61
Add NewsResourceQuery to better query encapsulation
...
Change-Id: I93f8c8ae2d1144975f6f9ff1ba93be9a4600768a
3 years ago
Don Turner
2a4d0434a5
Add Firebase analytics. See go/nia-firebase-services.
...
Change-Id: I0cbbda0bba761d8019241f6165db231fe94fb689
3 years ago
Márton Braun
819dd494ad
Run Spotless to add trailing commas (and apply other rule updates)
...
Change-Id: I5f8e49a3ef004c7e9e7dfe4bc55f0a35dc575209
3 years ago
Angie Sasmita
6046f6e943
Add dynamic color option in settings for API >=32
...
Change-Id: Ib42c1cbd0208e98ef7610a1c8aca5d721aa464e6
3 years ago
Jolanda Verhoef
4ba63c0de8
Remove author concept from app
...
Change-Id: Icd03c0288ba5f3f23dbcbdbefbbe802db2815793
3 years ago
Márton Braun
9c22a7a4e7
Remove `Stream` suffixes
...
Change-Id: I45decae965d7e35289d3fa31fc58b8c463fbead1
3 years ago
Milosz Moczkowski
a70761f24b
Merge pull request #441 from android/refactor/remote_fake_data_source
...
Remove FakeDataSource
3 years ago
Don Turner
9fa3dadcfd
Fix comment
3 years ago
Adetunji Dahunsi
841f58ef26
Check active network for connectivity state each time network changes
...
Change-Id: I5d3eb0251f62a57a5767911167067d35aeec8e6a
3 years ago
Miłosz Moczkowski
6174a3a3ef
Spotless apply
...
Change-Id: Iaf82b44487f001417265ad97acfe6eea8dd6a78f
3 years ago
Miłosz Moczkowski
67fea35e6d
Replace networkJson and FakeAssetManager with FakeNiaDataSource in all repositories
...
Change-Id: Ibeb9fd09bd862000794f41edcddd2cea434a9bb1
3 years ago
Simon Marquis
7e0bfb43fa
Add missing binding in NetworkModule
3 years ago
Simon Marquis
67dea1c136
Fix spotless issues
3 years ago
Simon Marquis
fbaa8eaff5
Migrate hard-coded JSON data into JSON assets files
...
JSON minification is no longer necessary since assets files are already gzipped during APK/AAB packaging.
Fixes #391
3 years ago
Don Turner
5b8c284c74
Rename hasDismissedOnboarding to shouldHideOnboarding
...
Change-Id: I8a6b35f7216f9944652d8da346e7458614311e08
3 years ago