Compare commits

..
857 Commits
Author SHA1 Message Date
c1bd679046 Merge #256
256: Upgrade Dagger and fix dependency mess r=msfjarvis a=msfjarvis

Fixes #255

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-26 03:51:21 +00:00
Harsh Shandilya 34cfeb3250 build: bump Dagger to 2.36
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-26 09:20:03 +05:30
Harsh Shandilya 6bbcb979c3 Revert "build: upgrade all dependencies"
This reverts commit ffd46f1d29.
2021-05-23 18:53:03 +05:30
Harsh Shandilya 5ef621d26a Revert "github: switch snapshots for debug builds"
This reverts commit d7c1c6bca6.
2021-05-23 18:53:02 +05:30
d5bc33a280 Merge #254
254: Upgrade all dependencies r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-22 10:36:30 +00:00
Harsh Shandilya d7c1c6bca6 github: switch snapshots for debug builds
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-22 16:05:50 +05:30
Harsh Shandilya 4b968f3bed app: customize app name for debug builds
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-22 16:05:50 +05:30
Harsh Shandilya ffd46f1d29 build: upgrade all dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-22 16:05:50 +05:30
70b4edcbb7 Merge #252
252: Handle lobste.rs deeplinks in the app r=msfjarvis a=Skrilltrax

Deeplink handling in Android is _interesting_.

Here's what is happening atm, 

```
<data
	android:ssp="//lobste.rs"
    android:scheme="https" />
```
Handles `https://lobste.rs`. We are using `ssp` here because using `host` without path `/` will match with all of the possible paths e.g, `https://lobste.rs/login` which we do not want.


```
<data
	android:host="lobste.rs"
    android:scheme="https"
    android:path="/"/>
```
Handles `https://lobste.rs/`


```
<data
	android:host="lobste.rs"
    android:scheme="https"
    android:pathPrefix="/recent" />
```
Handles `https://lobste.rs/recent` and `https://lobste.rs/recent/`


```
<data
	android:host="lobste.rs"
    android:scheme="https"
    android:pathPattern="/s/......" />
```
Handles `https://lobste.rs/nr9kzv`.

```
<data
	android:host="lobste.rs"
    android:scheme="https"
    android:pathPattern="/s/....../" />
```
Handles `https://lobste.rs/nr9kzv/`.

```
<data
	android:host="lobste.rs"
    android:scheme="https"
    android:pathPattern="/s/....../...*" />
```
Handles everything after `https://lobste.rs/s/nr9kzv/` except for a case where the `postTitle` is one character long. This one character string is used for the reply URL.

Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-05-16 17:28:27 +00:00
Aditya WasanandHarsh Shandilya 96d8bfdb73 HACK: app: add workaround to prevent deeplinking comment replies back to the app
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-05-16 22:52:23 +05:30
Aditya WasanandHarsh Shandilya bdb1c8ef1b manifest: remove comments pathPattern
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-05-16 22:52:00 +05:30
Aditya WasanandHarsh Shandilya ce66536dde app: initial deeplinks handling
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-05-16 22:51:59 +05:30
829e1906d6 Merge #250
250: Bump Gradle to 7.0.2 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-16 06:07:44 +00:00
Harsh Shandilya 8f1153b05b Bump Gradle
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-16 11:37:08 +05:30
92db1a4ce5 Merge #249
249: Remove duplicate UrlLauncher from desktop r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-12 23:40:27 +00:00
Harsh Shandilya 4ca4fe81f0 desktop: use the UrlLauncher from common
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-13 04:20:48 +05:30
d00cf77d1d Merge #248
248: Update JB Compose r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-12 17:06:31 +00:00
Harsh Shandilya 4d6eb9ff1d gradle: bump JB Compose to 0.4.0-build190
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-12 22:32:52 +05:30
022de71c62 Merge #247
247: Bump Gradle to 7.0.1 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-10 18:52:50 +00:00
Harsh Shandilya 0fde488dde gradle: bump to 7.0.1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-11 00:22:11 +05:30
76c758d027 Merge #246
246: Bump deps and remove swipe refreshing for now r=msfjarvis a=msfjarvis

Swipe refresh is causing crashes for me deep in the bowels of NestedScroll

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-08 19:33:48 +00:00
Harsh Shandilya b847feae22 app: remove swipe refresh
This is causing crashes

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-09 00:49:56 +05:30
Harsh Shandilya 5a4efa33cf gradle: bump accompanist and activity-compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-09 00:30:49 +05:30
fb45ed99c2 Merge #245
245: Enable cacheability of internal AGP tasks r=msfjarvis a=msfjarvis

Taken from https://issuetracker.google.com/issues/141301405

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-06 16:28:07 +00:00
Harsh Shandilya 9967a534bd gradle: enable cacheability of internal AGP tasks
https://issuetracker.google.com/issues/141301405

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-06 21:56:45 +05:30
9745243cda Merge #244
244: AndroidX update day r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-05 19:39:10 +00:00
Harsh Shandilya ab10e04c72 gradle: bump deps
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-06 01:08:29 +05:30
d9ebe79ec7 Merge #243
243: Fix target SDK r=msfjarvis a=msfjarvis

Copypasta fail in #238
bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-05 08:04:20 +00:00
Harsh Shandilya e2774e48cd Set target SDK back to 30
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-05 13:33:18 +05:30
a6c476a97a Merge #242
242: Remove Shot entirely r=msfjarvis a=msfjarvis

It hasn't worked in a month and the dependencies are just dead weight

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-04 21:28:34 +00:00
Harsh Shandilya a4313bc401 Completely remove screenshot tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-05 02:58:04 +05:30
Harsh Shandilya e8b313605f app: directly use AndroidX dependencies
The JB Compose Gradle plugin will inject substitution rules automatically

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-05 02:36:55 +05:30
c1a56e59dd Merge #241
241: Bump JB Compose r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-04 20:39:07 +00:00
Harsh Shandilya e909f6e2bd build: bump JB Compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-05 02:08:26 +05:30
8becbb7f53 Merge #239
239: Add FAB animation  r=msfjarvis a=Skrilltrax



Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-04 06:37:18 +00:00
Harsh Shandilya 81b4da3584 Constify scroll delta and animation duration
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-05-04 12:06:47 +05:30
Aditya Wasan ea6f633d9b app: add hide animation to comment screen fab
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-05-04 11:13:13 +05:30
09dc4fc87b Merge #238
238: Bump to AGP 7.0.0-alpha15 r=msfjarvis a=msfjarvis

Also adapts the snapshot deployment scripts for removal of variant output API.

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-30 04:47:32 +00:00
Harsh Shandilya 85a7d0df84 scripts/deploy-snapshot: adapt for removal of variant output API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-30 10:10:24 +05:30
Harsh Shandilya a602a22eb0 Bump AGP to 7.0.0-alpha15
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-30 10:08:19 +05:30
7a9cc78264 Merge #237
237: Bump Dagger r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-28 02:47:30 +00:00
Harsh Shandilya 8152f4db96 build: bump Dagger Hilt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-28 08:16:51 +05:30
f316a6ebaa Merge #236
236: Bump JB Compose to 0.4.0-build185 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-27 04:53:01 +00:00
Harsh Shandilya ab1a9daefb build: bump JB Compose to 0.4.0-build185
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-27 10:22:13 +05:30
bbf3261815 Merge #227
227: Track comment parents via colored lines r=msfjarvis a=msfjarvis

Work towards #204

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-26 10:37:01 +00:00
Aditya WasanandHarsh Shandilya 45715a6c45 fix: re-use colors when comment depth becomes greater than the number of colors available
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-26 16:06:02 +05:30
Aditya WasanandHarsh Shandilya 635b508795 fix: set content size to be the min size of the container
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-26 16:05:02 +05:30
Harsh Shandilya 24f31f6fa2 Initial parent tracking implementation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-26 16:04:59 +05:30
73708a52d9 Merge #235
235: Use bors to manage spotless check r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 23:16:10 +00:00
Harsh Shandilya ef37928981 github: move stylecheck to bors
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-25 04:45:30 +05:30
8f2fe76706 Merge #234
234: Integrate Spotless and check codestyle in CI r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 23:08:17 +00:00
Harsh Shandilya 1c2deee063 github: add stylecheck workflow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-25 04:36:39 +05:30
Harsh Shandilya fcdced1a00 build: configure Spotless
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-25 04:35:23 +05:30
Harsh Shandilya ff17ab3e9b build: add and apply spotless plugin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-25 04:35:23 +05:30
Harsh Shandilya 5458e174e6 build: don't add clean task
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-25 04:18:18 +05:30
7505832fb9 Merge #233
233: Revert "Merge #231" r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 14:19:46 +00:00
Harsh Shandilya b3bd8c8db1 Revert "Merge #231"
RIP

This reverts commit 407ab3d17a, reversing
changes made to 2cd44707b7.
2021-04-24 19:44:09 +05:30
407ab3d17a Merge #231
231: Add dependency-tree-diff workflow r=msfjarvis a=msfjarvis



Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 14:01:09 +00:00
Harsh Shandilya d0a9d80341 github: add dependency-tree-diff workflow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 19:30:23 +05:30
2cd44707b7 Merge #230
230: Sync dependency versions r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 13:02:24 +00:00
Harsh Shandilya 2690525ab5 build: fix dependencies and repositories
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 18:31:11 +05:30
Harsh Shandilya 5dd467cb84 database: fix typecasting
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 18:17:10 +05:30
Harsh Shandilya 1641c896d7 buildSrc: remove deprecated warning suppression
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 15:23:52 +05:30
Harsh Shandilya 6c702d4556 build: sync version numbers with catalog
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 15:21:00 +05:30
Harsh Shandilya 457ffc2066 idea: untrack gradle.xml
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 15:19:56 +05:30
7f171594f3 Merge #229
229: Update SQLDelight to 1.5.0 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 07:46:36 +00:00
Harsh Shandilya 4cab5459dd gradle: bump SQLDelight to 1.5.0
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-24 13:07:38 +05:30
0c31b66116 Merge #228
228: Bump Accompanist to 0.8.1 r=msfjarvis a=msfjarvis

Removes the custom elevation increase since it was changed in the library too

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-23 18:03:20 +00:00
Harsh Shandilya 343e3d3bc7 gradle: bump accompanist to 0.8.1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-23 16:47:02 +05:30
Harsh Shandilya 5c8e6841ee Revert "NetworkPosts: increase swipe refresh indicator elevation"
This reverts commit c38ed8ff51.
2021-04-23 16:46:44 +05:30
f2ccc339aa Merge #226
226: Add moshi-metadata-reflect r=msfjarvis a=msfjarvis

This was always needed but weird cache inconsistencies kept it working on my local builds /shrug

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-23 04:40:32 +00:00
Harsh Shandilya eec16bdfbd Use moshi-metadata-reflect
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-23 10:07:44 +05:30
0675a6addb Merge #225
225: Bump Dagger and Hilt to 2.35 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-23 01:03:48 +00:00
Harsh Shandilya 72ec208253 gradle: bump Hilt to 2.35
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-23 06:33:14 +05:30
54f293b0e7 Merge #224
224: Increase SwipeRefreshIndicator elevation r=msfjarvis a=msfjarvis

Matches the change in Accompanist

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 11:03:50 +00:00
Harsh Shandilya 36537a1edf all: run ktfmt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 16:25:52 +05:30
Harsh Shandilya c38ed8ff51 NetworkPosts: increase swipe refresh indicator elevation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 16:25:52 +05:30
06a03157d3 Merge #223
223: Bump KSP to 1.4.32-1.0.0-alpha08 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 04:46:37 +00:00
Harsh Shandilya e5ac0394b9 gradle: bump KSP to 1.4.32-1.0.0-alpha08
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 10:15:55 +05:30
bc3ece6ca8 Merge #222
222: Tie refresh state with Paging r=msfjarvis a=msfjarvis

This makes the indicator go away in a more consistent fashion

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-21 19:18:07 +00:00
Harsh Shandilya 4367a2821f NetworkPosts: tie refresh state directly into Paging
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 00:44:53 +05:30
baa60254f0 Merge #221
221: Update dependencies r=msfjarvis a=Skrilltrax



Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-21 19:02:58 +00:00
Harsh Shandilya bc9f9bdac4 app: remove unused PullToRefresh code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 00:30:05 +05:30
Harsh Shandilya f1d497a70c app: replace PullToRefresh with accompanist-swiperefresh
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 00:30:05 +05:30
Harsh Shandilya e1a6ccd9d0 app: address CoilImage deprecation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-22 00:30:04 +05:30
Aditya WasanandHarsh Shandilya b888e127d2 build: update androidx-compose and accompanist
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-22 00:30:03 +05:30
5fad9ccc45 Merge #220
220: build: remove KotlinX Bintray repository r=msfjarvis a=msfjarvis

0.4.0-build182 upgraded kotlinx-collections-immutable to a version that no longer requires this repository

Ref: https://github.com/JetBrains/compose-jb/commit/8c8b4147abd0b697afd5b4ac216e426328054411

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-21 15:41:38 +00:00
Harsh ShandilyaandGitHub 92a0cb70b4 build: remove KotlinX Bintray repository
0.4.0-build182 upgraded kotlinx-immutable-jvm to a version that no longer requires this repository

Ref: https://github.com/JetBrains/compose-jb/commit/8c8b4147abd0b697afd5b4ac216e426328054411
2021-04-21 21:10:14 +05:30
55733e47af Merge #219
219: Remove IDEA files that create unnecessary churn r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-20 06:29:31 +00:00
Harsh Shandilya 843843e735 idea: remove infinitely churning files
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-20 11:58:45 +05:30
6f3685ec11 Merge #218
218: Bump JB Compose to 0.4.0-build184 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-20 04:56:53 +00:00
Harsh Shandilya 47cc883f25 gradle: bump JB Compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-20 10:26:06 +05:30
7a0d8e785c Merge #217
217: Use gradle catalogs r=Skrilltrax a=Skrilltrax



Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-17 12:34:21 +00:00
3276c0e072 Apply suggestions from code review
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-17 18:03:41 +05:30
Aditya Wasan 6772303bf5 build: use gradle catalogs for dependency management
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-17 17:56:24 +05:30
561a651dc4 Merge #215
215: Fix refresh action r=msfjarvis a=msfjarvis

🤦

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-15 20:48:20 +00:00
Harsh Shandilya 65c1122bb1 app: fix paging source copypasta fail
Fixes: #211
Fixes: 654eb39877 ("app: de-duplicate paging sources")
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-16 02:17:09 +05:30
e57d0138a6 Merge #214
214: Bump JB Compose r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-15 08:55:54 +00:00
Harsh Shandilya cac7614bc0 build: bump JB compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-15 14:25:14 +05:30
8414567a63 Merge #213
213: Add fastlane screenshots r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-14 14:11:31 +00:00
Harsh Shandilya 3b18b74f3a fastlane: add Play Store screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-14 19:34:11 +05:30
e7254ab764 Merge #212
212: Fix submitter name color in dark mode r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-14 12:51:46 +00:00
Harsh Shandilya 2d1e1ece4d app: fix submitter text color in replies and reformat
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-14 18:21:08 +05:30
7af22a422e Merge #210
210: Bump Dagger and JetBrains Compose r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-14 05:21:04 +00:00
Harsh Shandilya 34034bee34 build: update Dagger and JB Compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-14 10:44:19 +05:30
f398e9b27b Merge #208
208: Bump JetBrains Compose to 0.4.0-build181 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 06:26:55 +00:00
Harsh Shandilya b758f7843d build: bump JB Compose to 0.4.0-build181
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 11:56:18 +05:30
8a9b7d5a6c Merge #207
207: Add comment reply button r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-12 21:53:54 +00:00
Harsh Shandilya b3b8e7f509 app: add a reply button to comments view
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 03:23:11 +05:30
Harsh Shandilya a083230d06 app: parse description and comments the same way
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 03:07:03 +05:30
67f1c935ec Merge #206
206: Handle network errors in comments view r=msfjarvis a=msfjarvis

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-12 21:23:15 +00:00
Harsh Shandilya f14052800e Comments: show snackbar with error if we fail to get post
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 02:46:52 +05:30
Harsh Shandilya c409b72beb Comments: properly handle errors
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 02:33:44 +05:30
cbdb6c0934 Merge #205
205: Protect against database thrashing by paging r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-12 20:59:26 +00:00
Harsh Shandilya 8fc008bce9 app: update saved posts cache at ViewModel init
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 02:18:39 +05:30
Harsh Shandilya 654eb39877 app: de-duplicate paging sources
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 02:17:22 +05:30
Harsh Shandilya 8e67be7a35 BackupHandler: remove unused imports
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-13 02:08:25 +05:30
45d19a669e Merge #203
203: Update docs r=msfjarvis a=msfjarvis

bors merge

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-12 10:40:44 +00:00
Harsh Shandilya d0cbe2a27e Add more details to hacking.md
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-12 16:10:16 +05:30
Harsh Shandilya d86fda521f README: add distribution note
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-12 16:05:16 +05:30
be666be9a6 Merge #202
202: Force refresh post cache after importing saved posts r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 17:31:04 +00:00
Harsh Shandilya 1fe259a6f2 backup: update post cache in repository after import
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 22:58:02 +05:30
37c3c1cb84 Merge #201
201: Use secondary color variant for tag background r=msfjarvis a=msfjarvis

Fixes #200

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 17:11:02 +00:00
Harsh Shandilya 2b35f6bb9a LobstersItem: use secondary color variant for tag background
Fixes #200

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 22:40:39 +05:30
308489dc6c Merge #199
199: Deploy snapshots from develop merges r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 08:07:15 +00:00
Harsh Shandilya b0bd790141 app: set output file name
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 13:31:44 +05:30
Harsh Shandilya 53c96d21dd github: add snapshot deployment workflow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 13:31:44 +05:30
Harsh Shandilya acc21e207f secrets: add keystore
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 13:31:44 +05:30
Harsh Shandilya a7c55544c3 idea: MPP churn
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 13:31:43 +05:30
Harsh Shandilya b621a8ebd0 scripts: add secrets and snapshot helpers
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 13:31:43 +05:30
b431832c83 Merge #198
198: Add licence to README r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 06:47:24 +00:00
Harsh Shandilya 828a8bb212 README: add licence
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 12:16:01 +05:30
e4bcb276df Merge #187
187: Integrate comments natively r=msfjarvis a=msfjarvis

This is just the grunt work, the actual UI and integration is still left.

bors try

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-11 05:49:56 +00:00
Harsh Shandilya 4b5e4a43a3 app: refactor Submitter composables and re-use them in CommentsEntry
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 11:14:07 +05:30
Harsh Shandilya 216fee6757 idea: sync up with desktop multiplatform switch
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-11 10:50:11 +05:30
Aditya WasanandHarsh Shandilya 8e66ed043d feat: add comments ui
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-04-10 22:57:34 +05:30
Harsh Shandilya 1f60cf7d1c app: add view comments navigation action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:24 +05:30
Harsh Shandilya 02b61cd36a app: add post details methods to VM
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:24 +05:30
Harsh Shandilya 70e0b32265 app: add logging to API module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:24 +05:30
Harsh Shandilya 65c6f8ff52 app: add Comments UI composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:23 +05:30
Harsh Shandilya f37590f088 api: add tests for post details
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:23 +05:30
Harsh Shandilya e5ea28ea34 api: add getPostDetails method
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:23 +05:30
Harsh Shandilya a77e972b82 api: add models for post details
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:22 +05:30
Harsh Shandilya 56c4974803 api: rename Submitter to User
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 22:01:22 +05:30
6ec8fe035c Merge #196
196: Bump MoshiX to 0.10.0 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 16:25:03 +00:00
Harsh Shandilya 9287777b87 build: bump MoshiX to 0.10.0
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 21:51:52 +05:30
1abf793e19 Merge #195
195: Bump AGP and Gradle r=msfjarvis a=msfjarvis

bors try

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 16:06:03 +00:00
Harsh Shandilya e44b743016 build: bump AGP and remove unused lint dependency
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 21:22:08 +05:30
Harsh Shandilya 789dae907a build: use typesafe project accessors preview feature
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 21:20:44 +05:30
Harsh Shandilya de0d7b28f8 desktop: fix compat with Gradle 7.0
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 21:19:21 +05:30
Harsh Shandilya 19248c3a30 build: bump to Gradle 7.0
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-10 21:08:11 +05:30
cdb72b7789 Merge #194
194: Improve dependency organization r=msfjarvis a=msfjarvis

Also flesh out desktop packaging configuration

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-09 18:44:17 +00:00
Harsh ShandilyaandGitHub 4a51dc8d64 all: reorganize dependencies and improve desktop packaging
Signed-off-by: GitHub <noreply@github.com>
2021-04-09 18:43:45 +00:00
388014d62b Merge #193
193: Update JetBrains Compose r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-08 13:27:22 +00:00
Harsh Shandilya f5956aa44d build: bump JetBrains Compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-08 18:56:05 +05:30
1e09ce7a65 Merge #191
191: Update Compose, Dagger and KSP r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-08 00:46:15 +00:00
Harsh Shandilya 24990cde08 all: bump dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-08 06:15:33 +05:30
92ebb82a6a Merge #190
190: Sort build dependencies r=msfjarvis a=msfjarvis



Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-06 21:11:30 +00:00
Harsh Shandilya ad6d023f46 common: remove unnecessary dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-07 02:25:34 +05:30
Harsh Shandilya b0d5f65dfe build: bump AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-07 02:16:23 +05:30
Harsh Shandilya 50598cc3e7 build: remove JCenter repository
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-07 02:15:59 +05:30
Harsh Shandilya b3c1985d45 Revert "gradle: update to 7.0 RC1"
This reverts commit 1171fb17e6.
2021-04-07 02:15:44 +05:30
ad2bc470a1 Merge #188
188: Bump JetBrains Compose r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-06 09:37:23 +00:00
Harsh Shandilya 88ef01f129 build: bump Kotlin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-06 15:06:48 +05:30
Harsh Shandilya 5da858aa4c build: bump JetBrains Compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-06 14:41:15 +05:30
e50a8e8d68 Merge #165
165: Allow backup and restore of saved posts r=msfjarvis a=msfjarvis

Very much WIP, lacks essentially everything right now.


Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 10:03:10 +00:00
Harsh Shandilya b4069af1c7 app: move ByteArray interpolation to BackupHandler
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 15:15:53 +05:30
Harsh Shandilya 31fbc8c95c Options: manually close streams
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 15:14:14 +05:30
Harsh Shandilya cf5410622f app: integrate settings into main UI
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 15:13:50 +05:30
Aditya WasanandHarsh Shandilya ef09b241ea common/app: add Settings UI composables
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 15:13:47 +05:30
Harsh Shandilya a08109d745 app: add BackupHandler
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 15:00:57 +05:30
Aditya WasanandHarsh Shandilya d86d12f2db database: convert to multiplatform
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 15:00:54 +05:30
bc9ad69260 Merge #186
186: Simplify ordering logic r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 09:09:40 +00:00
Harsh Shandilya 314aba6d65 app: revise saved posts sorting logic again
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-03 14:38:16 +05:30
Aditya WasanandHarsh Shandilya 995eba2c11 gradle: fix incorrect sha256
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
(cherry picked from commit 59dbf417a57b0e7cda8aa5b0efbec68f58da0e05)
2021-04-03 14:04:04 +05:30
4e73075728 Merge #185
185: Preserve backstack in navigation r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 15:50:27 +00:00
Harsh Shandilya f785031ad8 LobstersApp: don't clear navigation backstack on going back
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 21:19:00 +05:30
9c10cb02b8 Merge #184
184: Fixup lingering formatting issues r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 10:56:53 +00:00
Harsh Shandilya 2ab4001a43 app: remove unnecessary constructor qualifications
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 16:25:21 +05:30
Harsh Shandilya 94afe3c15f app: remove lingering TODO
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 16:24:00 +05:30
d48d1c44ea Merge #183
183: Sort saved posts months as well r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 10:19:50 +00:00
Harsh Shandilya 0fbee213a3 app: sort months as well as posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 15:48:26 +05:30
d2c2c73eeb Merge #182
182: Reformat source tree with ktfmt r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 07:38:50 +00:00
Harsh Shandilya db07a12be5 all: reformat with ktfmt google style
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 13:06:49 +05:30
8448910628 Merge #181
181: Update JB Compose and Moshi r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 05:46:24 +00:00
Harsh Shandilya a33fc389e3 bors: don't want for screenshot testing
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 11:15:53 +05:30
Harsh Shandilya 5637d46488 build: update Moshi
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 10:45:03 +05:30
Harsh Shandilya 6d71154589 all: bump JB Compose to 0.4.0-build178
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-04-02 10:36:00 +05:30
Harsh Shandilya b6540b10b9 github: disable screenshot tests task
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 16:11:54 +05:30
Harsh Shandilya a182265077 app: disable all screenshot tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 16:09:41 +05:30
Harsh Shandilya 0e11815206 Merge remote-tracking branches 'origin/newest-posts' and 'origin/vendor-pulltorefresh' into develop
* origin/newest-posts:
  app: update screenshot tests
  app: add missing ui-tooling dependency
  app: add newest posts screen
  app: add support for fetching newest posts
  app: start qualifying infra for hottest posts
  app: rename HottestPosts to NetworkPosts
  api: add support for fetching newest posts

* origin/vendor-pulltorefresh:
  app: add missing ui-tooling dependency
  app: vendor PullToRefresh for Compose beta03 ABI compatibility
2021-03-29 16:07:38 +05:30
Harsh Shandilya 86455a2d46 app: update screenshot tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 13:41:09 +05:30
Harsh Shandilya abc5475bea app: add missing ui-tooling dependency
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:44:42 +05:30
Harsh Shandilya cabf13fb3a app: add missing ui-tooling dependency
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:25:58 +05:30
Harsh Shandilya 79b03a4907 app: add newest posts screen
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:25:57 +05:30
Harsh Shandilya fcd27863a1 app: add support for fetching newest posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:25:57 +05:30
Harsh Shandilya e3c5097035 app: start qualifying infra for hottest posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:25:57 +05:30
Harsh Shandilya b9c253733e app: rename HottestPosts to NetworkPosts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:25:56 +05:30
Harsh Shandilya 1d8c4a42a8 api: add support for fetching newest posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:25:56 +05:30
Harsh Shandilya 48f45beeeb app: vendor PullToRefresh for Compose beta03 ABI compatibility
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 12:19:29 +05:30
5c7f38c2dc Merge #175
175: Update all dependencies r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 05:44:33 +00:00
Harsh Shandilya c4e3b2f6dd app: update screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 05:43:33 +05:30
Harsh Shandilya f26e8be3f4 app: switch to accompanist-flowlayout
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 05:43:32 +05:30
Harsh Shandilya a42012a958 build: update AndroidX, Compose and Accompanist
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 05:43:32 +05:30
Harsh Shandilya 659676adc2 common/desktop: upgrade Jetbrains Compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 05:43:31 +05:30
2cb30deeda Merge #169
169: Update to Gradle 7.0-RC1 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-28 23:19:20 +00:00
Harsh Shandilya ff3b4c7a27 api: update KSP for Gradle 7.0-RC1 support
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 04:20:14 +05:30
Harsh Shandilya 1171fb17e6 gradle: update to 7.0 RC1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-29 04:19:50 +05:30
0052312459 Merge #177
177: Bump AGP r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-26 06:45:28 +00:00
Harsh Shandilya 826347023b build: bump AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-26 12:01:54 +05:30
f2ea2993cc Merge #176
176: Enable R8 full mode r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-25 11:25:27 +00:00
Harsh Shandilya be95d0c198 gradle: enable R8 full mode
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-25 15:37:30 +05:30
f6d8d3c536 Merge #174
174: Cleanup string abstraction and switch everything to it r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 06:55:17 +00:00
Harsh Shandilya 1abbd8baba common/app: migrate all string usages to common Strings API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 11:56:52 +05:30
Harsh Shandilya cad53dcce5 common: remove old string API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 11:56:51 +05:30
Harsh Shandilya 4016c22289 app: switch to extension API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 11:56:51 +05:30
Harsh Shandilya 56fd18be75 common: attempt extension backed string API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 11:56:51 +05:30
Harsh Shandilya 00c1977f87 common/app: rename StringEnum to Strings
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 10:43:47 +05:30
Harsh Shandilya b19a9267f6 common: link bug in code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 10:38:44 +05:30
Harsh Shandilya 5783210873 app: add sun.misc.Unsafe to proguard rules
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 10:34:18 +05:30
Harsh Shandilya f242ffb2af common: cleanup Gradle build
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-24 10:30:45 +05:30
60bf7ecde7 Merge #172
172: Abstract strings into common multiplatform library r=msfjarvis a=Skrilltrax

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>

Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 20:03:42 +00:00
Aditya Wasan c52f7812f1 cleanup: add newline at the end of the file
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-24 01:17:47 +05:30
Aditya Wasan 44d220b74c revertme: hack to make StringValue compile
Currently compose does not support default values with actual/expect functions.
When we use vararg it creates a default emptyArray if we do not provide an argument which causes the compose compiler to throw an ISE.
We can revert this commit once https://youtrack.jetbrains.com/issue/KT-44499 is merged.

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-24 01:08:29 +05:30
Aditya Wasan 13b3abdcd4 ui: use stringValue to get resources inside app module
This will not compile but still adding this so that we can revert the hack in-future and get it running correctly.

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-24 01:05:43 +05:30
Aditya Wasan 282da93630 build: enable androidResources for common module
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-24 00:25:47 +05:30
ccbcea162d Merge #171
171: Update Jetbrains Compose and pull-to-refresh r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 16:40:54 +00:00
Harsh Shandilya 5f227b2327 build: update deps
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 22:02:12 +05:30
Harsh Shandilya b233129c32 common: include androidMain resources directory
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 21:15:37 +05:30
Aditya WasanandHarsh Shandilya 01ffc49e18 common: add common stringValue api
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-23 21:15:37 +05:30
4a40192647 Merge #170
170: Add ability to change saved posts sorting order r=msfjarvis a=msfjarvis

Fixes #167

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 12:18:47 +00:00
Harsh Shandilya 08e8993101 Add tests for LobstersTopAppBar
(cherry picked from commit eee0737a1c)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 17:45:54 +05:30
Harsh Shandilya 3be1d2ad87 Wire in sorting preference awareness
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 17:42:14 +05:30
Harsh Shandilya 1408bee041 Wire in ability to toggle sorting order
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 17:41:58 +05:30
Harsh Shandilya 9bf5ee90ef Introduce and integrate ClawPreferences
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-23 17:40:30 +05:30
Harsh Shandilya 9e3f718ab9 Add DataStore dependency and set up injection
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-22 23:26:52 +05:30
b37707d933 Merge #168
168: Update to AGP 7.0.0-alpha10 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-22 16:49:48 +00:00
Harsh Shandilya ae1018f8c5 build: update AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-22 22:19:05 +05:30
faa6fbcc39 Merge #166
166: Refactor LobstersItem r=msfjarvis a=msfjarvis

Breaks apart PostDetails into multiple individual composables and reimplements the layout logic with a more easy to understand mental model.


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-21 19:10:24 +00:00
Harsh Shandilya 2b68bd82a4 LobstersItem: break avatar URL for test post
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-22 00:36:46 +05:30
Harsh Shandilya 88f44bd63b app: update screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-21 22:57:28 +05:30
Harsh Shandilya ced3aa44f1 Add tests for list of posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-21 22:57:12 +05:30
Harsh Shandilya 6f1a488b92 Rewrite LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-21 22:56:01 +05:30
b229f1b1dc Merge #164
164: Fix AVD name in emulator bootup script r=msfjarvis a=msfjarvis

It didn't fail in this repo because we stick to API 30 only but it's good to fix it anyway

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-20 13:12:24 +00:00
Harsh Shandilya 88a309712d scripts/boot_emulator: dynamically set AVD name
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-20 18:41:14 +05:30
3d93f9b04b Merge #163
163: Update scripts r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-20 12:44:02 +00:00
Harsh Shandilya f37682c154 scripts: import cleanups from APS
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-20 18:13:05 +05:30
4cd00a4b44 Merge #162
162: Refactor LobstersItem and add a dedicated comments button r=msfjarvis a=msfjarvis

Refer to updated screenshot test for the UI changes.

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 12:44:59 +00:00
Harsh Shandilya ce8d9f09fa app: update screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 16:26:07 +05:30
Harsh Shandilya 82707f8347 LobstersItem: tweak paddings
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 16:24:05 +05:30
Harsh Shandilya eae231722f LobstersItem: tweak paddings
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 16:02:40 +05:30
Harsh Shandilya f269c0ae08 app: rename LobstersItem parameters
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 15:18:22 +05:30
Harsh Shandilya 840361707a LobstersItem: add a dedicated comments button
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 15:17:32 +05:30
Harsh Shandilya dbab82c533 LobstersItem: adjust row weightage
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 15:04:40 +05:30
Harsh Shandilya fa605f5416 LobstersItem: split details and button to separate composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 14:57:57 +05:30
1983f1e864 Merge #161
161: Add missing R8 rules r=msfjarvis a=msfjarvis

Suggested by AGP 7.0.0-alpha10

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-18 21:27:29 +00:00
Harsh Shandilya cfc2680786 build: add missing R8 rules and sort
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-19 02:52:59 +05:30
7eb7ee81ba Merge #160
160: Switch to kotlin.test and move AndroidManifest r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-18 18:34:20 +00:00
Harsh Shandilya 420f792290 all: switch to kotlin.test for unit testing
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-18 23:56:28 +05:30
Harsh Shandilya 733fb5d96c common: move AndroidManifest to the correct source set
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-18 21:54:49 +05:30
640b64a407 Merge #158
158: Update dependencies r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-16 13:04:05 +00:00
Harsh Shandilya 0388010c8b build: remove unused dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-16 18:33:24 +05:30
Harsh Shandilya ab6816be62 build: update to AGP 7.0.0-alpha10
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-16 18:31:43 +05:30
1d3278f837 Merge #157
157: Reimplement CI testing infrastructure r=msfjarvis a=msfjarvis

bors try

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-16 10:11:15 +00:00
Harsh Shandilya ede879c550 github: restructure CI test setup
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-16 15:26:58 +05:30
ddc504eb05 Merge #156
156: Fix scroll crash r=msfjarvis a=msfjarvis

Fixes #155
bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-15 17:17:29 +00:00
Harsh Shandilya 8bf42fa46a Disable KMP warning
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-15 21:57:40 +05:30
Harsh Shandilya 879cb951a0 app: don't attempt to scroll if posts are loading
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-15 21:57:19 +05:30
3939706f42 Merge #154
154: Cleanups post desktop and common churn r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-14 18:32:31 +00:00
Harsh Shandilya f5c3a950bf common: make UrlLauncher use expect/actual
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-15 00:00:37 +05:30
Harsh Shandilya 3021f96465 common: cleanup duplicated Gradle configs
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-14 23:47:05 +05:30
Harsh Shandilya 117c063f78 desktop: fix kotlin directory
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-14 23:39:21 +05:30
10232720ae Merge #153
153: Use multiplatform compose r=Skrilltrax a=Skrilltrax



Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-14 17:33:34 +00:00
Aditya Wasan d2feeedec1 src: do not use same package name as the app
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-14 23:02:39 +05:30
Aditya Wasan 42f2b25f5c build: use org.jetbrains.compose artifacts
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-14 22:42:50 +05:30
Aditya Wasan c5360f264f bug: pass UrlLauncher type to LocalUrlLauncher
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-14 21:54:27 +05:30
Aditya Wasan 9517531388 build: setup compose multiplatform
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-14 21:54:27 +05:30
be282f3ac7 Merge #152
152: Add a desktop MVP r=msfjarvis a=msfjarvis

Unfortunately I haven't figured out yet how to share Compose code, so there is a lot of duplication happening here. We're also missing a lot of other things, but this is a good jumping off point

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-14 14:39:39 +00:00
Harsh Shandilya c5fafba7b5 desktop: sort everything under packages
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-14 20:01:45 +05:30
Harsh Shandilya 704e59afdf desktop: integrate with API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-14 19:57:10 +05:30
Harsh Shandilya be6e0c9498 desktop: initialize subproject
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-14 19:23:40 +05:30
2a543d3aad Merge #151
151: Use pull-to-refresh for reloading r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-12 21:16:22 +00:00
Harsh Shandilya 697e806dd8 app: switch to PullToRefresh
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-13 02:44:12 +05:30
Harsh Shandilya a28d5085bb app: remove LobstersTopAppBar
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 17:59:47 +05:30
4cac015176 Merge #150
150: Enable screenshot testing in CI and document the setup r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 11:28:16 +00:00
Harsh Shandilya ae1770e4ac Add a basic HACKING.md
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 16:57:31 +05:30
Harsh Shandilya a5a710cbb1 scripts: add boot_emulator.sh
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 16:38:25 +05:30
Harsh Shandilya 3d7172d664 Switch to Pixel XL profile
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 10:40:01 +05:30
Harsh Shandilya 68431d4a25 github: fix CI workflow to include screenshot tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 10:28:41 +05:30
5d5f602e80 Merge #149
149: Update AndroidX dependencies r=msfjarvis a=msfjarvis

bors r+ p=1000

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 04:38:08 +00:00
Harsh Shandilya aa6256b2d4 build: update all dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-11 10:05:51 +05:30
17ff1b4217 Merge #147
147: Better handle tag overflows r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-10 09:22:28 +00:00
Harsh Shandilya 7709665538 app: update screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-10 14:51:15 +05:30
Harsh Shandilya 00d15f5475 LobstersItem: improve TagRow reflow behavior
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-10 14:47:02 +05:30
23c4ca5d3f Merge #146
146: Update to AGP 7.0.0-alpha09 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-10 04:18:35 +00:00
Harsh Shandilya c048ecf9cf Supress false-positive Lint issue
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-10 09:48:01 +05:30
Harsh Shandilya d5e51366e9 build: upgrade to AGP 7.0.0-alpha09
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-10 09:30:42 +05:30
94eb5ce091 Merge #144
144: Update system bar colors r=msfjarvis a=Skrilltrax



Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-09 18:30:42 +00:00
055290f075 Merge #145
145: Brighten up secondary color for dark theme r=msfjarvis a=msfjarvis

bors r+ p=1000

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 18:16:48 +00:00
Harsh Shandilya 008c2171ff Brighten up secondary color for dark theme
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 23:46:04 +05:30
Aditya Wasan 835d5aee82 res: update system bar colors
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-03-09 23:30:52 +05:30
bdf5cb7a2e Merge #143
143: Use FlowLayout for TagRow and cleanup testing infra r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 14:47:01 +00:00
Harsh Shandilya 81bf27c13e Slightly improve header test
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 20:16:13 +05:30
Harsh Shandilya 8c8af56e67 app: update test screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 20:14:28 +05:30
Harsh Shandilya 418d1b22d6 build: set applicationIdSuffix for debug builds
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 20:13:45 +05:30
Harsh Shandilya 607e93e180 app: switch to FlowLayout for TagRow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 19:53:15 +05:30
08adc87493 Merge #142
142: Update Shot r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 06:15:22 +00:00
Harsh Shandilya d42adbf85d build: update shot
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 11:44:33 +05:30
6dc17f51ce Merge #141
141: Improve LobstersItem layout logic and make it easier to click save button r=msfjarvis a=msfjarvis

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 05:16:56 +00:00
Harsh Shandilya 87e0ede2be app: update screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 10:35:07 +05:30
Harsh Shandilya 330c3a6d22 LobstersItem: improve clickability of save icon
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-09 10:32:34 +05:30
6b53f132d5 Merge #140
140: Use a livelier loading animation r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-08 10:55:09 +00:00
Harsh Shandilya 08c511f854 posts: use a shimmering animation for loading posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-08 16:22:39 +05:30
00c6cbd7a6 Merge #138
138: Tweak month header design r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 19:39:50 +00:00
Harsh Shandilya 5718628d72 app: refresh UI test screenshots
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-06 01:08:05 +05:30
Harsh Shandilya 0ca4aadfb5 all: remove unneeded manifests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-06 00:58:35 +05:30
Harsh Shandilya 8e2d8fb89d build: upgrade to Shot 5.10.0
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-06 00:32:00 +05:30
Harsh Shandilya ce34b1173d Header: tweak design a bit
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-06 00:09:31 +05:30
790e785dd3 Merge #137
137: Add support for refreshing hottest posts r=msfjarvis a=msfjarvis

Fixes #133
bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 08:06:46 +00:00
Harsh Shandilya 97ac1033eb gitignore: add deployment target XML
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 13:35:21 +05:30
Harsh Shandilya eee0737a1c Add tests for LobstersTopAppBar
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 13:35:17 +05:30
Harsh ShandilyaandAditya Wasan 83af1e1c53 Don't inject paging source
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 13:35:16 +05:30
Harsh Shandilya 4585757ac2 app: add support for refreshing hottest posts list
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 13:35:16 +05:30
5990d27a07 Merge #136
136: Update android-emulator-runner r=msfjarvis a=msfjarvis

The emulator now runs with two cores so hopefully we'll see faster tests
bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 05:45:09 +00:00
Harsh Shandilya f80c3a0090 github: update emulator action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-05 11:14:09 +05:30
385fdd1fae Merge #135
135: Update to coroutines 1.4.3 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-04 04:24:31 +00:00
Harsh Shandilya 3a75dd75b5 build: upgrade coroutines to 1.4.3
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-04 09:34:00 +05:30
fc3238a618 Merge #132
132: Scope down coroutines r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-02 03:40:07 +00:00
Harsh Shandilya f7c6330910 LobstersApp: lower coroutine scope further in the view tree
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-02 09:08:17 +05:30
e53471f85e Merge #131
131: Update MoshiX r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-02 02:51:48 +00:00
Harsh Shandilya 4423d0f17f build: update MoshiX
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-03-02 08:02:27 +05:30
f10e2b79ac Merge #130
130: Split API and database models r=msfjarvis a=msfjarvis

- Introduces a new `SavedPost` table stripped down to only the necessary fields for persistence
- Deletes the old `LobstersPost` table
- Switches `LobstersItem` to take in a `SavedPost` for rendering
- Replaces moshi-metadata-reflect with moshi-ksp

Fixes #118 

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 15:29:33 +00:00
Harsh Shandilya 777ee3d408 github: add ci-gradle.properties
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:59:00 +05:30
Harsh Shandilya e440ac088b idea: regular churn
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:47:41 +05:30
Harsh Shandilya 7e7609ca1f build: force Moshi to latest version
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:47:41 +05:30
Harsh Shandilya fb2005fd83 all: switch to moshi-ksp
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:47:41 +05:30
Harsh Shandilya 7b87792d8a app: switch to new models
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:47:40 +05:30
Harsh Shandilya 9d684536a1 database: remove LobstersPost table
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:47:40 +05:30
Harsh Shandilya 75888c5ba6 database: add SavedPost table and switch tests to it
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:47:39 +05:30
Harsh Shandilya f76628574a api: separate API response model from database model
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 20:22:23 +05:30
b2d6dd6897 Merge #129
129: Fix system bars colors r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 10:15:19 +00:00
Harsh Shandilya b577ab01ae themes: set system bars colors to black
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 15:42:32 +05:30
ad75065848 Merge #128
128: Enable Auto Backup for database files r=msfjarvis a=msfjarvis

We persist saved posts in our SQLDelight database and while Android has been automatically doing backups, this makes it more explicit
bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 09:37:51 +00:00
Harsh Shandilya cf6ff4c315 manifest: turn on full backups
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 15:00:53 +05:30
58116fb451 Merge #127
127: Add regression test for month header r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 09:22:54 +00:00
Harsh Shandilya f15f609832 Add regression test for month header
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 14:52:24 +05:30
799dd5adbe Merge #126
126: Fix sticky header background being transparent r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 08:46:44 +00:00
Harsh Shandilya 582fb5ba93 header: fix unwanted transparency
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-28 14:15:37 +05:30
0f03ac28d8 Merge #124
124: Initial draft of screenshot testing setup r=msfjarvis a=Skrilltrax



Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-27 20:00:37 +00:00
Harsh Shandilya 4418404a71 github: use google_apis variant of emulator image
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 23:37:18 +05:30
Harsh Shandilya 8427cc52d8 github: remove unnecessary animation control
The action does it for us.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 23:29:28 +05:30
Aditya Wasan d6bda5c3d7 ci: use api level 30
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-27 23:28:32 +05:30
Aditya Wasan 9a79f3ba40 test: add more bottom nav tests
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-27 23:24:59 +05:30
d08855585a Merge #125
125: Update accompanist r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 17:49:56 +00:00
Harsh Shandilya 6c523d006b build: accompanist 0.6.1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 23:19:19 +05:30
Aditya Wasan 9185c0e36b chore: fix formatting
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-27 20:40:09 +05:30
Aditya Wasan 3013dcd9f3 Revert "github: disable unneeded emulator runner"
This reverts commit 5d74c6787f.
2021-02-27 20:37:39 +05:30
Aditya Wasan ce7abc7afb test: add screenshot test for LobstersBottomNav
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-27 20:32:29 +05:30
Harsh Shandilya f5bc2ebb59 Initial draft of screenshot testing setup
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 19:01:58 +05:30
5714ac881e Merge #123
123: Remove JCenter r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 12:50:09 +00:00
Harsh Shandilya 160ebcf7f5 build: add KotlinX Bintray repository
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 18:19:38 +05:30
Harsh Shandilya 8638868fb7 build: remove JCenter repository
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 18:09:36 +05:30
883c27885f Merge #122
122: Remove ConstraintLayout r=msfjarvis a=msfjarvis

Compose can handle nesting very well so CL is not a necessity.
bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 12:33:39 +00:00
Harsh Shandilya c2ee9032b9 build: remove ConstraintLayout dependency
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 18:02:16 +05:30
Harsh Shandilya ebc75bddca LobstersItem: reimplement with Rows and Columns
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 18:02:06 +05:30
5971163361 Merge #121
121: Add sticky headers to saved posts list r=msfjarvis a=msfjarvis

![Screenshot](https://i.imgur.com/QLAqRXk.png)

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 12:04:18 +00:00
Harsh Shandilya 639f814ef8 Add sticky headers to saved posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-27 17:33:42 +05:30
1733b3124d Merge #120
120: Update Hilt and Kotlin r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-26 05:00:47 +00:00
Harsh Shandilya f3e632078a build: upgrade to Hilt 2.33-beta
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-26 09:53:32 +05:30
b174c20faf Merge #119
119: Update AGP and Compose r=msfjarvis a=msfjarvis

bors r+
🤖

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-25 14:26:09 +00:00
Harsh Shandilya 5d74c6787f github: disable unneeded emulator runner
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-25 19:55:33 +05:30
Harsh Shandilya 095cb8d3a1 Remove BottomNavigationLayoutTest
Boss man Jim Sproch recommends we use screenshot testing rather than asserting on nodes
since they can change under us at any time as more optimisations come into play.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-25 19:54:43 +05:30
Harsh Shandilya f745ff3e91 github: don't run tests on merge to dev and use macOS runner
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-25 09:58:18 +05:30
Harsh Shandilya 8b976cee3c BottomNavigationLayoutTest: remove unneeded assertExists
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-25 09:57:08 +05:30
Harsh Shandilya 6e77a5e94b build: update to Compose 1.0.0-beta01
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-24 23:52:17 +05:30
Harsh Shandilya c8052be29a build: upgrade to AGP 7.0.0-alpha08
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-24 23:52:16 +05:30
7d83b9d86a Merge #116
116: Move all KAPT processing to app module r=msfjarvis a=msfjarvis

Reduces build times and allows sharing common code with JVM-only projects

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 12:24:15 +00:00
Harsh Shandilya b977113e34 api/database: switch to kotlin JVM plugin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 17:44:42 +05:30
Harsh Shandilya 027e3410d8 all: move all Hilt processing to app module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 17:44:41 +05:30
282cbf301a Merge #117
117: Update to Gradle 6.8.3 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 12:09:04 +00:00
Harsh Shandilya 75a83606f2 build: upgrade to Gradle 6.8.3
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 17:38:14 +05:30
cff16d17b5 Merge #115
115: Clarify unofficial nature of the client r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 11:30:13 +00:00
Harsh Shandilya 859ab94104 README: clarify unofficial nature
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 13:17:27 +05:30
b6390003b6 Merge #114
114: Only run CI on reviewed pull requests r=msfjarvis a=msfjarvis

Saves execution time and is just a safer option
bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 07:25:47 +00:00
Harsh Shandilya c4514ad4cd github: only run CI once approved
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-23 12:19:39 +05:30
e7360e07ab Merge #113
113: Revert BackdropScaffold r=msfjarvis a=msfjarvis

This was always a terrible idea lol

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-20 08:30:39 +00:00
Harsh Shandilya 875e4ea32c Revert "LobstersApp: replace with a BackgroundScaffold"
This reverts commit be58017cac.
2021-02-20 13:58:05 +05:30
Harsh Shandilya 72d51d5c52 Revert "app: remove now uneeded navigation code"
This reverts commit 41c64f4b02.
2021-02-20 13:58:01 +05:30
3d5ad28eb0 Merge #112
112: Update dependencies r=msfjarvis a=msfjarvis

bors r+
🤖

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-19 04:35:07 +00:00
Harsh Shandilya 7bb8c5b8f4 build: update AGP, MoshiX and JUnit
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-19 10:04:05 +05:30
a917917166 Merge #111
111: Switch to BackdropScaffold for the main screen r=msfjarvis a=msfjarvis

This is peak fanciness, we can't do any better

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-16 18:57:27 +00:00
Harsh Shandilya 5c39c481b7 app: add proguard rules for release builds
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-17 00:25:41 +05:30
Harsh Shandilya 66a2e9ef69 BaseProjectConfig: properly register clean task
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-17 00:15:19 +05:30
Harsh Shandilya 41c64f4b02 app: remove now uneeded navigation code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-17 00:11:48 +05:30
Harsh Shandilya be58017cac LobstersApp: replace with a BackgroundScaffold
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-17 00:10:28 +05:30
Harsh Shandilya d82228483d main: split out LobstersApp
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-16 23:54:16 +05:30
8f249ec2a2 Merge #110
110: Shorten Gradle project name r=msfjarvis a=msfjarvis

Just takes less horizontal space in the tree so what the hell

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-15 03:26:22 +00:00
Harsh Shandilya 5815afafb7 gradle: shorten project name
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-14 18:42:29 +05:30
6fd45a2608 Merge #109
109: Misc cleanups r=msfjarvis a=msfjarvis

bors r+
🤖

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-14 12:54:09 +00:00
Harsh Shandilya f30fd72778 app: remove unused methods
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-14 18:23:26 +05:30
Harsh Shandilya b455724b1c build: cleanup Plugin declarations
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-14 18:23:26 +05:30
ddafaa60eb Merge #108
108: Update AGP and cleanup formatting rules r=msfjarvis a=msfjarvis

bors r+
🤖

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-14 12:27:14 +00:00
Harsh Shandilya 9bf7a97e55 buildSrc: codestyle fixups
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-14 17:47:02 +05:30
Harsh Shandilya 7afff19fce build: update AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-14 17:33:30 +05:30
9f88bf15ab Merge #106
106: Decouple navigation from UI composables r=msfjarvis a=Skrilltrax

Navigation library recommends to decouple the navigation from the composables. They specially points to pass lambdas instead of passing the NavController directly.

https://developer.android.com/jetpack/compose/navigation#testing

Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-12 08:20:28 +00:00
Aditya Wasan 25b3ad4f8e Add test for BottomNavigationLayout
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-12 13:24:38 +05:30
Harsh ShandilyaandAditya Wasan 91cfb0b2d2 github: prep for running instrumentation tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-12 11:33:47 +05:30
Harsh ShandilyaandAditya Wasan 7da2cfd456 buildSrc: exclude duplicate license file from packaging
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-12 11:33:37 +05:30
Harsh ShandilyaandAditya Wasan 97eaf20dbc build(app): add compose testing dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-12 11:33:23 +05:30
Harsh Shandilya aff52e7d5f all: reformat
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-11 16:46:50 +05:30
Aditya WasanandHarsh Shandilya 1a6174b1c8 fix typo 2021-02-11 16:45:51 +05:30
Harsh Shandilya 98866ee407 Simplify getDestinationFromRoute
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-11 16:45:50 +05:30
Aditya WasanandHarsh Shandilya 703957e2b7 navigation: do not pass navController to composables
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-11 16:45:50 +05:30
baada58e8c Merge #107
107: Update dependencies r=msfjarvis a=msfjarvis

bors r+
🤖

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-11 10:59:21 +00:00
Harsh Shandilya 885c2a5865 build: upgrade to Compose 1.0.0-alpha12
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-11 16:28:34 +05:30
Harsh Shandilya 5fef8a4d51 build: replace JCenter with MavenCentral and drop JitPack
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-11 16:28:10 +05:30
40c4c425f6 Merge #105
105: Upgrade to Dagger 2.32 r=msfjarvis a=msfjarvis

bors r+
🤖

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-09 09:39:30 +00:00
Harsh Shandilya c0e0e53ee7 build: upgrade to Dagger 2.32
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-09 15:08:22 +05:30
Harsh Shandilya 2029ceeee0 build: upgrade to Dagger 2.32
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-09 15:08:01 +05:30
a9999aae2e Merge #104
104: Add icons for IDE project list r=msfjarvis a=msfjarvis

bors r+
🤖

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-08 08:57:05 +00:00
Harsh Shandilya b5a4787424 idea: add icons
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-08 14:21:58 +05:30
2b39717cab Merge #103
103: Dependency updates r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-08 08:45:46 +00:00
Harsh Shandilya 8f53a39f63 build: upgrade kotlin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-08 14:14:45 +05:30
Harsh Shandilya 020976e257 build: update remaining dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-08 14:14:44 +05:30
Harsh Shandilya cdfa20b9a7 build: upgrade to Compose alpha11
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-08 14:14:43 +05:30
Harsh Shandilya b87e242de2 build: remove gradle-versions-plugin
I use a Gradle init script for this now

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-08 13:13:02 +05:30
147f2d23a5 Merge #101
101: Fix cache issues r=msfjarvis a=Skrilltrax



Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-05 10:38:39 +00:00
Aditya Wasan 0fcf584b01 src: make LobstersRepository a singleton
Earlier both LobstersViewModel and LobstersPagingSource were getting a different instance of LobstersRepository.
This lead to cache issues where LobstersPagingSource filled the cache but it was not available to the LobstersViewModel.

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-02-05 15:00:23 +05:30
43361b3a2a Merge #102
102: Gradle build improvements r=msfjarvis a=msfjarvis


- Cleans up unnecessary dependencies
- Skips configuring Dagger on modules where it's not needed
- Hacks together a way to load buildSrc plugin dependencies from Kotlin sources

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-01 13:14:30 +00:00
Harsh Shandilya df1db3d0ff buildSrc: move plugin dependencies to Dependencies.kt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-01 18:43:52 +05:30
Harsh Shandilya 2a4c58a680 buildSrc: conditionally configure Dagger and disable kapt in tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-01 18:32:47 +05:30
Harsh Shandilya 0c1b20d3e7 buildSrc: remove unneeded AGP builder dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-02-01 18:25:30 +05:30
Aditya Wasan 9ce33bba75 src: add isCacheReady to let users know cache status
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 23:02:16 +05:30
23ec6ea9b1 Merge #75
75: Use SQLDelight instead of Room r=msfjarvis a=Skrilltrax

Deletes all the existing Room database code and replaces it with a simplified SQLDelight-backed implementation ready for Kotlin Multiplatform.

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 15:16:14 +00:00
Aditya Wasan 1946b1c333 build: remove ExperimentalStdlibApi compiler flag
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 19:13:58 +05:30
Aditya Wasan 1251ae3bc0 src: remove is_saved from LobstersPost and fix tests
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 18:49:49 +05:30
Aditya Wasan 6b3b35d4df src: manually pass submitterJsonAdapter to SubmitterAdapter
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 18:22:23 +05:30
Aditya Wasan 9e943c82b9 src: add hilt and update hilt modules
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 17:51:21 +05:30
Aditya Wasan 9c4c0b1e56 src: use IconToggleButton and add crossfade animation
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 17:23:26 +05:30
Aditya Wasan a5538ece8e src: add filename to AndroidSqliteDriver
SQLDelight creates a in-memory DB if the file name is null.

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 16:31:20 +05:30
Aditya Wasan 092599d167 src: add isSaved parameter to LobstersItem
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 16:17:08 +05:30
Aditya Wasan af72415952 build: remove kotlinReflect dependency
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 15:48:43 +05:30
Aditya Wasan a2c058877a src: add an in-memory map to cache db posts
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 15:44:39 +05:30
Harsh Shandilya d4ecf97436 Correctly set -Xopt-in=kotlin.RequiresOptIn on all modules
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-31 15:06:36 +05:30
Harsh Shandilya 49d9ceb73a app: cleanups
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-31 15:06:18 +05:30
Aditya Wasan 7c8cbc4b3f src: make dataSource non nullable
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 14:58:09 +05:30
Aditya Wasan ff4a2a751f src: fix is_saved logic
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-31 14:46:29 +05:30
Aditya WasanandHarsh Shandilya 6fdf1d0ca0 src(databse,buildSrc): remove kotlinReflect and opt into ExperimentalStdlibApi
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-30 12:51:17 +05:30
Aditya WasanandHarsh Shandilya 8303159abf src(api): use moshi-metadta-reflect
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-30 12:51:16 +05:30
Aditya WasanandHarsh Shandilya 0a6371b159 Revert "Revert "all: switch to moshi-kotlin and fix tests""
This reverts commit 602d11de35180d72fae9472b280d08af460d940f.
2021-01-30 12:51:16 +05:30
Harsh Shandilya c835a59cbf proguard(app): disable ProGuard inlining optimisations
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:51:16 +05:30
Harsh Shandilya 32bfdde04e Revert "all: switch to moshi-kotlin and fix tests"
This reverts commit da25dd2ed9bea50691b889e093ff896fea598b1a.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:51:15 +05:30
Aditya WasanandHarsh Shandilya f9fcb089a1 src: remove cache and simplify db logic
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-30 12:51:15 +05:30
Aditya WasanandHarsh Shandilya 3bcdcbdac7 Add LobstersRepo to handle DB operations
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-30 12:51:15 +05:30
Harsh Shandilya 4f9d0c09ef Make is_saved nullable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:51:14 +05:30
Aditya WasanandHarsh Shandilya ab3f112981 Use boolean for is_saved field
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2021-01-30 12:51:14 +05:30
Harsh Shandilya 740d9e432a all: switch to moshi-kotlin and fix tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:51:14 +05:30
Harsh Shandilya bca96ae215 app: switch to SQLDelight version of LobstersPost
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:51:13 +05:30
Harsh Shandilya b18de72bdd all: move model classes to database, rename model to api
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:50:09 +05:30
Aditya WasanandHarsh Shandilya 62d7590501 Add tests for SQLDelight database
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:50:08 +05:30
Aditya WasanandHarsh Shandilya f3b02e8fc2 database: add Post model
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:50:08 +05:30
Harsh Shandilya f17becff10 app: remove Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:50:07 +05:30
Harsh Shandilya 042b8f60d5 database: generate skeleton project
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-30 12:49:43 +05:30
2dfcc4de8f Merge #99
99: Tweak alignment and fixup build nits r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 08:17:44 +00:00
Harsh Shandilya 33b238c646 LobstersItem: extract hard-coded submitter text
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 13:45:13 +05:30
Harsh Shandilya a7bd050013 LobstersItem: use existing BASE_URL field
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 13:42:54 +05:30
Harsh Shandilya 5ab5d1ece7 LobstersItem: fix submitter name alignment with avatar
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 13:41:49 +05:30
Harsh Shandilya 07930d416d build(app): remove kotlinCompilerVersion
It is deprecated now

'ComposeOptions.kotlinCompilerVersion is deprecated. Compose now uses the kotlin compiler defined in your buildscript.'

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 13:38:30 +05:30
Harsh Shandilya 929816c342 Revert "gradle: disable problematic flag"
Fixed in AGP 7.0.0-alpha05

This reverts commit 6b85bc51de.
2021-01-28 13:26:56 +05:30
5cee5ad5d3 Merge #98
98: Dependency updates r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 06:35:31 +00:00
Harsh Shandilya 9d2a0acfcf build: upgrade Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 12:04:14 +05:30
Harsh Shandilya b2719a263f build: sync Dagger Hilt gradle plugin version with library
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 12:03:24 +05:30
Harsh Shandilya 3eead80cb4 build: upgrade AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-28 12:02:04 +05:30
9efc9d53a5 Merge #97
97: Resolve a couple Lint issues r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-26 05:47:30 +00:00
Harsh Shandilya 82b1887f6d app: remove identical icon
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-26 11:16:25 +05:30
Harsh Shandilya dee0c54fde app: rename UrlLauncherAmbient to appease Lint
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-26 11:16:24 +05:30
92cea96616 Merge #96
96: Remove unnecessary dependencies r=msfjarvis a=msfjarvis

Drops unused Jetpack libraries as well as custom tabs helper and upgrades Dagger Hilt

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-25 13:47:54 +00:00
Harsh Shandilya e1aa0e5bc6 app: remove customtabs dependency
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-25 19:15:51 +05:30
Harsh Shandilya 57a2f67646 build: pare down unnecessary Jetpack dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-25 18:58:57 +05:30
Harsh Shandilya 5f752ed251 build: upgrade Dagger
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-25 18:55:47 +05:30
2297eb0d1c Merge #95
95: Improve scroll semantics r=msfjarvis a=msfjarvis

Allows scrolling back to the top with a single tap as opposed to a fling

bors r+

Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-25 13:15:57 +00:00
Harsh Shandilya 7a8583e352 build: upgrade to Gradle 6.8.1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-25 18:45:32 +05:30
Harsh Shandilya 04658e99fd MainActivity: snap to top of list when pressing hottest posts tab
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-25 18:44:00 +05:30
Aditya WasanandHarsh Shandilya 7e7eff6c8e src: use launchSingleTop to prevent adding duplicate composables
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
(cherry picked from commit 45e3bd56855570db0f449ae5dde89dd46e4f2129)
2021-01-25 17:43:00 +05:30
2547d36254 Merge #94
94: Update AGP r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-18 13:23:55 +00:00
Harsh Shandilya 45c3ec504f all: reformat
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-18 18:53:18 +05:30
Harsh Shandilya 6b85bc51de gradle: disable problematic flag
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-18 18:51:51 +05:30
Harsh Shandilya 19c5bac6d3 all: use Dagger Hilt VM injection
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-18 18:51:51 +05:30
Harsh Shandilya e9a55cc1db buildSrc: introduce versioning plugin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-18 18:43:05 +05:30
Harsh Shandilya dc61aa07ac build: bump Dagger Hilt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-15 11:19:05 +05:30
Harsh Shandilya a36ca26720 build: update Jetpack and Accompanist
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-14 16:02:35 +05:30
Harsh Shandilya a4e0c90fe9 build: bump Gradle
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-09 15:59:22 +05:30
Harsh Shandilya bf46187d0a build: bump AGP and transitive dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2021-01-09 15:54:05 +05:30
119ceb258e Merge #93
93: Update dependencies and target Java 11 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-23 23:18:44 +00:00
Harsh Shandilya a737f7c7da build: upgrade material and accompanist
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-24 04:46:33 +05:30
Harsh Shandilya a4f05c744e build: target Java 11
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-24 04:45:47 +05:30
274f2d4c84 Merge #92
92: Refactor for configuration cache compatibility r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-20 11:42:19 +00:00
Harsh Shandilya 7c2528f4a7 build: refactor for configuration cache compatibility
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-20 17:11:37 +05:30
7d1b36c7fb Merge #91
91: Tweak ripple bounds and adjust R8 and AGP options r=msfjarvis a=msfjarvis


Setting padding in individual lists caused the ripple from LobstersItem to not draw to the edges, which was annoying to look at. Now we set the padding in LobstersItem itself and skip doing so in the individual list composables.

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-18 07:42:09 +00:00
Harsh Shandilya 156c58e544 app: increase horizontal padding in LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-18 13:10:29 +05:30
Harsh Shandilya 542b6c4e1a gradle: remove AGP suppression list
It's a pain to maintain and doesn't seem to be working either

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-18 13:08:23 +05:30
Harsh Shandilya 3cde52a3a5 app: silence proguard spam
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-18 13:07:04 +05:30
Harsh Shandilya 8abb5cbd3a app: remove extraneous padding from post lists
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-18 13:06:25 +05:30
47648f6e2d Merge #90
90: Update gradle property set r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 18:21:24 +00:00
Harsh Shandilya d0b2bbee15 gradle: sync properties with ReactiveCircus/streamlined
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 23:50:43 +05:30
c7f0eab9c2 Merge #88
88: Migrate away from kotlinx libraries r=msfjarvis a=msfjarvis

Both Ktor and Kotlinx.serialization have been extremely annoying to work with so I'm switching back to Retrofit and Moshi

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 06:36:46 +00:00
Harsh Shandilya e504a2c591 model: don't unit test against the live server
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 12:06:14 +05:30
Harsh Shandilya 76f613f82f gradle: disable R8 full mode
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 11:43:11 +05:30
Harsh Shandilya 623a9ffcb5 app: switch from kotlinx to square
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 11:43:11 +05:30
Harsh Shandilya 3641cd81cd model: switch from kotlinx to square
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 11:43:11 +05:30
Harsh Shandilya e93e6f0061 build: fix ui-test dependency name
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 11:08:22 +05:30
Harsh Shandilya d917f7c881 build: replace kotlinx dependencies with square ones
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 11:08:08 +05:30
461b466bb8 Merge #84
84: Switch to Paging Compose r=msfjarvis a=msfjarvis

~~Blocked on a Compose bug: https://issuetracker.google.com/issues/174839532~~ 
~~Fix is arriving in alpha09 (and 174826387 snapshot)~~ 
Available now

TODO: add back persistence layer

Fixes #47

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-16 20:21:32 +00:00
Harsh Shandilya 39e912bb7f build: upgrade to AGP 7.0.0-alpha03
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:19:00 +05:30
Harsh Shandilya 4922f3daf8 app: switch to LazyColumn
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:12:08 +05:30
Harsh Shandilya 60620eccec build: upgrade paging
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:11:10 +05:30
Harsh Shandilya 343f7e7f56 app: switch to Paging
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:11:09 +05:30
Harsh Shandilya d0d08f8a3c app: remove existing post loading
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:11:09 +05:30
Harsh Shandilya ada6a6f3ff app: add LobstersPagingSource
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:11:08 +05:30
Harsh Shandilya c29edfd402 model: import API related classes
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:11:08 +05:30
Harsh Shandilya f16d557138 idea: change test runner to Gradle
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 01:11:08 +05:30
4f871534b0 Merge #89
89: Upgrade dependencies r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-16 19:31:57 +00:00
Harsh Shandilya 1c6f6ad619 build: upgrade Activity, Compose, Navigation, and Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-17 00:58:53 +05:30
f55604f8fd Merge #87
87: Dependency updates r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-08 06:20:50 +00:00
Harsh Shandilya 09cb29c532 build: dependency updates
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-08 11:50:14 +05:30
e3a931fab4 Merge #86
86: build: bump to AGP 7.0.0-alpha02 r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-03 19:18:04 +00:00
Harsh Shandilya 6ee7682547 build: bump to AGP 7.0.0-alpha02
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-04 00:47:06 +05:30
24f1b1d377 Merge #85
85: Compose and Kotlin updates r=msfjarvis a=msfjarvis


Updates Compose to alpha08
Updates Kotlin and Kotlinx.serialization to 1.4.20
Updates Ktor to 1.4.2

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-02 20:25:48 +00:00
Harsh Shandilya f8b8ce0b5b all: update to Compose alpha08 and Kotlin 1.4.20
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-03 01:53:31 +05:30
6597f0058d Merge #83
83: Update AGP to 7.0.0-alpha01 r=msfjarvis a=msfjarvis

Also upgrades Gradle to 6.8-rc-1

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
2020-12-02 15:21:08 +00:00
Harsh Shandilya e06f5380a1 github: remove ci-gradle.properties
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-02 20:50:30 +05:30
Aditya WasanandGitHub c74079797a Update ci-gradle.properties 2020-12-02 20:42:30 +05:30
Harsh Shandilya 4f10e3f40a gradle: upgrade to 6.8-rc-1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-02 20:36:39 +05:30
Harsh Shandilya 52a87c10b5 github: hail mary
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-02 20:24:37 +05:30
Harsh Shandilya 04f0aa1a7a github: setup JDK 11 in PR workflow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-02 20:14:04 +05:30
Harsh Shandilya 9ca72341a8 buildSrc: add transitive AGP dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-02 20:09:22 +05:30
Harsh Shandilya 0588cceee0 build: uprev AGP and add AS version note to README
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-02 14:59:34 +05:30
3e7b1a1de8 Merge #82
82: Fix navigation backstack behaviour and make some minor tweaks r=msfjarvis a=msfjarvis

Fixes #66

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-01 16:39:35 +00:00
Harsh Shandilya 39d36eece6 ui: fix backstack behavior
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-01 22:06:13 +05:30
Harsh Shandilya 2b2acd1311 UrlLauncherAmbient: switch to staticAmbientOf
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-01 21:55:00 +05:30
Harsh Shandilya b5c039eaba injection: replace deprecated component
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-12-01 21:17:08 +05:30
8633908301 Merge #80
80: Upgrade dependencies and switch to Compose snapshot r=msfjarvis a=msfjarvis

~~Kotlin 1.4.20 needs the Compose snapshot but some dependency resolution bullshit is breaking it 🤷~~

Dropped the Kotlin 1.4.20 bump, sticking with 1.4.10 until a Compose update is out.

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-29 16:29:05 +00:00
Harsh Shandilya 425d6b7deb build: upgrade dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-29 21:56:46 +05:30
Harsh Shandilya a6da85d2e5 app: remove redundant JitPack inclusion
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-29 21:56:08 +05:30
fbbbacb121 Merge #81
81: Theme: add back a light palette r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-29 16:20:30 +00:00
Harsh Shandilya 5c0471d06e Theme: add back a light palette
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-29 21:49:41 +05:30
cf3ec3687c Merge #78
78: Switch to new adaptive icon r=msfjarvis a=msfjarvis

Designed by @SphericalKat

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-17 10:38:45 +00:00
Harsh Shandilya 398c7ef80c Change name to Claw for lobste.rs
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-17 16:07:59 +05:30
2da5d6c28d Merge #79
79: Update Gradle r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-17 08:17:26 +00:00
Harsh Shandilya 8960130548 build: update to Gradle 6.7.1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-17 13:46:31 +05:30
Harsh Shandilya b4ff025836 app: switch to new adaptive icon
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-12 15:58:28 +05:30
9eae76442f Merge #77
77: Dependency updates r=msfjarvis a=msfjarvis

Updates Compose, Accompanist, browser, core-ktx and drops some now deprecated artifacts. Also fixes a navigation bug that caused backstack to pop indefinitely even when on the same screen.

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-11 20:35:31 +00:00
Harsh Shandilya e5a6c97058 app: don't pop back stack if already on route
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-12 01:54:50 +05:30
Harsh Shandilya ff4dfcac61 treewide: update Compose and other deps
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-12 01:54:20 +05:30
d2bc068f95 Merge #74
74: BottomNavigation tweaks r=msfjarvis a=msfjarvis

Extracts the code into its own composable and slightly tweaks the UI to hide labels for inactive destinations. Blocked on #66

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-11 14:54:49 +00:00
Harsh Shandilya 2778c88d3a Add bottom padding to list composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-11 20:17:20 +05:30
Harsh Shandilya 5b66b440ce Separate out BottomNavigation to its own composable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-11 20:17:19 +05:30
7b4e8a8f68 Merge #76
76: Update dependencies r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-11 14:22:36 +00:00
Harsh Shandilya 587f40f79f build: update Ktor and gradle-versions-plugin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-11 19:51:58 +05:30
3cb1c4b027 Merge #73
73: Reimplement LobstersItem to not require swipe actions r=msfjarvis a=msfjarvis

Work towards #65

TODO:
- [x] ~~Figure out why only the last tag shows in the UI~~ Fixed by using `Row` to lay it out like earlier


<details>
<summary>Screenshot</summary>

![screenshot-20201109-113553](https://user-images.githubusercontent.com/13348378/98505720-ce2a4600-227f-11eb-8342-863f2122b928.png)


</details>

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-09 06:41:07 +00:00
Harsh Shandilya 5678215b25 Tweak lambda parameters for LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-09 11:45:05 +05:30
Harsh Shandilya 5acab43669 Rename LobstersItemRedux to LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-09 11:35:42 +05:30
Harsh Shandilya 974076c5f1 Remove LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-09 11:34:55 +05:30
Harsh Shandilya a4bac75d2a Replace ConstraintLayout-backed tag list with Row
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-09 11:34:39 +05:30
Harsh Shandilya a0a899f999 Make the preview look like an actual list
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 19:19:57 +05:30
Harsh Shandilya 92eecce9b0 Update KDoc
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 19:15:06 +05:30
Harsh Shandilya a9b5521dfe Check in a revamped LobstersPost composable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 19:09:03 +05:30
Harsh Shandilya be1921240a Remove swipe actions
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 17:25:10 +05:30
f602fe8d7d Merge #72
72: Migrate to Ktor for network operations r=msfjarvis a=msfjarvis

~~Still a work in progress, crashes during loading right now~~ Crashes are fixed and tests were added back, good to go now.

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 11:35:41 +00:00
Harsh Shandilya abe6c4c2b8 app: port tests to Ktor
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 17:04:23 +05:30
Harsh Shandilya d01a7e18a2 app: tweak proguard rules to fix crash
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:44:52 +05:30
Harsh Shandilya 276877119d app: reinstate API wrapper to hide client implementation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:41:02 +05:30
Harsh Shandilya 5b77fdf54b buildSrc: remove now unused dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:15:00 +05:30
Harsh Shandilya b71bb9e48d lobsters-api: remove
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:14:48 +05:30
Harsh Shandilya 05b5ecaa5f app: remove LobstersApi module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:14:27 +05:30
Harsh Shandilya f7e0ba6544 app: switch to loading posts using Ktor
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:13:41 +05:30
Harsh Shandilya 836b5ef725 app: add Ktor client module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:12:25 +05:30
Harsh Shandilya bc7eb9abaa idea: don't wildcard ktor imports
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 16:00:07 +05:30
Harsh Shandilya dd177c5578 buildSrc: add Ktor dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 15:53:46 +05:30
Harsh Shandilya 03b2bbd22c app: sort dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 15:44:05 +05:30
8729ad9cd1 Merge #71
71: Follow up on Gradle build rewrite r=msfjarvis a=msfjarvis

Adds back a dependency that was accidentally removed, and converts `settings.gradle` to Kotlin

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 09:19:20 +00:00
Harsh Shandilya fa9d964a32 Convert settings.gradle to Kotlin and enable Gradle metadata
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 14:47:57 +05:30
Harsh Shandilya dc12917b66 lobsters-api: add back accidentally removed Retrofit dependency
Fixes: 84f45f523a ("Replace Moshi with kotlinx.serialization")
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-08 14:46:06 +05:30
800c91c637 Merge #69
69: Replace Moshi with kotlinx.serialization r=msfjarvis a=msfjarvis

More work towards #67

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-07 05:49:58 +00:00
Harsh Shandilya c3e73256bf app: add R8 rules for kotlinx.serialization
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-07 11:18:10 +05:30
Harsh Shandilya 84f45f523a Replace Moshi with kotlinx.serialization
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-07 11:15:54 +05:30
Harsh Shandilya 43295a58eb build: add kotlinx.serialization dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-07 11:06:03 +05:30
10630944d3 Merge #68
68: Convert Gradle build configuration to Kotlin r=msfjarvis a=msfjarvis

First steps toward #67

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-06 12:00:00 +00:00
Harsh Shandilya 1e2fef884f build: convert to Gradle Kotlin DSL
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-06 17:28:26 +05:30
9839bf4014 Merge #63
63: Add more tests for Lobsters API and fix okhttp version r=msfjarvis a=msfjarvis

Downgrades OkHttp back to 3.14.9 because that's what Retrofit uses and using a higher version results in test failures for me when executed through the IDE. Also adds a couple more tests for the API data, and adds a `.git-blame-ignore-revs` file to skip some noisy commits that make `git-blame` that much useless.

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 08:23:58 +00:00
Harsh Shandilya dd680ecf70 git: add git-blame-ignored-revs file for noisy changes
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 13:51:16 +05:30
Harsh Shandilya 1528231032 lobsters-api: add some more tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 13:50:10 +05:30
Harsh Shandilya 6f5d88a5c1 build: downgrade OkHttp back to the retrofit version
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 13:44:00 +05:30
442293215c Merge #61
61: Revamp database setup r=msfjarvis a=msfjarvis

An assortment of database related changes

- Moved the `data` module into `app`
- Enabled schema generation for `PostsDatabase`
- Added and enabled [Roomigrant](https://github.com/MatrixDev/Roomigrant)
- Removed the now unused `LobstersPost#isLiked` field
- Bumped the database version to let Roomigrant handle the upgrade

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-01 20:22:48 +00:00
Harsh Shandilya ab2ba579d1 app: bump database version
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:48:55 +05:30
Harsh Shandilya c22ede7aa1 model: remove unused field
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:48:55 +05:30
Harsh Shandilya bfa4cd58a7 app: setup Roomigrant
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:48:54 +05:30
Harsh Shandilya 4b5c1e6d15 app: add roomigrant dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:48:54 +05:30
Harsh Shandilya f367c79e8e app: turn on schema generation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:48:53 +05:30
Harsh Shandilya c3cead5993 data: move into app module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:48:53 +05:30
713706caff Merge #60
60: Make saving a swipe action r=msfjarvis a=msfjarvis

~~This isn't ready yet, because when done we want to make this use just `Modifier.swipeable` and not actually dismiss the view.~~ Good to go now 


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-01 20:05:40 +00:00
Harsh Shandilya b84d6ac2ef model: add back unused variable for db compat
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:35:00 +05:30
Harsh Shandilya 78f15ac7d9 Use enum for swipe states
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:10:19 +05:30
Harsh Shandilya 3f223f4306 Remove liked post coloring from UI
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:07:12 +05:30
Harsh Shandilya a52c75601c Switch to Modifier.swipeable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 01:03:54 +05:30
Harsh Shandilya 8c162c75c5 Make saving a swipe dismiss action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-02 00:41:08 +05:30
bb8c07f232 Merge #59
59: Reorganize classes based on Buffer's package structure r=msfjarvis a=msfjarvis

Following the overview from [this post](https://buffer.com/resources/android-rethinking-package-structure/). I personally find myself agreeing with the reasoning behind these changes and can see the benefits.

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-01 18:01:48 +00:00
Harsh Shandilya 3d117362ef app: restructure files based on Buffer's package structure
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-01 23:29:08 +05:30
023601fd09 Merge #58
58: Fix Jetpack Compose link r=msfjarvis a=rleppink

The current link does not resolve because of the double `https://`

Co-authored-by: Ronald Leppink <rleppink@users.noreply.github.com>
2020-10-31 16:01:02 +00:00
Ronald LeppinkandGitHub 5b1c7cbf5c Fix Jetpack Compose link
The current link does not resolve because of the double `https://`
2020-10-31 16:51:24 +01:00
4f2c5b1909 Merge #57
57: Prepare for testing r=msfjarvis a=msfjarvis

Work towards #56

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-30 09:18:43 +00:00
Harsh Shandilya 779ad2f8b9 Make UrlLauncher a fun interface
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-30 14:47:47 +05:30
Harsh Shandilya b195c0d203 Make bottom nav icons part of destination classes
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-30 14:22:16 +05:30
Harsh Shandilya 41521cca95 Persist hottest list scroll state across navigation events
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-30 14:16:09 +05:30
Harsh Shandilya 108a28384c Extract viewModel references out of post list composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-30 14:11:25 +05:30
b641cab624 Merge #55
55: Only navigate when not on the current screen r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 12:10:19 +00:00
Harsh Shandilya b031d36fa2 Only navigate when not on the current screen
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 17:09:27 +05:30
97dc62afe1 Merge #54
54: Cleanup and reformat r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 11:29:57 +00:00
Harsh Shandilya e37d71fba6 Move hardcoded strings to resources
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 16:53:03 +05:30
Harsh Shandilya 1be10010c8 app: reformat XML resources
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 16:48:21 +05:30
Harsh Shandilya cec0e1bbcb gradle: reformat all build files with 2SI
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 16:38:01 +05:30
Harsh Shandilya 7c4e4aea26 Remove unused variable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 16:35:14 +05:30
60f6108d35 Merge #53
53: Fix pagination and extract UrlLauncherAmbient r=msfjarvis a=msfjarvis

Our pagination hack currently does not update the last index field which has now been fixed. While here we also take the time to extract UrlLauncherAmbient and prepare the post list composables for tweaking from the root UI

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 11:01:46 +00:00
Harsh Shandilya 43fb668c7d ui: Add Modifier params to [Hottest|Saved]Posts composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 16:27:12 +05:30
Harsh Shandilya ca77d3cf2a Move our UrlLauncherAmbient to individual composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 16:25:12 +05:30
Harsh Shandilya 906cfb5e43 Fix pagination
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 16:22:10 +05:30
20a38c662e Merge #52
52: Switch to BottomNav and use AndroidX navigation r=msfjarvis a=msfjarvis

This couldn't have been any easier to implement. Everything worked in the very first try, just amazing, amazing work from the Compose and Navigation teams.

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 09:33:17 +00:00
Harsh Shandilya 1aa0934104 Switch to BottomNav backed by AndroidX navigation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 14:59:54 +05:30
Harsh Shandilya 415d9e075d build: upgrade accompanist
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 14:57:30 +05:30
Harsh Shandilya df74ff587a build: add navigation-compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 14:18:54 +05:30
44dbcccd72 Merge #51
51: Upgrade Browser and Compose r=msfjarvis a=msfjarvis

bors r+


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 08:43:39 +00:00
Harsh Shandilya 195dcf3fd7 build: upgrade browser and compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-29 14:12:54 +05:30
ee9a10f39d Merge #50
50: Update coroutines and AGP r=msfjarvis a=msfjarvis

Updates AGP to 4.2.0-alpha15 that resolves the [AGP inlining bug](https://msfjarvis.github.io/notes/r8-inlining-bugs.html) and to coroutines 1.4.0 that brings performance improvements.


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 08:28:06 +00:00
Harsh Shandilya 188b15172f gradle: re-enable R8's full mode
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 13:56:21 +05:30
Harsh Shandilya d2604c7848 build: uprev coroutines
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 13:34:15 +05:30
Harsh Shandilya a50057d80c build: uprev AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 13:33:46 +05:30
8b28267b68 Merge #49
49: Setup for managing the repository via bors r=msfjarvis a=msfjarvis

Removes the automerge action, sets up PR checks to run on bors test branches, and adds the status checks TOML file that bors requires.


Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-27 23:27:46 +00:00
Harsh Shandilya fa281cb400 github: remove file check logic
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 04:57:01 +05:30
Harsh Shandilya 1e3b321dcf bors: init
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 04:54:49 +05:30
Harsh Shandilya 7b0f7639e9 github: run checks on pushes to staging and trying
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 04:54:48 +05:30
Harsh Shandilya 9d271eb932 github: remove automerge action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-28 04:45:26 +05:30
github-actions[bot]andGitHub 103332e087 Merge pull request #48 from msfjarvis/enable-proguard 2020-10-24 19:16:31 +00:00
Harsh Shandilya 405a60b09b gradle: disable R8 full mode
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-25 00:38:53 +05:30
Harsh Shandilya c903c7357a build: turn on minification
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-25 00:38:41 +05:30
github-actions[bot]andGitHub 3c34adad82 Merge pull request #46 from msfjarvis/dependency-updates 2020-10-24 09:07:06 +00:00
Harsh Shandilya 2970cc5061 gradle: uprev to Gradle 6.7
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-24 14:34:25 +05:30
Harsh Shandilya a2e71ee52a build: update dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-24 14:30:50 +05:30
Harsh Shandilya 661d10d256 build: add dependency updates plugin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-24 14:23:38 +05:30
Harsh ShandilyaandGitHub 85a5c829e0 Merge pull request #43 from Skrilltrax/develop 2020-10-19 00:31:11 +05:30
Harsh Shandilya 5782ae9438 Revert "Pass correct variable to EmptyList"
This is wrong and causes the saved posts message to be shown on both screens.

This reverts commit d93910ba5a.
2020-10-19 00:26:55 +05:30
Harsh Shandilya 600c93ed0f Replace material icons with drawable resources
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-19 00:25:19 +05:30
Aditya Wasan a38a52ebf3 Use transformLikedFlag in savePost method
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2020-10-19 00:24:30 +05:30
Harsh Shandilya dc83ad2dee Update liked state when removing a saved post as well
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-19 00:20:37 +05:30
Aditya Wasan d93910ba5a Pass correct variable to EmptyList
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2020-10-19 00:09:45 +05:30
Harsh Shandilya c54b375c06 Liked flag toggle should go both ways
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 23:28:33 +05:30
Harsh Shandilya e35a25b135 Simplify API of child components
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 23:26:28 +05:30
Harsh Shandilya b4df9d87d8 Allow reusing save action to remove from saved list
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 23:14:31 +05:30
Harsh Shandilya 0336af0624 Set liked flag on first load
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 23:05:59 +05:30
Harsh Shandilya 1021604889 data: add method to check if a post is already liked
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:58:51 +05:30
Harsh Shandilya 204e8d1b2b Cleanup formatting
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:47:51 +05:30
Harsh Shandilya 9f32f3a025 Merge branch 'develop' into Skrilltrax/develop
* develop:
  github: switch gradle-cache-action back to tag qualifier
  github: update actions in pull request workflow
  github: update automerge action
  gradle: silence warnings from beta options
  app: replace deprecated contentColor extension
  build: update Compose and Room
2020-10-18 22:37:29 +05:30
github-actions[bot]andGitHub 41dc71cf80 Merge pull request #45 from msfjarvis/update-actions 2020-10-18 17:02:37 +00:00
Harsh Shandilya 646ab03660 github: switch gradle-cache-action back to tag qualifier
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:28:58 +05:30
Harsh Shandilya f3107ed19a github: update actions in pull request workflow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:24:54 +05:30
Harsh Shandilya 978d373893 github: update automerge action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:22:38 +05:30
Harsh ShandilyaandGitHub a6fe748b01 Merge pull request #44 from msfjarvis/update-dependencies 2020-10-18 22:17:56 +05:30
Harsh Shandilya db26f4dbd9 gradle: silence warnings from beta options
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:13:37 +05:30
Harsh Shandilya d8435602d3 app: replace deprecated contentColor extension
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:12:46 +05:30
Harsh Shandilya 53643c9c5a build: update Compose and Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-18 22:03:52 +05:30
Aditya Wasan d6d82248a8 Add saved lists feature
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2020-10-18 16:03:07 +05:30
Aditya Wasan 3bd3f2dff8 Add saved entity and dao
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2020-10-18 12:19:21 +05:30
Harsh ShandilyaandGitHub 8cf2dfc71b Merge pull request #41 from msfjarvis/ui-tweaks 2020-10-10 19:22:50 +05:30
Harsh Shandilya b7dc92d85a app: tweak first load behavior
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-10 17:58:14 +05:30
Harsh Shandilya bd5647f4c7 app: reword loading state text
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-10 17:58:02 +05:30
Harsh Shandilya b28eb09e3f app: add a FAB to reload posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-10 17:57:35 +05:30
Harsh Shandilya 9d22682626 res: remove unused drawable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-10 17:37:42 +05:30
Harsh Shandilya 0dabcec67c MainActivity: remove unneeded injected field
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-10 17:29:08 +05:30
probot-auto-merge[bot]andGitHub 3c21002d32 Merge pull request #40 from msfjarvis/more-ui-tweaks
Multiple improvements across the board
2020-10-07 20:10:42 +00:00
Harsh Shandilya 20e45d4d42 urllauncher: request dark theme from sites
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 01:36:14 +05:30
Harsh Shandilya da13725bea app: swallow more errors in view model
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 01:20:50 +05:30
Harsh Shandilya 43c7bcced0 app: rewrite theming to use a dark palette
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 01:18:19 +05:30
Harsh Shandilya 07d46605c7 github: tweak workflows and remove unused cruft
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 01:13:43 +05:30
Harsh Shandilya daa3d07f7a app: drop border and make tags rounded
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 01:02:58 +05:30
github-actions[bot]andGitHub 729f59ba96 Merge pull request #39 from msfjarvis/user-avatars 2020-10-07 19:28:58 +00:00
Harsh Shandilya 7da14338f9 app: add user avatars to items
Uses Chris Banes' amazing Accompanist library to interface with Coil and load images
with minimum hassle. The resultant UI has been made to loosely resemble https://lobste.rs
since our end goal is to fully match the website.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 00:51:59 +05:30
Harsh Shandilya cc73774085 github: add automerge action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 00:51:29 +05:30
Harsh ShandilyaandGitHub 6c83385af7 Merge pull request #38 from msfjarvis/gradle-cleanup
build: extract all versions to ext
2020-10-08 00:48:36 +05:30
Harsh Shandilya 196940778f build: extract all versions to ext
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-08 00:22:12 +05:30
Harsh ShandilyaandGitHub 7544eb96fc Merge pull request #37 from msfjarvis/comments-only
Fallback to comments if post has no URL
2020-10-06 19:08:52 +05:30
Harsh Shandilya 0da85ba015 app: fallback to comments if post has no url
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-06 18:53:57 +05:30
Harsh ShandilyaandGitHub 78484de959 Merge pull request #36 from msfjarvis/custom-tabs-update 2020-10-03 02:19:48 +05:30
Harsh Shandilya 829a6bbdc6 UrlLauncherImpl: use AndroidX Browser methods to launch custom tab
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-03 02:08:22 +05:30
Harsh ShandilyaandGitHub f71bd27a03 Merge pull request #35 from msfjarvis/update-followups 2020-10-03 02:08:10 +05:30
Harsh Shandilya 89aeb66a96 LobstersItem: replace ListItem with Column
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-03 01:59:26 +05:30
Harsh ShandilyaandGitHub a4eb6b3cb3 Merge pull request #34 from msfjarvis/dependency-updates 2020-10-02 13:20:25 +05:30
Harsh Shandilya a2eb97e504 build: update all dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-02 04:40:59 +05:30
Harsh ShandilyaandGitHub bab3a53a53 Merge pull request #32 from msfjarvis/first-load
Clear local cache of posts on first load
2020-09-28 11:07:15 +05:30
Harsh Shandilya 837970147c app: add local cache busting
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-28 11:03:32 +05:30
probot-auto-merge[bot]andGitHub 0ecf21467b Merge pull request #31 from msfjarvis/offline-cache
Set up offline caching and no posts state
2020-09-27 11:44:40 +00:00
Harsh Shandilya 62c2cb3fb7 app: add no posts state
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 16:44:39 +05:30
Harsh Shandilya 4fdb5a60d5 app: wire in local persistence in LobstersViewModel
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 16:24:36 +05:30
Harsh Shandilya 95334d2c8b data: ignore overwriting when inserting posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 16:23:41 +05:30
probot-auto-merge[bot]andGitHub 6867d84ca9 Merge pull request #27 from msfjarvis/comments
Add comment open action and cleanup unused code
2020-09-27 09:05:19 +00:00
Harsh Shandilya baddf7e763 app: remove unused resources
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 14:29:04 +05:30
Harsh Shandilya c21a2bf13a app: add comment open action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 14:14:12 +05:30
Harsh Shandilya ac336efa33 app: restrict tags to just the first 4
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 14:08:41 +05:30
Harsh Shandilya 52e010d79b app: remove unnecessary Column from LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 14:00:26 +05:30
Harsh Shandilya 91205a0b2a data: cleanup unused code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 13:42:39 +05:30
probot-auto-merge[bot]andGitHub a510565324 Merge pull request #26 from msfjarvis/leaky-abstractions
Cure a case of leaky abstractions with sad indirection
2020-09-27 05:02:55 +00:00
Harsh Shandilya 3693bc39f4 model: remove Room annotations and unused dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 10:28:36 +05:30
Harsh Shandilya aa7a732cce data: wrap LobstersPost into an intermediate entity
This lets us keep the same database structure without needing to leak Room-specific properties into our model

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 10:28:22 +05:30
Harsh Shandilya 8d4535d6bf build: uprev to Gradle 6.7 RC2
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-27 10:24:27 +05:30
probot-auto-merge[bot]andGitHub d6b4f2c682 Merge pull request #25 from msfjarvis/ui-work
Perf and UX improvements
2020-09-25 09:40:37 +00:00
Harsh Shandilya 1ba1701574 app: rewrite UrlLauncherImpl to use Chrome Custom Tabs
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-25 15:05:52 +05:30
Harsh Shandilya b30ab6a537 Revert "app: use ConstraintLayout for laying out LobstersItem"
Won't solve the problem I was hoping to solve.

This reverts commit a14484583d.
2020-09-25 14:35:10 +05:30
Harsh Shandilya 8462e5c763 app: pass --user 0 to ADB when installing
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-25 12:10:55 +05:30
Harsh Shandilya 0db3502855 build: use release signing for debug builds as well
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-25 02:36:14 +05:30
Harsh ShandilyaandGitHub c300a85204 Merge pull request #24 from msfjarvis/ui-improvements 2020-09-25 02:35:05 +05:30
Harsh Shandilya a14484583d app: use ConstraintLayout for laying out LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-25 02:25:47 +05:30
Harsh Shandilya b68eda3051 app: tweak padding for tags and add border
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-25 02:04:33 +05:30
Harsh Shandilya 36804a43bc app: re-enable preview for LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-25 01:55:01 +05:30
Harsh ShandilyaandGitHub 2f70acd5d0 Merge pull request #23 from msfjarvis/row-ui-tweaks
Use consistent vertical padding
2020-09-24 05:08:42 +05:30
Harsh Shandilya 2d649d70be app: use consistent vertical padding and reword submitter text
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-24 04:47:56 +05:30
Harsh ShandilyaandGitHub 7b42915a1b Merge pull request #22 from msfjarvis/pagination-prep 2020-09-23 22:17:13 +05:30
Harsh Shandilya 590bd2dfd8 app: enable kotlinx.coroutines.ExperimentalCoroutinesApi for entire module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 22:14:20 +05:30
Harsh Shandilya 22abaa15c2 model: add default value for submitter karma
The API sometimes doesn't pass this value

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 22:09:15 +05:30
Harsh Shandilya e1c9b34bbe app: setup pagination and a viewmodel for posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 22:06:56 +05:30
Harsh Shandilya 5260f454ef build: add lifecycle-viewmodel-ktx
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 21:35:53 +05:30
Harsh Shandilya b3ee3f44c4 build: commonize application of kotlin-android plugin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 17:19:11 +05:30
Harsh Shandilya 64ac515ed0 build: force correct coroutines and kotlin-reflect artifacts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 17:19:10 +05:30
Harsh Shandilya 29e72da327 app: add persistence module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 17:19:10 +05:30
Harsh Shandilya 96c25c428d data: add database for lobsters posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 17:19:10 +05:30
Harsh Shandilya 699a475315 app: use lifecycleScope for fetching posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 17:19:09 +05:30
Harsh Shandilya e7860e4f55 api: add support for pagination
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 17:19:09 +05:30
probot-auto-merge[bot]andGitHub 93985ee02d Merge pull request #21 from msfjarvis/rewire-api
Use retrofit suspend support to hide implementation details of API
2020-09-23 09:04:15 +00:00
Harsh Shandilya 0806d71e96 lobsters-api: fix tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 14:32:01 +05:30
Harsh Shandilya a66186adc3 all: use retrofit suspend support to hide implementation details of API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 13:48:37 +05:30
Harsh ShandilyaandGitHub a3b1e02783 Merge pull request #20 from msfjarvis/pivot-to-lobsters 2020-09-23 04:03:26 +05:30
Harsh Shandilya 4a507e4d79 all: cleanup
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 04:00:57 +05:30
Harsh Shandilya 8808e0dfb8 github: only run unit tests in CI
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 03:58:45 +05:30
Harsh Shandilya 9a00122525 README: init
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 03:54:34 +05:30
Harsh Shandilya ff775176a6 app: steal lobste.rs logo for app icon
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 03:51:16 +05:30
Harsh Shandilya 38943a74d5 app: tweak post list UI
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 03:45:15 +05:30
Harsh Shandilya 63172ad79b build(app): add signing configuration
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 03:35:40 +05:30
Harsh Shandilya 06549bad2c all: remove now unused to-do app code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 03:32:32 +05:30
Harsh Shandilya 63f5bea155 app: implement first draft of lobste.rs UI
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 03:29:21 +05:30
Harsh Shandilya 6e4a9c6a73 app: refactor theming and naming
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 02:53:19 +05:30
Harsh Shandilya 2c0cadf296 build: bump AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-23 02:26:18 +05:30
Harsh Shandilya 54a0cd2b50 model: annotate for Room compatibility
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-22 13:50:18 +05:30
Harsh Shandilya 4a363200a0 model: init
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-22 13:47:06 +05:30
Harsh Shandilya ee07f8391c app: add API module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-22 05:33:30 +05:30
Harsh Shandilya 7489100c26 lobsters-api: init
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-22 05:33:18 +05:30
Harsh Shandilya 7bb1fd6947 all: refactor package structure and naming
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-22 04:20:25 +05:30
probot-auto-merge[bot]andGitHub c8081da596 Merge pull request #19 from msfjarvis/gradle-props
build: update gradle properties
2020-09-19 16:59:52 +00:00
Harsh Shandilya b970cfb305 build: update gradle properties
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-19 22:21:26 +05:30
probot-auto-merge[bot]andGitHub cf2ce55d02 Merge pull request #18 from msfjarvis/swipe-dismiss
Add swipe dismiss
2020-09-19 00:43:15 +00:00
Harsh Shandilya a847a110c7 Wire in AnimatedSwipeDismiss into UI
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-19 05:45:20 +05:30
Harsh Shandilya 3201bfe507 ui: import AnimatedSwipeDismiss code from Brandon McAnsh
Source: https://gist.github.com/bmc08gt/fca95db3bf9fcf255d76f03ec10ea3f9
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-19 05:35:46 +05:30
Harsh Shandilya c8d2de60bb build: bump AGO to 4.2.0-alpha11
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-19 05:19:52 +05:30
Harsh ShandilyaandGitHub 9df4d5f381 Merge pull request #17 from msfjarvis/update-compose
build: update Compose
2020-09-17 03:11:40 +05:30
Harsh Shandilya c75955a4a3 Update tests for Compose alpha03
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-17 02:06:43 +05:30
Harsh ShandilyaandGitHub 43e9b000d9 build: update Compose 2020-09-17 01:46:04 +05:30
probot-auto-merge[bot]andGitHub 35bec0bed2 Merge pull request #16 from msfjarvis/optimize-for-urls
Optimize UI and UX for URLs
2020-09-13 22:05:20 +00:00
Harsh Shandilya d84d99632e Ignore tests because what the actual fuck
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-14 03:26:03 +05:30
Harsh Shandilya 0eb4f74e36 Provide UrlLauncher through Ambient
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-14 00:12:03 +05:30
Harsh Shandilya 44393643c9 idea: tweak codestyle
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-14 00:12:03 +05:30
Harsh Shandilya 1a1410eb1c Add and implement UrlLauncher
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-14 00:12:03 +05:30
Harsh Shandilya 34ba71e229 Revamp UI for supporting a new click action
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-13 23:48:03 +05:30
Harsh Shandilya 1c05556d98 Disable jetifier
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-13 23:42:20 +05:30
Harsh Shandilya 94258b8d97 MainActivity: drop hardcoded top appbar title
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-13 23:24:52 +05:30
Harsh ShandilyaandGitHub 00310914da Merge pull request #15 from msfjarvis/dagger-hilt
Switch to Dagger Hilt for dependency injection
2020-09-11 23:49:54 +05:30
Harsh Shandilya d42657b0a5 app: switch to Hilt for dependency injection
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-11 23:38:03 +05:30
Harsh Shandilya 57f7a72d8d build: add Hilt dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-11 23:38:03 +05:30
Harsh ShandilyaandGitHub 36474b9705 Merge pull request #14 from msfjarvis/dependency-updates 2020-09-11 23:37:42 +05:30
Harsh Shandilya 048e0d01de github: run pull requests on both API 23 and 29
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-11 23:19:49 +05:30
Harsh Shandilya a2cb0f073c build: move library desugaring to app module for runtime compatibility
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-11 23:18:17 +05:30
Harsh Shandilya 67a8826d24 build: remove unnecessary deps
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-11 23:10:58 +05:30
Harsh Shandilya e3301801b7 build: update Kotlin and AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-11 23:10:40 +05:30
Harsh Shandilya 4ec76766d0 build: update to Gradle 6.7 RC1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-11 22:51:48 +05:30
probot-auto-merge[bot]andGitHub b3008e99dc Merge pull request #13 from msfjarvis/modularization
Modularize data package
2020-09-08 01:20:21 +00:00
Harsh Shandilya 1f76a177fe build: commonize Gradle configurations
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 06:42:47 +05:30
Harsh Shandilya 19817bf254 Move data package to its own module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 06:35:38 +05:30
probot-auto-merge[bot]andGitHub b5a3d6489b Merge pull request #12 from msfjarvis/testing
Increase test surface to cover more cases
2020-09-08 00:40:10 +00:00
Harsh Shandilya 272f0d1d99 Add test to ensure new item is not added if name is empty
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 06:01:57 +05:30
Harsh Shandilya 0ccd3b353d Add test to ensure new item is added correctly
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 06:01:57 +05:30
Harsh Shandilya e0e28b5e35 Add test to check item add dialog is shown
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 06:01:57 +05:30
Harsh Shandilya 48b3b83cae Set test tag on ItemAddDialog
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 06:01:56 +05:30
Harsh Shandilya 2407a0125e probot-auto-merge: delete merged branches
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 06:01:27 +05:30
probot-auto-merge[bot]andGitHub 865b01c93b Merge pull request #11 from msfjarvis/dialog-improvements
Correctly enable now-fixed theming and tweak dialog layout
2020-09-08 00:26:42 +00:00
Harsh Shandilya 34ce5e9448 Tweak item addition dialog layout
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 05:44:01 +05:30
Harsh Shandilya 8df3db3607 TodoTheme: remove typography customizations
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 05:36:30 +05:30
Harsh Shandilya b7124e5bda TodoTheme: wire in customized elements
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-08 05:35:26 +05:30
probot-auto-merge[bot]andGitHub 57d6855c78 Merge pull request #10 from Skrilltrax/fix-theme
Fix theme colors
2020-09-07 06:45:06 +00:00
Harsh Shandilya 64cc897f1a Add missing import
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-07 12:09:24 +05:30
Aditya Wasan caa2811c0a Fix theme colors
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2020-09-07 11:42:26 +05:30
probot-auto-merge[bot]andGitHub c43e8b6b41 Merge pull request #9 from msfjarvis/custom-names
Allow providing names for items
2020-09-06 17:42:24 +00:00
Harsh Shandilya 3ed1cdb261 TodoTheme: use default colors but with system theme awareness
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-06 23:05:09 +05:30
Harsh Shandilya bfd060e66e TodoTheme: strip out all custom theming
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-06 22:55:46 +05:30
Harsh Shandilya 91fc3aa9fa all: reformat
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-06 22:49:05 +05:30
Harsh Shandilya 153f94715d MainActivity: allow setting a custom name for the item
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-06 22:48:38 +05:30
Harsh Shandilya e8719f3796 build: update testing libraries
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-06 21:29:03 +05:30
Harsh Shandilya f73d75dd6a editorconfig: init
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-06 21:01:51 +05:30
probot-auto-merge[bot]andGitHub 6a3ede9102 Merge pull request #8 from msfjarvis/dependency-updates
Update compose and AGP
2020-09-03 06:22:51 +00:00
Harsh Shandilya b4aef5d14d Update compose and AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-03 11:44:26 +05:30
probot-auto-merge[bot]andGitHub 32f8ea31e2 Merge pull request #7 from msfjarvis/restore-preview
Separate out item loading to enable host previews again
2020-08-30 12:34:30 +00:00
Harsh Shandilya 841759ddd8 REVERTME: copy preview code into tests
We wanna better mimic real behavior as opposed to this broken preview.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-30 17:55:18 +05:30
Harsh Shandilya bd6f7583c8 Borrow some improvements from my previous attempt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-30 16:46:57 +05:30
Harsh Shandilya 0c3b1d388f Separate out item loading to enable host previews again
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-30 16:38:55 +05:30
probot-auto-merge[bot]andGitHub 778faf2950 Merge pull request #6 from msfjarvis/test-improvements
Switch to createComposeRule
2020-08-30 10:29:16 +00:00
Harsh Shandilya 4581705d56 Switch to createComposeRule
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-30 15:58:07 +05:30
Harsh ShandilyaandGitHub 001fdab48b Merge pull request #5 from msfjarvis/persistence 2020-08-27 22:27:49 +05:30
Harsh Shandilya 6c5778e547 Fix tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 21:39:52 +05:30
Harsh Shandilya 2450512059 Drop default item checks from tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 21:10:30 +05:30
Harsh Shandilya bb80b42426 Add delete operation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 21:02:48 +05:30
Harsh Shandilya 717eefad97 Switch over persistence to Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:59:35 +05:30
Harsh Shandilya 644a8a6110 Create a rudimentary DI container for Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:59:35 +05:30
Harsh Shandilya 3d8935dc2b Add backing infra for Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:59:34 +05:30
Harsh Shandilya e16b4cb82d Enable desugaring of core library elements
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:59:34 +05:30
Harsh Shandilya 5ce951d599 Update TodoItem for Room
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:59:33 +05:30
Harsh Shandilya 0b5d7a1624 Add room dependencies and sort
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:56:41 +05:30
Harsh Shandilya e256d988fc Update test dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:56:41 +05:30
Harsh Shandilya 25ca5d52b2 Drop extra dependencies and host icon in-app
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 20:56:40 +05:30
Harsh Shandilya e6942fe353 Mark TodoItem as Immutable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 15:18:42 +05:30
Harsh Shandilya f9e17678b0 Relocate TodoItem class
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 15:17:47 +05:30
Harsh Shandilya f385504c30 Separate out preview composable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 15:04:42 +05:30
Harsh ShandilyaandGitHub e34268c4c1 Merge pull request #4 from msfjarvis/drop-alternation
Use a single row item for all elements
2020-08-27 03:35:55 +05:30
probot-auto-merge[bot]andGitHub 4b95927f5f Merge pull request #3 from msfjarvis/dependency-updates
Update dependencies
2020-08-26 21:55:29 +00:00
Harsh Shandilya 2ccefb76a5 Use a single row item for all elements
The WireGuardItem class was created to compare an existing UI elements from standard view-based apps into a Compose alternative and doesn't really belong here

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 03:04:23 +05:30
Harsh Shandilya 44d8ee902a build: update androidx and material
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 02:53:46 +05:30
Harsh Shandilya 4bc184f06c build: update AGP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 02:50:39 +05:30
Harsh Shandilya a3e0503613 build: update compose
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 02:50:28 +05:30
Harsh Shandilya fc06690ffd github: configure probot-auto-merge
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 02:47:28 +05:30
Harsh ShandilyaandGitHub 9606932a5c Merge pull request #2 from msfjarvis/compose-ui-tests
Add basic UI tests
2020-08-27 00:35:05 +05:30
Harsh Shandilya 55e7ab5490 github: switch to API 29
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 00:20:48 +05:30
Harsh Shandilya 3d77f397f6 Expand UI tests for addition
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 00:18:55 +05:30
Harsh Shandilya 2c0b4fc072 Add a basic UI test
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 00:18:55 +05:30
Harsh Shandilya 6e246ed246 github: add missing ci-gradle.properties
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 00:18:43 +05:30
Harsh Shandilya 39e695dbcc github: add PR workflow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-27 00:16:51 +05:30
Harsh Shandilya 3d42671277 Fix ripple indication
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-25 22:17:47 +05:30
Harsh Shandilya 28fd3f6f7e WireGuardItem: make clickable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-25 01:05:39 +05:30
Harsh Shandilya 24bf7e5165 Drop in some trailing commas for later
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-25 00:43:05 +05:30
Harsh Shandilya afe93e989f Alternate between WireGuardItem and TodoRowItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-25 00:38:59 +05:30
Harsh Shandilya b6e01e71fa WireGuardItem: fix checked change listener and theming
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-25 00:38:42 +05:30
Harsh Shandilya 07d30410da Fix items persistence
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-25 00:30:22 +05:30
Harsh Shandilya 79299ee95a Properly do state persistence
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-24 23:55:39 +05:30
Harsh Shandilya eb01ca2b81 idea: don't star imports too early
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-24 23:41:48 +05:30
Harsh Shandilya 15d8f61e97 Add ripple indication
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-24 23:15:33 +05:30
Harsh Shandilya bfdc4b3183 Add broken reactivity
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-24 22:34:13 +05:30
Harsh Shandilya 405cf34193 Add a simple checkbox style view mirroring the wireguard app
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-24 22:29:05 +05:30
Harsh Shandilya d930182e54 Move TodoRow to a separate file
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-24 21:59:09 +05:30
Harsh Shandilya 4ddd01b77c Remove unused import
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-22 20:12:35 +05:30
Aditya Wasan 5a4b2754e3 Haha material design go brrrrr
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
2020-08-22 19:45:08 +05:30
Harsh Shandilya af88005cb5 Break out TodoRowItem to a separate Composable
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-22 14:53:47 +05:30
Harsh Shandilya 6558ec7909 Use a Scaffold to lay things out
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-22 14:49:39 +05:30
Harsh Shandilya 04f2b20503 Switch addition over to FAB
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-22 14:44:46 +05:30
Harsh Shandilya d2ca717f48 Remove default tests
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-22 00:47:34 +05:30
Harsh Shandilya a1237ab9b6 Initial MVP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-08-22 00:45:00 +05:30
321 changed files with 4196 additions and 30724 deletions
+2 -5
View File
@@ -1,5 +1,2 @@
# KMP removal
3d496c99c14106a7f433d01a6a9a1301cc89844a
e7f4c8a7ebe4e907f65af46e6dddfd3a542415c0
ab2713154f846b3db6d44625d1022bf421b275d0
cbdfa67d075ec1f8ceec0f3559498cbca01783a0
cec0e1bbcb7eec6c8eb90807c105cbeab9c01c6c # Reformatted Gradle build files with 2 space indent
c3cead59934c8c5221694940fc83be57fa50ac20 # Moved data module into app
-3
View File
@@ -1,3 +0,0 @@
* text=auto eol=lf
**/dependencies/** linguist-generated
**/clawicons/** linguist-generated
+1
View File
@@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

-78
View File
@@ -1,78 +0,0 @@
{
"extends": [
"config:base",
":dependencyDashboard",
"helpers:pinGitHubActionDigests",
"github>msfjarvis/shared-workflows//renovate/automerge"
],
"packageRules": [
{
"matchPackagePatterns": [
"^com.android.tools.build",
"^com.android.test",
"^gradle"
],
"enabled": false
},
{
"matchPackagePatterns": [
"^kotlin",
"^org.jetbrains.kotlin",
"^androidx.compose.compiler"
],
"groupName": "kotlin"
},
{
"managers": [
"gradle"
],
"packagePatterns": [
"^com.squareup.okhttp3"
],
"enabled": false
},
{
"matchDatasources": [
"maven"
],
"matchPackageNames": [
"androidx.compose.compiler:compiler"
],
"registryUrls": [
"https://maven.google.com/"
]
}
],
"regexManagers": [
{
"fileMatch": [
"build-logic/kotlin-plugins/src/main/kotlin/dev/msfjarvis/aps/gradle/SpotlessPlugin.kt"
],
"matchStrings": [
"KTFMT_VERSION = \"(?<currentValue>.*)\""
],
"datasourceTemplate": "maven",
"depNameTemplate": "com.facebook:ktfmt"
},
{
"fileMatch": [
"build-logic/kotlin-plugins/src/main/kotlin/dev/msfjarvis/aps/gradle/Detekt.kt"
],
"matchStrings": [
"TWITTER_RULES_VERSION = \"(?<currentValue>.*)\""
],
"datasourceTemplate": "maven",
"depNameTemplate": "com.twitter.compose.rules:detekt"
},
{
"fileMatch": [
"gradle/libs.versions.toml"
],
"matchStrings": [
"composeCompiler = \"(?<currentValue>.*)\""
],
"datasourceTemplate": "maven",
"depNameTemplate": "androidx.compose.compiler:compiler"
}
]
}
-79
View File
@@ -1,79 +0,0 @@
name: CI
on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- name: Set up JDK
uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # tag=v3.6.0
with:
distribution: temurin
java-version: 18
- name: Run unit tests
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # tag=v2.3.3
with:
arguments: --no-configuration-cache --stacktrace check -PslimTests
gradle-home-cache-cleanup: true
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Run Detekt
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # tag=v2.3.3
with:
arguments: --no-configuration-cache --stacktrace detektMain
gradle-home-cache-cleanup: true
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: (Fail-only) Upload test report
if: failure()
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3.1.1
with:
name: Test report
path: android/build/reports
deploy-release-snapshot:
runs-on: ubuntu-latest
if: "github.event_name == 'push' && github.event.ref == 'refs/heads/main'"
needs: [ "check" ]
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- name: Set up JDK
uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # tag=v3.6.0
with:
distribution: temurin
java-version: 18
- name: Decrypt secrets
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
- name: Build release app
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # tag=v2.3.3
with:
arguments: --no-configuration-cache --stacktrace collectReleaseApks
gradle-home-cache-cleanup: true
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Clean secrets
run: scripts/signing-cleanup.sh
- name: Deploy snapshot
run: scripts/deploy-snapshot.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+42
View File
@@ -0,0 +1,42 @@
on:
push:
branches:
- develop
name: Deploy snapshot builds
jobs:
deploy-release-snapshot:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
with:
java-version: '11'
- name: Checkout repository
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Decrypt secrets
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Build release app
uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
with:
arguments: :app:assembleRelease
- name: Clean secrets
run: scripts/signing-cleanup.sh
- name: Deploy snapshot
run: scripts/deploy-snapshot.sh
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SERVER_ADDRESS: ${{ secrets.SERVER_ADDRESS }}
SERVER_DESTINATION: ${{ secrets.SERVER_DESTINATION }}
SSH_PORT: ${{ secrets.SSH_PORT }}
+55
View File
@@ -0,0 +1,55 @@
name: CI
on:
push:
branches:
- staging
- trying
jobs:
run-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
with:
java-version: '11'
- name: Checkout repository
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
name: Run unit tests
with:
arguments: test --stacktrace
- name: (Fail-only) upload test report
if: failure()
uses: actions/upload-artifact@27bce4eee761b5bc643f46a8dfb41b430c8d05f6
with:
name: Test report
path: app/build/reports
stylecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
with:
java-version: '11'
- name: Checkout repository
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
fetch-depth: 0
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
name: Check codestyle with Spotless
with:
arguments: spotlessCheck
-108
View File
@@ -1,108 +0,0 @@
name: Release to Google Play
on:
workflow_dispatch:
jobs:
publish-google-play-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
with:
token: ${{ secrets.POST_RELEASE_GH_TOKEN }}
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # tag=v3.6.0
with:
distribution: temurin
java-version: 18
- name: Set up Git author
shell: bash
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Setup Gradle caching
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # tag=v2.3.3
with:
gradle-home-cache-cleanup: true
cache-read-only: true
- name: Decrypt secrets
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
- name: Get current version
shell: bash
run: |
./gradlew -q --no-configuration-cache clearPreRelease
VERSION="$(tail -n1 android/version.properties | cut -d = -f 2)"
echo VERSION="${VERSION}" >> $GITHUB_ENV
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@5bc232893483441c5d6cd6c9dcb1e48abf9a2bae # 1.3.0
with:
tag: ${{ env.VERSION }}
- name: Commit changes
shell: bash
run: |
git commit -am 'feat(release): bump version'
- name: Build release assets
shell: bash
run: |
./gradlew --no-configuration-cache collectReleaseApks collectReleaseBundle
- name: Clean secrets
run: scripts/signing-cleanup.sh
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@b97ce03a10d9bdbb07beb491c76a5a01d78cd3ef # v2.2.2
with:
version: ${{ env.VERSION }}
path: ./CHANGELOG.md
- name: Write release notes file
shell: bash
env:
CHANGELOG: ${{ steps.changelog_reader.outputs.changes }}
run: |
mkdir -p distribution/whatsnew
printf '## Changelog\n\n' > distribution/whatsnew/whatsnew-en-GB
printf '%s' "${CHANGELOG}" >> distribution/whatsnew/whatsnew-en-GB
- name: Publish bundle to Google Play
uses: r0adkll/upload-google-play@78c9e796b1035c94169c101d8e46cb880194bfc3 # tag=v1.0.19
with:
mappingFile: android/bundle/mapping.txt
packageName: dev.msfjarvis.claw.android
releaseFiles: android/bundle/*.aab
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
status: completed
track: production
whatsNewDirectory: distribution/whatsnew
- name: Post-release work
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.POST_RELEASE_GH_TOKEN }}
run: |
# Tag the current version
git tag "v${VERSION}" -F distribution/whatsnew/whatsnew-en-GB
# Push the tag to GitHub
git push origin "v${VERSION}"
# Create a GitHub release
gh release create "v${VERSION}" --notes-file distribution/whatsnew/whatsnew-en-GB --title "v${VERSION}" ./android/apk/*.apk ./android/bundle/*.aab
# Start the next development iteration
./gradlew -q --no-configuration-cache bumpSnapshot
truncate -s 0 distribution/whatsnew/whatsnew-en-GB # Clear changelog
git commit -am 'feat(release): start next development iteration'
git push -u origin
+29 -121
View File
@@ -1,102 +1,10 @@
# Created by https://www.toptal.com/developers/gitignore/api/androidstudio,gradle,intellij+all
# Edit at https://www.toptal.com/developers/gitignore?templates=androidstudio,gradle,intellij+all
### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
### START CHANGES - We use Gradle auto-import ###
.idea/artifacts
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr
### END CHANGES - We use Gradle auto-import ###
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.
.idea/*
### START CHANGES - We use Spotless to enforce code style ###
.idea/codeStyles
### END CHANGES - We use Spotless to enforce code style ###
!.idea/runConfigurations
# Created by https://www.gitignore.io/api/androidstudio,gradle
# Edit at https://www.gitignore.io/?templates=androidstudio,gradle
### Gradle ###
.gradle
**/build/
!src/**/build/
build/
# Ignore Gradle GUI config
gradle-app.setting
@@ -104,21 +12,14 @@ gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties
# Cache of project
.gradletasknamecache
# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### Gradle Patch ###
# Java heap dump
*.hprof
**/build/
### AndroidStudio ###
# Covers files to be ignored for android development using Android Studio.
@@ -126,7 +27,6 @@ gradle-app.setting
# Built application files
*.apk
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
@@ -137,13 +37,15 @@ gradle-app.setting
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Signing files
.signing/
keystore.jks
keystore.properties
# Local configuration file (sdk path, etc)
local.properties
@@ -166,13 +68,6 @@ captures/
*~
*.swp
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Android Patch
gen-external-apklibs
@@ -184,6 +79,7 @@ obj/
# IntelliJ IDEA
*.iml
*.iws
/out/
# User-specific configurations
@@ -208,11 +104,20 @@ obj/
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/assetWizardSettings.xml
.idea/gradle.xml
.idea/jarRepositories.xml
.idea/navEditor.xml
.idea/deploymentTargetDropDown.xml
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Legacy Eclipse project files
.classpath
.project
.cproject
.settings/
@@ -229,19 +134,22 @@ hs_err_pid*
## Plugin-specific files:
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Mongo Explorer plugin
.idea/mongoSettings.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### AndroidStudio Patch ###
!/gradle/wrapper/gradle-wrapper.jar
# End of https://www.toptal.com/developers/gitignore/api/androidstudio,gradle,intellij+all
keystore.properties
distribution/
# End of https://www.gitignore.io/api/androidstudio,gradle
+5
View File
@@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
/artifacts/
/gradle.xml
-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaProjectCodeInsightSettings">
<excluded-names>
<name>android.app.LauncherActivity.ListItem</name>
<name>android.graphics.Color</name>
<name>android.graphics.drawable.Icon</name>
<name>android.graphics.fonts.FontFamily</name>
<name>android.inputmethodservice.Keyboard.Row</name>
<name>android.text.layout.Alignment</name>
<name>android.view.RoundedCorner</name>
<name>android.view.Surface</name>
<name>android.widget.GridLayout.Alignment</name>
<name>java.lang.reflect.Modifier</name>
<name>java.nio.file.WatchEvent.Modifier</name>
<name>java.time.format.TextStyle</name>
<name>java.util.Observable</name>
<name>org.w3c.dom.Text</name>
</excluded-names>
</component>
</project>
+143
View File
@@ -0,0 +1,143 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="LINE_SEPARATOR" value="&#10;" />
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value />
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="100" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="100" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="FIELD_ANNOTATION_WRAP" value="1" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>
+5
View File
@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+20
View File
@@ -0,0 +1,20 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="previewFile" value="true" />
</inspection_tool>
</profile>
</component>
+35
View File
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://dl.bintray.com/kotlin/kotlinx" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://maven.pkg.jetbrains.space/public/p/compose/dev" />
</remote-repository>
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinScriptingSettings">
<option name="suppressDefinitionsCheck" value="true" />
</component>
</project>
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KtfmtSettings">
<option name="enabled" value="true" />
<option name="uiFormatterStyle" value="Google (internal)" />
</component>
</project>
-2
View File
@@ -1,2 +0,0 @@
*.json
baseline-prof.txt
-104
View File
@@ -1,104 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.9.0] - 2022-11-28
### Changed
- A loading indicator is added to the bottom of the post list to identify when new posts are being fetched
## [1.8.0] - 2022-11-21
### Changed
- The release pipeline now automatically generates Play Store release notes from the changelog file
### Fixed
- Downgrade AGP to 8.0.0-alpha07 to fix Baseline Profiles not being packaged
## [1.7.0] - 2022-11-19
### Changed
- Switch to Compose Material's swipe refresh feature
- Change metadata extractor logic to no longer prefer canonical URLs. The submitted URL will be retained as-is now.
- Remove navigation transition animations
## [1.6.0] - 2022-11-14
### Changed
- Migrate dependency injection from Hilt to Anvil + Whetstone
## [1.5.0] - 2022-11-10
### Changed
- Upgrade to Compose 2022.11.00 release
## [1.4.0] - 2022-11-02
### Changed
- Misc fixes to link metadata extractor
## [1.3.0] - 2022-10-24
### Changed
- Prevent errors during link metadata retrieval from crashing the app
- Update Jetpack libraries to 2022-10-24 release
## [1.2.0] - 2022-10-17
### Changed
- Lazily load link metadata to improve comment page loading speed
- Upgrade to latest Compose release
- Refactor code to align with Twitter's public Compose guidelines
## [1.1.0] - 2022-09-30
### Added
- Add score and relative time to comments
### Changed
- Update Jetpack Compose
- Declare data backup and transfer rules
- Improve legibility of links in comments and user profiles
- Commonize and improve how network errors are displayed
## [1.0.0] - 2022-09-20
- Initial Play Store release
[Unreleased]: https://github.com/msfjarvis/compose-lobsters/compare/1.9.0...HEAD
[1.9.0]: https://github.com/msfjarvis/compose-lobsters/compare/1.8.0...1.9.0
[1.8.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.7.0...1.8.0
[1.7.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.6.0...v1.7.0
[1.6.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.5.0...v1.6.0
[1.5.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/msfjarvis/compose-lobsters/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/msfjarvis/compose-lobsters/compare/29c374859b17c5fcef03585b8a01c00070de9097...v1.0.0
+17
View File
@@ -0,0 +1,17 @@
# Hacking on compose-lobsters
This app is built as a very lightweight frontend for [lobste.rs](https://lobste.rs), mainly as an experiment in using [Jetpack Compose](https://d.android.com/jetpack/compose).
The codebase is fairly simple, and the package structure follows [Buffer's](https://buffer.com/resources/android-rethinking-package-structure/).
## Subproject breakdown
- `:api`: Retrofit-backed interface to the [lobste.rs] API
- `:app`: The guts of the Android client
- `:common`: Contains the abstractions we use for sharing strings and browser handling across desktop and mobile
- `:database`: Database layer implemented using SQLDelight to persist saved posts
- `:desktop`: Proof-of-concept desktop client that needs significantly more love than it has received so far
-23
View File
@@ -1,23 +0,0 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-3
View File
@@ -1,3 +0,0 @@
# Privacy policy for Claw
The app does not collect any information about you and thus does not share anything with me or any other third-party. The only difference between using this app versus the [lobste.rs website](https://lobste.rs/) is the `User-Agent` header which is set to `Claw/$VERSION_NAME/msfjarvis` in the app.
+32 -12
View File
@@ -1,19 +1,39 @@
# Claw for [lobste.rs](https://lobste.rs) [![CI](https://github.com/msfjarvis/compose-lobsters/actions/workflows/ci.yml/badge.svg)](https://github.com/msfjarvis/compose-lobsters/actions/workflows/ci.yml)
# Claw for [lobste.rs](https://lobste.rs)
Unofficial Android app for read-only access to [lobste.rs](https://lobste.rs), built with [Jetpack Compose](https://developer.android.com/jetpack/compose).
Unofficial Android app for read-only access to [lobste.rs](https://lobste.rs) community, built with [Jetpack Compose](https://developer.android.com/jetpack/compose).
![Screenshots](./.github/readme_feature.png)
Requires Android Studio 2020.3.1 Arctic Fox to work.
## Download
## Distribution
<a href="https://play.google.com/store/apps/details?id=dev.msfjarvis.claw.android">
<img src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png"
alt="Get it on Google Play"
height="80" />
</a>
The app will be published to Google Play soon, in the mean time snapshots from the development branch are available [here](https://dl.msfjarvis.dev/Claw)
Snapshots from the development branch can be obtained [here](https://github.com/msfjarvis/compose-lobsters/releases/tag/nightly).
## Licence
## License
```
Copyright (c) 2020 Harsh Shandilya
See [LICENSE](LICENSE)
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
```
-2
View File
@@ -1,2 +0,0 @@
/apk/
/bundle/
-67
View File
@@ -1,67 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
plugins {
id("dev.msfjarvis.claw.android-application")
id("dev.msfjarvis.claw.rename-artifacts")
id("dev.msfjarvis.claw.kotlin-android")
id("dev.msfjarvis.claw.kotlin-kapt")
id("dev.msfjarvis.claw.versioning-plugin")
alias(libs.plugins.anvil)
alias(libs.plugins.whetstone)
}
whetstone {
addOns {
compose.set(true)
workManager.set(true)
}
}
android {
namespace = "dev.msfjarvis.claw.android"
defaultConfig { applicationId = "dev.msfjarvis.claw.android" }
buildFeatures { compose = true }
composeOptions {
useLiveLiterals = false
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
buildTypes {
create("benchmark") {
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
isDebuggable = false
}
}
}
dependencies {
kapt(libs.dagger.compiler)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.dagger)
implementation(projects.api)
implementation(projects.common)
implementation(projects.core)
implementation(projects.coroutineUtils)
implementation(projects.database)
implementation(projects.metadataExtractor)
implementation(projects.model)
implementation(libs.accompanist.sysuicontroller)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.lifecycle.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.paging.compose)
implementation(libs.androidx.work.runtime.ktx)
implementation(libs.coil)
implementation(libs.copydown)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.sqldelight.extensions.coroutines)
}
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.4.0-alpha09" type="baseline" client="gradle" dependencies="false" name="AGP (7.4.0-alpha09)" variant="all" version="7.4.0-alpha09">
</issues>
@@ -1,11 +0,0 @@
-dontwarn android.window.OnBackInvokedCallback
-dontwarn android.window.OnBackInvokedDispatcher
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE
-29
View File
@@ -1,29 +0,0 @@
# Keep `Companion` object fields of serializable classes.
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
-if @kotlinx.serialization.Serializable class **
-keepclassmembers class <1> {
static <1>$Companion Companion;
}
# Keep `serializer()` on companion objects (both default and named) of serializable classes.
-if @kotlinx.serialization.Serializable class ** {
static **$* *;
}
-keepclassmembers class <2>$<3> {
kotlinx.serialization.KSerializer serializer(...);
}
# Keep `INSTANCE.serializer()` of serializable objects.
-if @kotlinx.serialization.Serializable class ** {
public static ** INSTANCE;
}
-keepclassmembers class <1> {
public static <1> INSTANCE;
kotlinx.serialization.KSerializer serializer(...);
}
# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
-dontobfuscate
-keepattributes SourceFile, LineNumberTable
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<string name="app_name">Claw β</string>
</resources>
-154
View File
@@ -1,154 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".ClawApplication"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/full_backup_content"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/Theme.Claw.SplashScreen"
android:enableOnBackInvokedCallback="true"
tools:targetApi="s">
<profileable
android:shell="true"
tools:targetApi="29" />
<activity
android:name=".MainActivity"
android:configChanges="colorMode|density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:ssp="//lobste.rs" />
<data android:host="lobste.rs" />
<data android:path="/" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/......" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/....../" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/....../...*" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/......" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/....../" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/....../...*" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/......" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/....../" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/s/....../...*" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="lobste.rs" />
<data android:pathPattern="/u/......*" />
<data android:scheme="https" />
</intent-filter>
</activity>
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>
</application>
</manifest>
File diff suppressed because it is too large Load Diff
@@ -1,29 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android
import android.app.Application
import com.deliveryhero.whetstone.Whetstone
import com.deliveryhero.whetstone.app.ApplicationComponentOwner
import com.deliveryhero.whetstone.app.ContributesAppInjector
import dev.msfjarvis.claw.core.injection.AppPlugin
import javax.inject.Inject
@ContributesAppInjector(generateAppComponent = true)
class ClawApplication : Application(), ApplicationComponentOwner {
override val applicationComponent by
lazy(LazyThreadSafetyMode.NONE) { GeneratedApplicationComponent.create(this) }
@Inject lateinit var plugins: Set<@JvmSuppressWildcards AppPlugin>
override fun onCreate() {
Whetstone.inject(this)
super.onCreate()
plugins.forEach { plugin -> plugin.apply(this) }
}
}
@@ -1,80 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android
import android.app.assist.AssistContent
import android.net.Uri
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.work.Constraints
import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.NetworkType
import androidx.work.PeriodicWorkRequestBuilder
import androidx.work.WorkManager
import com.deliveryhero.whetstone.Whetstone
import com.deliveryhero.whetstone.activity.ContributesActivityInjector
import dev.msfjarvis.claw.android.ui.LobstersApp
import dev.msfjarvis.claw.android.work.SavedPostUpdaterWorker
import dev.msfjarvis.claw.common.comments.HTMLConverter
import dev.msfjarvis.claw.common.urllauncher.UrlLauncher
import java.util.concurrent.TimeUnit
import javax.inject.Inject
@ContributesActivityInjector
class MainActivity : ComponentActivity() {
@Inject lateinit var urlLauncher: UrlLauncher
@Inject lateinit var htmlConverter: HTMLConverter
private var webUri: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
installSplashScreen()
Whetstone.inject(this)
setContent {
LobstersApp(
urlLauncher = urlLauncher,
htmlConverter = htmlConverter,
setWebUri = { url -> webUri = url },
)
}
val postUpdateWorkRequest =
PeriodicWorkRequestBuilder<SavedPostUpdaterWorker>(POST_REFRESH_PERIOD, TimeUnit.HOURS)
.setConstraints(
Constraints.Builder()
.setRequiresCharging(false)
.setRequiresBatteryNotLow(true)
.setRequiredNetworkType(NetworkType.CONNECTED)
.setRequiresDeviceIdle(true)
.build()
)
.build()
WorkManager.getInstance(this@MainActivity)
.enqueueUniquePeriodicWork(
"updateSavedPosts",
ExistingPeriodicWorkPolicy.CANCEL_AND_REENQUEUE,
postUpdateWorkRequest,
)
}
override fun onProvideAssistContent(outContent: AssistContent?) {
super.onProvideAssistContent(outContent)
if (outContent != null) {
if (webUri != null) {
outContent.webUri = Uri.parse(webUri)
} else {
outContent.webUri = null
}
}
}
private companion object {
private const val POST_REFRESH_PERIOD = 24L // 24 hours
}
}
@@ -1,40 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.injection
import com.deliveryhero.whetstone.app.ApplicationScope
import com.squareup.anvil.annotations.ContributesTo
import dagger.Binds
import dagger.Module
import dagger.Provides
import dev.msfjarvis.claw.util.coroutines.DefaultDispatcherProvider
import dev.msfjarvis.claw.util.coroutines.DispatcherProvider
import kotlinx.coroutines.CoroutineDispatcher
@Module
@ContributesTo(ApplicationScope::class)
interface CoroutineDispatcherModule {
@Binds fun DefaultDispatcherProvider.bind(): DispatcherProvider
companion object {
@[Provides IODispatcher]
fun provideIODispatcher(dispatcherProvider: DispatcherProvider): CoroutineDispatcher {
return dispatcherProvider.io()
}
@[Provides DatabaseDispatcher]
fun provideDatabaseDispatcher(dispatcherProvider: DispatcherProvider): CoroutineDispatcher {
return dispatcherProvider.database()
}
@[Provides MainDispatcher]
fun provideMainDispatcher(dispatcherProvider: DispatcherProvider): CoroutineDispatcher {
return dispatcherProvider.main()
}
}
}
@@ -1,29 +0,0 @@
/*
* Copyright © 2021 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.injection
import com.deliveryhero.whetstone.app.ApplicationScope
import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import dev.msfjarvis.claw.common.comments.HTMLConverter
import io.github.furstenheim.CopyDown
@Module
@ContributesTo(ApplicationScope::class)
object HTMLConverterModule {
@Provides
fun provideHTMLConverter() =
object : HTMLConverter {
private val copydown = CopyDown()
override fun convertHTMLToMarkdown(html: String): String {
return copydown.convert(html)
}
}
}
@@ -1,25 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.injection
import com.chimbori.crux.Crux
import com.deliveryhero.whetstone.app.ApplicationScope
import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import okhttp3.OkHttpClient
@Module
@ContributesTo(ApplicationScope::class)
object MetadataExtractorModule {
@Provides
fun provideCrux(
okHttpClient: OkHttpClient,
): Crux {
return Crux(okHttpClient = okHttpClient)
}
}
@@ -1,24 +0,0 @@
/*
* Copyright © 2021 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.injection
import android.content.Context
import com.deliveryhero.whetstone.ForScope
import com.deliveryhero.whetstone.activity.ActivityScope
import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import dev.msfjarvis.claw.common.urllauncher.UrlLauncher
@Module
@ContributesTo(ActivityScope::class)
object UrlLauncherModule {
@Provides
fun provideUrlLauncher(@ForScope(ActivityScope::class) context: Context): UrlLauncher {
return UrlLauncher(context)
}
}
@@ -1,15 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.injection
import javax.inject.Qualifier
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class DatabaseDispatcher
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class MainDispatcher
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class IODispatcher
@@ -1,53 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.paging
import androidx.paging.PagingSource
import androidx.paging.PagingState
import com.slack.eithernet.ApiResult.Failure
import com.slack.eithernet.ApiResult.Success
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import dev.msfjarvis.claw.android.injection.IODispatcher
import dev.msfjarvis.claw.model.LobstersPost
import java.io.IOException
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
class LobstersPagingSource
@AssistedInject
constructor(
@Assisted private val remoteFetcher: RemoteFetcher<LobstersPost>,
@IODispatcher private val ioDispatcher: CoroutineDispatcher,
) : PagingSource<Int, LobstersPost>() {
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, LobstersPost> {
val page = params.key ?: 1
return when (val result = withContext(ioDispatcher) { remoteFetcher.getItemsAtPage(page) }) {
is Success ->
LoadResult.Page(
data = result.value,
prevKey = if (page == 1) null else page - 1,
nextKey = page.plus(1)
)
is Failure.NetworkFailure -> LoadResult.Error(result.error)
is Failure.UnknownFailure -> LoadResult.Error(result.error)
is Failure.HttpFailure,
is Failure.ApiFailure -> LoadResult.Error(IOException("API returned an invalid response"))
}
}
override fun getRefreshKey(state: PagingState<Int, LobstersPost>): Int {
return state.pages.size + 1
}
@AssistedFactory
interface Factory {
fun create(remoteFetcher: RemoteFetcher<LobstersPost>): LobstersPagingSource
}
}
@@ -1,14 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.paging
import com.slack.eithernet.ApiResult
/** SAM interface to abstract over a remote API that fetches paginated content. */
fun interface RemoteFetcher<T> {
suspend fun getItemsAtPage(page: Int): ApiResult<List<T>, Unit>
}
@@ -1,233 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.ui
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navArgument
import androidx.navigation.navDeepLink
import androidx.paging.compose.collectAsLazyPagingItems
import com.deliveryhero.whetstone.compose.injectedViewModel
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import dev.msfjarvis.claw.android.R
import dev.msfjarvis.claw.android.ui.decorations.ClawNavigationBar
import dev.msfjarvis.claw.android.ui.decorations.NavigationItem
import dev.msfjarvis.claw.android.ui.lists.DatabasePosts
import dev.msfjarvis.claw.android.ui.lists.NetworkPosts
import dev.msfjarvis.claw.android.ui.navigation.Destinations
import dev.msfjarvis.claw.android.viewmodel.ClawViewModel
import dev.msfjarvis.claw.api.LobstersApi
import dev.msfjarvis.claw.common.comments.CommentsPage
import dev.msfjarvis.claw.common.comments.HTMLConverter
import dev.msfjarvis.claw.common.res.ClawIcons
import dev.msfjarvis.claw.common.theme.LobstersTheme
import dev.msfjarvis.claw.common.ui.decorations.ClawAppBar
import dev.msfjarvis.claw.common.ui.surfaceColorAtNavigationBarElevation
import dev.msfjarvis.claw.common.urllauncher.UrlLauncher
import dev.msfjarvis.claw.common.user.UserProfile
import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun LobstersApp(
urlLauncher: UrlLauncher,
htmlConverter: HTMLConverter,
setWebUri: (String?) -> Unit,
modifier: Modifier = Modifier,
viewModel: ClawViewModel = injectedViewModel(),
) {
val systemUiController = rememberSystemUiController()
val hottestListState = rememberLazyListState()
val newestListState = rememberLazyListState()
val savedListState = rememberLazyListState()
val navController = rememberNavController()
val coroutineScope = rememberCoroutineScope()
val postActions = rememberPostActions(urlLauncher, navController, viewModel)
val backStackEntry by navController.currentBackStackEntryAsState()
val currentDestination = backStackEntry?.destination?.route
val context = LocalContext.current
val hottestPosts = viewModel.hottestPosts.collectAsLazyPagingItems()
val newestPosts = viewModel.newestPosts.collectAsLazyPagingItems()
val savedPosts by viewModel.savedPosts.collectAsState(emptyMap())
LobstersTheme(
dynamicColor = true,
providedValues = arrayOf(LocalUriHandler provides urlLauncher),
) {
val currentUiMode = LocalConfiguration.current.uiMode
val systemBarsColor = MaterialTheme.colorScheme.surfaceColorAtNavigationBarElevation()
val backgroundColor = MaterialTheme.colorScheme.background
val navItems =
listOf(
NavigationItem(
label = "Hottest",
route = Destinations.Hottest.route,
icon = ClawIcons.Flame,
selectedIcon = ClawIcons.FlameFilled,
) {
coroutineScope.launch { hottestListState.animateScrollToItem(index = 0) }
},
NavigationItem(
label = "Newest",
route = Destinations.Newest.route,
icon = ClawIcons.New,
selectedIcon = ClawIcons.NewFilled,
) {
coroutineScope.launch { newestListState.animateScrollToItem(index = 0) }
},
NavigationItem(
label = "Saved",
route = Destinations.Saved.route,
icon = ClawIcons.HeartBorder,
selectedIcon = ClawIcons.Heart,
) {
coroutineScope.launch { savedListState.animateScrollToItem(index = 0) }
},
)
SideEffect { systemUiController.setStatusBarColor(color = systemBarsColor) }
// Track UI mode as a key to force a navbar color update when dark theme is toggled
LaunchedEffect(currentDestination, currentUiMode) {
val color =
if (navItems.none { item -> item.route == currentDestination }) {
backgroundColor
} else {
systemBarsColor
}
systemUiController.setNavigationBarColor(color = color)
}
Scaffold(
topBar = {
ClawAppBar(
backgroundColor = systemBarsColor,
navigationIcon = {
if (navItems.none { it.route == currentDestination }) {
IconButton(
onClick = { if (!navController.popBackStack()) context.getActivity()?.finish() }
) {
Icon(
painter = ClawIcons.ArrowBack,
contentDescription = "Go back to previous screen",
)
}
}
},
title = {
if (navItems.any { it.route == currentDestination }) {
Text(text = stringResource(R.string.app_name), fontWeight = FontWeight.Bold)
}
},
)
},
bottomBar = {
ClawNavigationBar(
navController = navController,
items = navItems,
isVisible = navItems.any { it.route == currentDestination },
)
},
modifier = modifier,
) { paddingValues ->
NavHost(
navController = navController,
startDestination = Destinations.startDestination.route,
modifier = Modifier.padding(paddingValues),
) {
val uri = LobstersApi.BASE_URL
composable(
route = Destinations.Hottest.route,
deepLinks =
listOf(navDeepLink { uriPattern = uri }, navDeepLink { uriPattern = "$uri/" }),
) {
setWebUri("https://lobste.rs/")
NetworkPosts(
lazyPagingItems = hottestPosts,
listState = hottestListState,
isPostSaved = viewModel::isPostSaved,
reloadPosts = viewModel::refreshHottestPosts,
postActions = postActions,
)
}
composable(
route = Destinations.Newest.route,
) {
setWebUri("https://lobste.rs/")
NetworkPosts(
lazyPagingItems = newestPosts,
listState = newestListState,
isPostSaved = viewModel::isPostSaved,
reloadPosts = viewModel::refreshNewestPosts,
postActions = postActions,
)
}
composable(Destinations.Saved.route) {
setWebUri(null)
DatabasePosts(
items = savedPosts,
listState = savedListState,
postActions = postActions,
)
}
composable(
route = Destinations.Comments.route,
arguments = listOf(navArgument("postId") { type = NavType.StringType }),
deepLinks =
listOf(
navDeepLink { uriPattern = "$uri/s/${Destinations.Comments.placeholder}/.*" },
navDeepLink { uriPattern = "$uri/s/${Destinations.Comments.placeholder}" },
),
) { backStackEntry ->
val postId = requireNotNull(backStackEntry.arguments?.getString("postId"))
setWebUri("https://lobste.rs/s/$postId")
CommentsPage(
postId = postId,
postActions = postActions,
htmlConverter = htmlConverter,
)
}
composable(
route = Destinations.User.route,
arguments = listOf(navArgument("username") { type = NavType.StringType }),
deepLinks =
listOf(navDeepLink { uriPattern = "$uri/u/${Destinations.User.placeholder}" }),
) { backStackEntry ->
val username = requireNotNull(backStackEntry.arguments?.getString("username"))
UserProfile(
username = username,
getProfile = viewModel::getUserProfile,
)
}
}
}
}
}
@@ -1,89 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.ui.decorations
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.Crossfade
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.material3.Icon
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.navigation.NavController
import dev.msfjarvis.claw.android.ui.navigation.Destinations
private const val AnimationDuration = 100
@Composable
fun ClawNavigationBar(
navController: NavController,
items: List<NavigationItem>,
isVisible: Boolean,
modifier: Modifier = Modifier,
) {
AnimatedVisibility(
visible = isVisible,
enter =
slideInVertically(
// Enters by sliding up from offset 0 to fullHeight.
initialOffsetY = { fullHeight -> fullHeight },
animationSpec = tween(durationMillis = AnimationDuration, easing = LinearOutSlowInEasing),
),
exit =
slideOutVertically(
// Exits by sliding up from offset 0 to -fullHeight.
targetOffsetY = { fullHeight -> fullHeight },
animationSpec = tween(durationMillis = AnimationDuration, easing = FastOutLinearInEasing),
),
modifier = Modifier,
) {
NavigationBar(modifier = modifier) {
items.forEach { navItem ->
val isCurrentDestination = navController.currentDestination?.route == navItem.route
NavigationBarItem(
icon = {
Crossfade(isCurrentDestination) {
Icon(
painter = if (it) navItem.selectedIcon else navItem.icon,
contentDescription = navItem.label.uppercase()
)
}
},
label = { Text(text = navItem.label) },
selected = isCurrentDestination,
onClick = {
if (isCurrentDestination) {
navItem.listStateResetCallback()
return@NavigationBarItem
}
navController.graph.startDestinationRoute?.let { startDestination ->
navController.popBackStack(startDestination, false)
}
if (navItem.route != Destinations.startDestination.route) {
navController.navigate(navItem.route)
}
}
)
}
}
}
}
class NavigationItem(
val label: String,
val route: String,
val icon: Painter,
val selectedIcon: Painter,
val listStateResetCallback: () -> Unit,
)
@@ -1,82 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.ui
import android.content.Context
import android.content.ContextWrapper
import androidx.activity.ComponentActivity
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.navigation.NavController
import dev.msfjarvis.claw.android.ui.navigation.Destinations
import dev.msfjarvis.claw.android.viewmodel.ClawViewModel
import dev.msfjarvis.claw.common.posts.PostActions
import dev.msfjarvis.claw.common.urllauncher.UrlLauncher
import dev.msfjarvis.claw.database.local.SavedPost
import dev.msfjarvis.claw.model.LinkMetadata
import dev.msfjarvis.claw.model.LobstersPostDetails
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
fun Context.getActivity(): ComponentActivity? {
return when (this) {
is ComponentActivity -> this
is ContextWrapper -> baseContext.getActivity()
else -> null
}
}
/**
* Parses a given [String] into a [LocalDateTime]. This method is only intended to be used for dates
* in the format returned by the Lobsters API, and is not a general purpose parsing solution.
*/
fun String.toLocalDateTime(): LocalDateTime {
return LocalDateTime.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(this))
}
@Composable
fun rememberPostActions(
urlLauncher: UrlLauncher,
navController: NavController,
viewModel: ClawViewModel,
): PostActions {
return remember {
object : PostActions {
override fun viewPost(postUrl: String, commentsUrl: String) {
urlLauncher.openUri(postUrl.ifEmpty { commentsUrl })
}
override fun viewComments(postId: String) {
navController.navigate(
Destinations.Comments.route.replace(Destinations.Comments.placeholder, postId)
)
}
override fun viewCommentsPage(commentsUrl: String) {
// Post links from lobste.rs are of the form $baseUrl/s/$postId/$postTitle
// Interestingly, lobste.rs does not actually care for the value of $postTitle, and will
// happily accept both a missing as well as a completely arbitrary $postTitle. We
// leverage this to create a new URL format which looks like
// $baseUrl/s/$postId/$postTitle/r, and does not trigger our deeplinks,
// instead opening in the custom tab as we want it to.
urlLauncher.openUri(commentsUrl.replaceAfterLast('/', "r"))
}
override fun toggleSave(post: SavedPost) {
viewModel.toggleSave(post)
}
override suspend fun getComments(postId: String): LobstersPostDetails {
return viewModel.getPostComments(postId)
}
override suspend fun getLinkMetadata(url: String): LinkMetadata {
return viewModel.getLinkMetadata(url)
}
}
}
}
@@ -1,46 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.ui.lists
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.Divider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import dev.msfjarvis.claw.common.posts.PostActions
import dev.msfjarvis.claw.common.ui.decorations.MonthHeader
import dev.msfjarvis.claw.database.local.SavedPost
import java.time.Month
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun DatabasePosts(
items: Map<Month, List<SavedPost>>,
listState: LazyListState,
postActions: PostActions,
modifier: Modifier = Modifier,
) {
LazyColumn(
state = listState,
modifier = modifier,
) {
items.forEach { (month, posts) ->
stickyHeader { MonthHeader(month = month) }
items(posts) { item ->
ListItem(
item = item,
isSaved = { true },
postActions = postActions,
)
Divider()
}
}
}
}
@@ -1,31 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.ui.lists
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState
import androidx.compose.ui.Modifier
import dev.msfjarvis.claw.common.posts.LobstersCard
import dev.msfjarvis.claw.common.posts.PostActions
import dev.msfjarvis.claw.database.local.SavedPost
@Composable
fun ListItem(
item: SavedPost,
isSaved: suspend (SavedPost) -> Boolean,
postActions: PostActions,
modifier: Modifier = Modifier,
) {
val saved by produceState(false, item) { value = isSaved(item) }
LobstersCard(
post = item,
isSaved = saved,
postActions = postActions,
modifier = modifier,
)
}
@@ -1,93 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.ui.lists
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.pullrefresh.PullRefreshIndicator
import androidx.compose.material.pullrefresh.pullRefresh
import androidx.compose.material.pullrefresh.rememberPullRefreshState
import androidx.compose.material3.Divider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.contentColorFor
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.items
import dev.msfjarvis.claw.common.posts.PostActions
import dev.msfjarvis.claw.common.posts.toDbModel
import dev.msfjarvis.claw.common.ui.NetworkError
import dev.msfjarvis.claw.common.ui.ProgressBar
import dev.msfjarvis.claw.database.local.SavedPost
import dev.msfjarvis.claw.model.LobstersPost
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun NetworkPosts(
lazyPagingItems: LazyPagingItems<LobstersPost>,
listState: LazyListState,
isPostSaved: suspend (SavedPost) -> Boolean,
reloadPosts: () -> Unit,
postActions: PostActions,
modifier: Modifier = Modifier,
) {
val refreshLoadState = lazyPagingItems.loadState.refresh
val isRefreshing = refreshLoadState == LoadState.Loading
val pullRefreshState = rememberPullRefreshState(isRefreshing, reloadPosts)
Box(modifier = modifier.fillMaxSize().pullRefresh(pullRefreshState)) {
if (lazyPagingItems.itemCount == 0 && refreshLoadState is LoadState.Error) {
NetworkError(
label = "Failed to load posts",
error = refreshLoadState.error,
modifier = Modifier.align(Alignment.Center),
)
} else {
LazyColumn(
state = listState,
) {
items(lazyPagingItems) { item ->
if (item != null) {
val dbModel = item.toDbModel()
ListItem(
item = dbModel,
isSaved = isPostSaved,
postActions = postActions,
)
Divider()
}
}
if (lazyPagingItems.loadState.append == LoadState.Loading) {
item {
ProgressBar(
modifier =
Modifier.fillMaxWidth()
.wrapContentWidth(Alignment.CenterHorizontally)
.padding(top = 4.dp),
)
}
}
}
}
PullRefreshIndicator(
refreshing = isRefreshing,
state = pullRefreshState,
modifier = Modifier.align(Alignment.TopCenter),
backgroundColor = MaterialTheme.colorScheme.surface,
contentColor = contentColorFor(MaterialTheme.colorScheme.surface),
)
}
}
@@ -1,38 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.ui.navigation
sealed class Destinations {
abstract val route: String
object Hottest : Destinations() {
override val route = "hottest"
}
object Newest : Destinations() {
override val route = "newest"
}
object Saved : Destinations() {
override val route = "saved"
}
object Comments : Destinations() {
const val placeholder = "{postId}"
override val route = "comments/$placeholder"
}
object User : Destinations() {
const val placeholder = "{username}"
override val route = "user/$placeholder"
}
companion object {
val startDestination
get() = Hottest
}
}
@@ -1,115 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.viewmodel
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import androidx.paging.Pager
import androidx.paging.PagingConfig
import com.deliveryhero.whetstone.viewmodel.ContributesViewModel
import com.slack.eithernet.ApiResult.Failure
import com.slack.eithernet.ApiResult.Success
import dev.msfjarvis.claw.android.injection.IODispatcher
import dev.msfjarvis.claw.android.paging.LobstersPagingSource
import dev.msfjarvis.claw.android.ui.toLocalDateTime
import dev.msfjarvis.claw.api.LobstersApi
import dev.msfjarvis.claw.database.local.SavedPost
import java.io.IOException
import java.time.Month
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@ContributesViewModel
class ClawViewModel
@Inject
constructor(
private val api: LobstersApi,
private val savedPostsRepository: SavedPostsRepository,
private val linkMetadataRepository: LinkMetadataRepository,
private val pagingSourceFactory: LobstersPagingSource.Factory,
@IODispatcher private val ioDispatcher: CoroutineDispatcher,
) : ViewModel() {
private var hottestPostsPagingSource: LobstersPagingSource? = null
private var newestPostsPagingSource: LobstersPagingSource? = null
private val hottestPostsPager =
Pager(PagingConfig(20)) {
pagingSourceFactory.create(api::getHottestPosts).also { hottestPostsPagingSource = it }
}
private val newestPostsPager =
Pager(PagingConfig(20)) {
pagingSourceFactory.create(api::getHottestPosts).also { newestPostsPagingSource = it }
}
val hottestPosts
get() = hottestPostsPager.flow
val newestPosts
get() = newestPostsPager.flow
private val savedPostsFlow
get() = savedPostsRepository.savedPosts
val savedPosts
get() = savedPostsFlow.map(::mapSavedPosts)
private fun mapSavedPosts(items: List<SavedPost>): Map<Month, List<SavedPost>> {
val sorted = items.sortedByDescending { post -> post.createdAt.toLocalDateTime() }
return sorted.groupBy { post -> post.createdAt.toLocalDateTime().month }
}
suspend fun isPostSaved(post: SavedPost): Boolean {
return savedPostsFlow.first().any { savedPost -> savedPost.shortId == post.shortId }
}
fun toggleSave(post: SavedPost) {
viewModelScope.launch(ioDispatcher) {
val saved = isPostSaved(post)
if (saved) {
savedPostsRepository.removePost(post)
} else {
savedPostsRepository.savePost(post)
}
}
}
suspend fun getPostComments(postId: String) =
withContext(ioDispatcher) {
when (val result = api.getPostDetails(postId)) {
is Success -> result.value
is Failure.NetworkFailure -> throw result.error
is Failure.UnknownFailure -> throw result.error
is Failure.HttpFailure,
is Failure.ApiFailure -> throw IOException("API returned an invalid response")
}
}
suspend fun getLinkMetadata(url: String) =
withContext(ioDispatcher) { linkMetadataRepository.getLinkMetadata(url) }
suspend fun getUserProfile(username: String) =
withContext(ioDispatcher) {
when (val result = api.getUser(username)) {
is Success -> result.value
is Failure.NetworkFailure -> throw result.error
is Failure.UnknownFailure -> throw result.error
is Failure.HttpFailure,
is Failure.ApiFailure -> throw IOException("API returned an invalid response")
}
}
fun refreshHottestPosts() {
hottestPostsPagingSource?.invalidate()
}
fun refreshNewestPosts() {
newestPostsPagingSource?.invalidate()
}
}
@@ -1,21 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.viewmodel
import dev.msfjarvis.claw.metadata.MetadataExtractor
import dev.msfjarvis.claw.model.LinkMetadata
import javax.inject.Inject
class LinkMetadataRepository
@Inject
constructor(
private val metadataExtractor: MetadataExtractor,
) {
suspend fun getLinkMetadata(url: String): LinkMetadata {
return metadataExtractor.getExtractedMetadata(url)
}
}
@@ -1,41 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.viewmodel
import app.cash.sqldelight.coroutines.asFlow
import app.cash.sqldelight.coroutines.mapToList
import dev.msfjarvis.claw.android.injection.DatabaseDispatcher
import dev.msfjarvis.claw.database.LobstersDatabase
import dev.msfjarvis.claw.database.local.SavedPost
import io.github.aakira.napier.Napier
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
class SavedPostsRepository
@Inject
constructor(
database: LobstersDatabase,
@DatabaseDispatcher private val dbDispatcher: CoroutineDispatcher,
) {
private val savedPostQueries = database.savedPostQueries
val savedPosts = savedPostQueries.selectAllPosts().asFlow().mapToList(dbDispatcher)
suspend fun savePost(post: SavedPost) {
Napier.d(tag = TAG) { "Saving post: ${post.shortId}" }
withContext(dbDispatcher) { savedPostQueries.insertOrReplacePost(post) }
}
suspend fun removePost(post: SavedPost) {
Napier.d(tag = TAG) { "Removing post: ${post.shortId}" }
withContext(dbDispatcher) { savedPostQueries.deletePost(post.shortId) }
}
private companion object {
private const val TAG = "SavedPostsRepository"
}
}
@@ -1,56 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.android.work
import android.content.Context
import androidx.work.CoroutineWorker
import androidx.work.WorkerParameters
import com.deliveryhero.whetstone.ForScope
import com.deliveryhero.whetstone.worker.ContributesWorker
import com.deliveryhero.whetstone.worker.WorkerScope
import com.slack.eithernet.ApiResult
import dev.msfjarvis.claw.android.viewmodel.SavedPostsRepository
import dev.msfjarvis.claw.api.LobstersApi
import dev.msfjarvis.claw.common.posts.toDbModel
import javax.inject.Inject
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.supervisorScope
/**
* WorkManager-backed [CoroutineWorker] that gets all the posts from [SavedPostsRepository], fetches
* their newest state using the [LobstersApi] and then writes them back to the database. This allows
* saved posts that were saved before comment counts were added to be able to show a comment count
* and for new-enough posts that are still getting comments to have an accurate one.
*/
@ContributesWorker
class SavedPostUpdaterWorker
@Inject
constructor(
@ForScope(WorkerScope::class) appContext: Context,
workerParams: WorkerParameters,
private val savedPostsRepository: SavedPostsRepository,
private val lobstersApi: LobstersApi,
) : CoroutineWorker(appContext, workerParams) {
override suspend fun doWork(): Result {
val posts = savedPostsRepository.savedPosts.first()
supervisorScope {
posts
.map { post ->
async {
val details = lobstersApi.getPostDetails(post.shortId)
if (details is ApiResult.Success) {
savedPostsRepository.savePost(details.value.toDbModel())
}
}
}
.awaitAll()
}
return Result.success()
}
}
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<bool name="use_light_status_bar">false</bool>
</resources>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<bool name="use_light_status_bar">true</bool>
</resources>
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="Theme.Claw.SplashScreen" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">#FF6C0000</item>
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_foreground</item>
<item name="windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/Theme.Claw</item>
</style>
<style name="Platform.Theme.Claw" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Base.Theme.Claw" parent="Platform.Theme.Claw">
<item name="android:windowActionModeOverlay">true</item>
</style>
<style name="Theme.Claw" parent="Base.Theme.Claw">
<item name="android:windowLightStatusBar">@bool/use_light_status_bar</item>
</style>
</resources>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<include
domain="database"
path="databases" />
</cloud-backup>
<device-transfer>
<include
domain="database"
path="databases" />
</device-transfer>
</data-extraction-rules>
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include
domain="database"
path="databases" />
</full-backup-content>
-5
View File
@@ -1,5 +0,0 @@
#
# This file was automatically generated by 'versioning-plugin'. DO NOT EDIT MANUALLY.
#
versioning-plugin.versionCode=10900
versioning-plugin.versionName=1.9.0
+9 -27
View File
@@ -1,32 +1,14 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
plugins {
kotlin("android")
id("dev.msfjarvis.claw.kotlin-common")
id("dev.msfjarvis.claw.android-library")
alias(libs.plugins.anvil)
alias(libs.plugins.whetstone)
kotlin("jvm")
id("com.google.devtools.ksp")
`lobsters-plugin`
}
android { namespace = "dev.msfjarvis.claw.api" }
anvil { generateDaggerFactories.set(true) }
dependencies {
api(projects.model)
api(libs.retrofit)
api(libs.eithernet)
implementation(libs.dagger)
implementation(libs.javax.inject)
testImplementation(testFixtures(libs.eithernet))
testImplementation(kotlin("test-junit"))
testImplementation(libs.kotlinx.coroutines.core)
testImplementation(libs.kotlinx.serialization.json)
testImplementation(libs.retrofit.kotlinxSerializationConverter)
api(libs.thirdparty.retrofit.lib)
ksp(libs.thirdparty.moshix.ksp)
implementation(libs.thirdparty.retrofit.moshiConverter)
testImplementation(libs.kotlin.coroutines.core)
testImplementation(libs.testing.kotlintest.junit)
testImplementation(libs.testing.mockWebServer)
}
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.0.0-alpha08" type="baseline" client="gradle" dependencies="false" name="AGP (8.0.0-alpha08)" variant="all" version="8.0.0-alpha08">
</issues>
@@ -0,0 +1,22 @@
package dev.msfjarvis.lobsters.data.api
import dev.msfjarvis.lobsters.model.LobstersPost
import dev.msfjarvis.lobsters.model.LobstersPostDetails
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
/** Simple interface defining an API for lobste.rs */
interface LobstersApi {
@GET("hottest.json") suspend fun getHottestPosts(@Query("page") page: Int): List<LobstersPost>
@GET("newest.json") suspend fun getNewestPosts(@Query("page") page: Int): List<LobstersPost>
@GET("s/{postId}.json")
suspend fun getPostDetails(@Path("postId") postId: String): LobstersPostDetails
companion object {
const val BASE_URL = "https://lobste.rs"
}
}
@@ -0,0 +1,20 @@
package dev.msfjarvis.lobsters.model
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
class Comment(
@Json(name = "short_id") val shortId: String,
@Json(name = "short_id_url") val shortIdUrl: String,
@Json(name = "created_at") val createdAt: String,
@Json(name = "updated_at") val updatedAt: String,
@Json(name = "is_deleted") val isDeleted: Boolean,
@Json(name = "is_moderated") val isModerated: Boolean,
val score: Long,
val flags: Long,
val comment: String,
val url: String,
@Json(name = "indent_level") val indentLevel: Long,
@Json(name = "commenting_user") val user: User,
)
@@ -0,0 +1,10 @@
package dev.msfjarvis.lobsters.model
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
class KeybaseSignature(
@Json(name = "kb_username") val kbUsername: String,
@Json(name = "sig_hash") val sigHash: String,
)
@@ -0,0 +1,20 @@
package dev.msfjarvis.lobsters.model
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
class LobstersPost(
@Json(name = "short_id") val shortId: String,
@Json(name = "short_id_url") val shortIdUrl: String,
@Json(name = "created_at") val createdAt: String,
val title: String,
val url: String,
val score: Long,
val flags: Long,
@Json(name = "comment_count") val commentCount: Long,
val description: String,
@Json(name = "comments_url") val commentsUrl: String,
@Json(name = "submitter_user") val submitter: User,
val tags: List<String>,
)
@@ -0,0 +1,21 @@
package dev.msfjarvis.lobsters.model
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
class LobstersPostDetails(
@Json(name = "short_id") val shortId: String,
@Json(name = "short_id_url") val shortIdUrl: String,
@Json(name = "created_at") val createdAt: String,
val title: String,
val url: String,
val score: Long,
val flags: Long,
@Json(name = "comment_count") val commentCount: Long,
val description: String,
@Json(name = "comments_url") val commentsUrl: String,
@Json(name = "submitter_user") val submitter: User,
val tags: List<String>,
val comments: List<Comment>,
)
@@ -0,0 +1,19 @@
package dev.msfjarvis.lobsters.model
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
class User(
val username: String,
@Json(name = "created_at") val createdAt: String,
@Json(name = "is_admin") val isAdmin: Boolean,
val about: String,
@Json(name = "is_moderator") val isModerator: Boolean,
val karma: Long = 0,
@Json(name = "avatar_url") val avatarUrl: String,
@Json(name = "invited_by_user") val invitedByUser: String,
@Json(name = "github_username") val githubUsername: String? = null,
@Json(name = "twitter_username") val twitterUsername: String? = null,
@Json(name = "keybase_signatures") val keybaseSignatures: List<KeybaseSignature> = emptyList(),
)
@@ -1,35 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.api
import com.slack.eithernet.ApiResult
import dev.msfjarvis.claw.model.LobstersPost
import dev.msfjarvis.claw.model.LobstersPostDetails
import dev.msfjarvis.claw.model.User
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
/** Simple interface defining an API for lobste.rs */
interface LobstersApi {
@GET("hottest.json")
suspend fun getHottestPosts(@Query("page") page: Int): ApiResult<List<LobstersPost>, Unit>
@GET("newest.json")
suspend fun getNewestPosts(@Query("page") page: Int): ApiResult<List<LobstersPost>, Unit>
@GET("s/{postId}.json")
suspend fun getPostDetails(@Path("postId") postId: String): ApiResult<LobstersPostDetails, Unit>
@GET("u/{username}.json")
suspend fun getUser(@Path("username") username: String): ApiResult<User, Unit>
companion object {
const val BASE_URL = "https://lobste.rs"
}
}
@@ -1,42 +0,0 @@
/*
* Copyright © 2021-2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.api.injection
import com.deliveryhero.whetstone.app.ApplicationScope
import com.slack.eithernet.ApiResultCallAdapterFactory
import com.slack.eithernet.ApiResultConverterFactory
import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import dev.msfjarvis.claw.api.LobstersApi
import okhttp3.OkHttpClient
import retrofit2.Converter
import retrofit2.Retrofit
import retrofit2.create
@Module
@ContributesTo(ApplicationScope::class)
object ApiModule {
@Provides
fun provideRetrofit(
client: OkHttpClient,
converterFactories: Set<@JvmSuppressWildcards Converter.Factory>,
): Retrofit {
return Retrofit.Builder()
.client(client)
.baseUrl(LobstersApi.BASE_URL)
.addConverterFactory(ApiResultConverterFactory)
.addCallAdapterFactory(ApiResultCallAdapterFactory)
.apply { converterFactories.forEach(this::addConverterFactory) }
.build()
}
@Provides
fun provideApi(retrofit: Retrofit): LobstersApi {
return retrofit.create()
}
}
@@ -0,0 +1,89 @@
package dev.msfjarvis.lobsters.data.api
import com.squareup.moshi.Moshi
import dev.msfjarvis.lobsters.util.TestUtils
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
import kotlin.test.fail
import kotlinx.coroutines.runBlocking
import mockwebserver3.Dispatcher
import mockwebserver3.MockResponse
import mockwebserver3.MockWebServer
import mockwebserver3.RecordedRequest
import okhttp3.OkHttpClient
import org.junit.AfterClass
import org.junit.BeforeClass
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import retrofit2.create
class LobstersApiTest {
companion object {
private val webServer = MockWebServer()
private val moshi = Moshi.Builder().build()
private val okHttp = OkHttpClient.Builder().build()
private val retrofit =
Retrofit.Builder()
.client(okHttp)
.baseUrl("http://localhost:8080/")
.addConverterFactory(MoshiConverterFactory.create(moshi))
.build()
private val apiClient = retrofit.create<LobstersApi>()
@JvmStatic
@BeforeClass
fun setUp() {
webServer.start(8080)
webServer.dispatcher =
object : Dispatcher() {
override fun dispatch(request: RecordedRequest): MockResponse {
val path = requireNotNull(request.path)
return when {
path.startsWith("/hottest") ->
MockResponse().setBody(TestUtils.getJson("hottest.json")).setResponseCode(200)
path.startsWith("/s/") ->
MockResponse()
.setBody(TestUtils.getJson("post_details_d9ucpe.json"))
.setResponseCode(200)
else -> fail("'$path' unexpected")
}
}
}
}
@JvmStatic
@AfterClass
fun tearDown() {
webServer.shutdown()
}
}
@Test
fun `api gets correct number of items`() = runBlocking {
val posts = apiClient.getHottestPosts(1)
assertEquals(25, posts.size)
}
@Test
fun `no moderator posts in test data`() = runBlocking {
val posts = apiClient.getHottestPosts(1)
val moderatorPosts = posts.asSequence().filter { it.submitter.isModerator }.toSet()
assertTrue(moderatorPosts.isEmpty())
}
@Test
fun `posts with no urls`() = runBlocking {
val posts = apiClient.getHottestPosts(1)
val commentsOnlyPosts = posts.asSequence().filter { it.url.isEmpty() }.toSet()
assertEquals(2, commentsOnlyPosts.size)
}
@Test
fun `post details with comments`() = runBlocking {
val postDetails = apiClient.getPostDetails("d9ucpe")
assertEquals(7, postDetails.commentCount)
assertEquals(7, postDetails.comments.size)
}
}
@@ -1,10 +1,4 @@
/*
* Copyright © 2021 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.util
package dev.msfjarvis.lobsters.util
import java.io.File
@@ -1,52 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.api
import com.slack.eithernet.ApiResult.Success
import com.slack.eithernet.test.newEitherNetController
import dev.msfjarvis.claw.model.LobstersPost
import dev.msfjarvis.claw.model.LobstersPostDetails
import dev.msfjarvis.claw.model.User
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertIs
import kotlinx.coroutines.runBlocking
class ApiTest {
private val wrapper = ApiWrapper(newEitherNetController())
private val api
get() = wrapper.api
@Test
fun `api gets correct number of items`() = runBlocking {
val posts = api.getHottestPosts(1)
assertIs<Success<List<LobstersPost>>>(posts)
assertEquals(25, posts.value.size)
}
@Test
fun `posts with no urls`() = runBlocking {
val posts = api.getHottestPosts(1)
assertIs<Success<List<LobstersPost>>>(posts)
val commentsOnlyPosts = posts.value.asSequence().filter { it.url.isEmpty() }.toSet()
assertEquals(2, commentsOnlyPosts.size)
}
@Test
fun `post details with comments`() = runBlocking {
val postDetails = api.getPostDetails("tdfoqh")
assertIs<Success<LobstersPostDetails>>(postDetails)
assertEquals(7, postDetails.value.comments.size)
}
@Test
fun `get user details`() = runBlocking {
val user = api.getUser("msfjarvis")
assertIs<Success<User>>(user)
assertEquals("msfjarvis", user.value.username)
}
}
@@ -1,34 +0,0 @@
/*
* Copyright © 2022 Harsh Shandilya.
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
package dev.msfjarvis.claw.api
import com.slack.eithernet.ApiResult.Companion.success
import com.slack.eithernet.test.EitherNetController
import com.slack.eithernet.test.enqueue
import dev.msfjarvis.claw.model.LobstersPost
import dev.msfjarvis.claw.model.LobstersPostDetails
import dev.msfjarvis.claw.model.User
import dev.msfjarvis.claw.util.TestUtils.getJson
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
class ApiWrapper(controller: EitherNetController<LobstersApi>) {
private val json = Json { ignoreUnknownKeys = true }
private val hottest: List<LobstersPost> = json.decodeFromString(getJson("hottest.json"))
private val postDetails: LobstersPostDetails =
json.decodeFromString(getJson("post_details_tdfoqh.json"))
private val user: User = json.decodeFromString(getJson("msfjarvis.json"))
val api = controller.api
init {
controller.enqueue(LobstersApi::getHottestPosts) { success(hottest) }
controller.enqueue(LobstersApi::getNewestPosts) { success(hottest) }
controller.enqueue(LobstersApi::getPostDetails) { success(postDetails) }
controller.enqueue(LobstersApi::getUser) { success(user) }
}
}
-1
View File
@@ -1 +0,0 @@
{"username":"msfjarvis","created_at":"2020-04-24T11:41:56.000-05:00","is_admin":false,"about":"Android and Kotlin developer\r\n","is_moderator":false,"karma":574,"avatar_url":"/avatars/msfjarvis-100.png","invited_by_user":"Amolith","github_username":"msfjarvis","twitter_username":"msfjarvis"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+39
View File
@@ -0,0 +1,39 @@
plugins {
id("com.android.application")
kotlin("android")
kotlin("kapt")
id("dagger.hilt.android.plugin")
id("org.jetbrains.compose")
`versioning-plugin`
`lobsters-plugin`
`core-library-desugaring`
}
android { defaultConfig { applicationId = "dev.msfjarvis.lobsters" } }
dependencies {
kapt(libs.androidx.hilt.daggerCompiler)
implementation(projects.api)
implementation(projects.common)
implementation(projects.database)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.browser)
implementation(libs.androidx.datastore)
implementation(libs.androidx.compose.activity)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.lifecycleViewModel)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.navigation)
implementation(libs.androidx.compose.paging)
implementation(libs.androidx.compose.uiTooling)
implementation(libs.androidx.hilt.dagger)
implementation(libs.bundles.androidxLifecycle)
implementation(libs.kotlin.coroutines.android)
implementation(libs.thirdparty.accompanist.coil)
implementation(libs.thirdparty.accompanist.flow)
implementation(libs.thirdparty.moshi.lib)
implementation(libs.thirdparty.moshix.metadatareflect)
implementation(libs.thirdparty.retrofit.moshiConverter)
testImplementation(libs.testing.kotlintest.junit)
androidTestImplementation(libs.testing.kotlintest.junit)
}
@@ -16,7 +16,7 @@
}
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
public static final ** CREATOR;
}
-keep class androidx.annotation.Keep
+8
View File
@@ -0,0 +1,8 @@
-keepattributes *Annotation*, EnclosingMethod, InnerClasses
-dontwarn org.jetbrains.kotlin.**
-dontwarn androidx.compose.animation.tooling.ComposeAnimation
-dontwarn android.view.RenderNode
-dontwarn android.view.DisplayListCanvas
-dontwarn sun.misc.Unsafe
-dontobfuscate
-dontoptimize
+12
View File
@@ -0,0 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<!--
If you don't need the activityTestRule, then you can switch to createComposeRule and add
an empty activity here for the test harness to launch. Not having this activity is what
broke my tests when I first started writing them with createComposeRule. Future me will thank
past me for writing this note here.
-->
<activity android:name="androidx.activity.ComponentActivity" />
</application>
</manifest>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Claw β</string>
</resources>
+88
View File
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.msfjarvis.lobsters"
android:sharedUserId="${applicationId}.uid">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".ClawApplication"
android:allowBackup="true"
android:fullBackupContent="@xml/full_backup_content"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.DayNight">
<activity
android:name=".ui.main.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Platform.Theme.Claw">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="@string/hottest_posts">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:ssp="//lobste.rs"
android:scheme="https" />
<data
android:host="lobste.rs"
android:scheme="https"
android:path="/"/>
</intent-filter>
<intent-filter android:label="@string/newest_posts">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="lobste.rs"
android:scheme="https"
android:pathPrefix="/recent" />
</intent-filter>
<intent-filter android:label="@string/open_comments">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="lobste.rs"
android:scheme="https"
android:pathPattern="/s/......"/>
<data
android:host="lobste.rs"
android:scheme="https"
android:pathPattern="/s/....../"/>
<data
android:host="lobste.rs"
android:scheme="https"
android:pathPattern="/s/....../...*"/>
</intent-filter>
</activity>
<activity
android:name=".ui.settings.SettingsActivity"
android:theme="@style/Platform.Theme.Claw"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

@@ -0,0 +1,6 @@
package dev.msfjarvis.lobsters
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
@HiltAndroidApp class ClawApplication : Application()
@@ -0,0 +1,28 @@
package dev.msfjarvis.lobsters.data.backup
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapter
import dev.msfjarvis.lobsters.data.local.SavedPost
import dev.msfjarvis.lobsters.data.repo.LobstersRepository
import javax.inject.Inject
@OptIn(ExperimentalStdlibApi::class)
class BackupHandler
@Inject
constructor(
private val repository: LobstersRepository,
moshi: Moshi,
) {
private val adapter = moshi.adapter<List<SavedPost>>()
suspend fun exportSavedPosts(): ByteArray {
val posts = repository.getAllPostsFromCache()
return adapter.toJson(posts).toByteArray(Charsets.UTF_8)
}
suspend fun importSavedPosts(json: ByteArray) {
val posts = requireNotNull(adapter.fromJson(json.toString(Charsets.UTF_8)))
repository.addPosts(posts)
repository.updateCache()
}
}
@@ -0,0 +1,24 @@
package dev.msfjarvis.lobsters.data.preferences
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.edit
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
class ClawPreferences
@Inject
constructor(
private val dataStore: DataStore<Preferences>,
) {
private val sortKey = booleanPreferencesKey("post_sorting_order")
val sortingOrder: Flow<Boolean>
get() = dataStore.data.map { preferences -> preferences[sortKey] ?: false }
suspend fun toggleSortingOrder() {
dataStore.edit { preferences -> preferences[sortKey] = (preferences[sortKey] ?: false).not() }
}
}
@@ -0,0 +1,29 @@
package dev.msfjarvis.lobsters.data.remote
import androidx.paging.PagingSource
import androidx.paging.PagingState
import dev.msfjarvis.lobsters.model.LobstersPost
class LobstersPagingSource(
private val getMorePosts: suspend (Int) -> List<LobstersPost>,
) : PagingSource<Int, LobstersPost>() {
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, LobstersPost> {
return try {
val page = params.key ?: 1
val posts = getMorePosts(page)
LoadResult.Page(
data = posts,
prevKey = if (page == 1) null else page - 1,
nextKey = page.plus(1)
)
} catch (e: Exception) {
LoadResult.Error(e)
}
}
override fun getRefreshKey(state: PagingState<Int, LobstersPost>): Int {
return state.pages.size + 1
}
}
@@ -0,0 +1,82 @@
package dev.msfjarvis.lobsters.data.repo
import dev.msfjarvis.lobsters.data.api.LobstersApi
import dev.msfjarvis.lobsters.data.local.SavedPost
import dev.msfjarvis.lobsters.database.LobstersDatabase
import dev.msfjarvis.lobsters.model.LobstersPost
import dev.msfjarvis.lobsters.model.LobstersPostDetails
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.withContext
class LobstersRepository(
private val lobstersApi: LobstersApi,
private val lobstersDatabase: LobstersDatabase,
) {
private val savedPostsCache: MutableMap<String, SavedPost> = mutableMapOf()
private val _isCacheReady = MutableStateFlow(false)
val isCacheReady = _isCacheReady.asStateFlow()
fun isPostSaved(postId: String): Boolean {
return savedPostsCache.containsKey(postId)
}
fun getAllPostsFromCache(): List<SavedPost> {
return savedPostsCache.values.toList()
}
suspend fun fetchHottestPosts(page: Int): List<LobstersPost> =
withContext(Dispatchers.IO) {
return@withContext lobstersApi.getHottestPosts(page)
}
suspend fun fetchNewestPosts(page: Int): List<LobstersPost> =
withContext(Dispatchers.IO) {
return@withContext lobstersApi.getNewestPosts(page)
}
suspend fun fetchPostDetails(postId: String): LobstersPostDetails =
withContext(Dispatchers.IO) {
return@withContext lobstersApi.getPostDetails(postId)
}
// https://issuetracker.google.com/issues/181221325
@Suppress("NewApi")
suspend fun updateCache() {
_isCacheReady.value = false
val posts = getSavedPosts()
posts.forEach { savedPostsCache[it.shortId] = it }
_isCacheReady.value = true
}
private suspend fun getSavedPosts(): List<SavedPost> =
withContext(Dispatchers.IO) {
return@withContext lobstersDatabase.savedPostQueries.selectAllPosts().executeAsList()
}
suspend fun addPost(post: SavedPost) =
withContext(Dispatchers.IO) {
if (!savedPostsCache.containsKey(post.shortId)) {
savedPostsCache.putIfAbsent(post.shortId, post)
lobstersDatabase.savedPostQueries.insertOrReplacePost(post)
}
}
suspend fun addPosts(posts: List<SavedPost>) {
withContext(Dispatchers.IO) {
lobstersDatabase.transaction {
posts.forEach { lobstersDatabase.savedPostQueries.insertOrReplacePost(it) }
}
}
}
suspend fun removePost(post: SavedPost) =
withContext(Dispatchers.IO) {
if (savedPostsCache.containsKey(post.shortId)) {
savedPostsCache.remove(post.shortId)
lobstersDatabase.savedPostQueries.deletePost(post.shortId)
}
}
}
@@ -0,0 +1,58 @@
package dev.msfjarvis.lobsters.injection
import android.util.Log
import com.squareup.moshi.Moshi
import dagger.Lazy
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.msfjarvis.lobsters.data.api.LobstersApi
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import retrofit2.create
@Module
@InstallIn(SingletonComponent::class)
object ApiModule {
@Provides
@BaseUrlQualifier
fun provideBaseUrl(): String {
return LobstersApi.BASE_URL
}
@Provides
fun provideClient(): OkHttpClient {
return OkHttpClient.Builder()
.addNetworkInterceptor { chain ->
val request = chain.request()
Log.d("LobstersApi", "${request.method()}: ${request.url()}")
chain.proceed(request)
}
.build()
}
/**
* Using [Lazy] here is a trick I picked up from Zac Sweers, which he explained in more detail
* here: https://www.zacsweers.dev/dagger-party-tricks-deferred-okhttp-init/
*/
@Provides
fun provideRetrofit(
client: Lazy<OkHttpClient>,
moshi: Lazy<Moshi>,
@BaseUrlQualifier baseUrl: String
): Retrofit {
return Retrofit.Builder()
.client(client.get())
.baseUrl(baseUrl)
.addConverterFactory(MoshiConverterFactory.create(moshi.get()))
.build()
}
@Provides
fun provideApi(retrofit: Retrofit): LobstersApi {
return retrofit.create()
}
}
@@ -0,0 +1,21 @@
package dev.msfjarvis.lobsters.injection
import com.squareup.moshi.Moshi
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dev.msfjarvis.lobsters.data.backup.BackupHandler
import dev.msfjarvis.lobsters.data.repo.LobstersRepository
@Module
@InstallIn(ActivityComponent::class)
object BackupModule {
@Provides
fun provideBackupHandler(
repository: LobstersRepository,
moshi: Moshi,
): BackupHandler {
return BackupHandler(repository, moshi)
}
}
@@ -0,0 +1,9 @@
package dev.msfjarvis.lobsters.injection
import javax.inject.Qualifier
/**
* Qualifier for a string value that needs to be provided to the [ApiModule.provideRetrofit] method
* as the base URL of our API.
*/
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class BaseUrlQualifier
@@ -0,0 +1,36 @@
package dev.msfjarvis.lobsters.injection
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStoreFile
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Qualifier
@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class PreferenceStoreFileNameQualifier
@Module
@InstallIn(SingletonComponent::class)
object DataStoreModule {
@Provides
fun provideDataStore(
@ApplicationContext context: Context,
@PreferenceStoreFileNameQualifier fileName: String,
): DataStore<Preferences> {
return PreferenceDataStoreFactory.create { context.preferencesDataStoreFile(fileName) }
}
@Provides
@PreferenceStoreFileNameQualifier
fun provideDataStoreFilename(): String {
return "Claw_preferences"
}
}
@@ -0,0 +1,29 @@
package dev.msfjarvis.lobsters.injection
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import dev.msfjarvis.lobsters.data.local.DriverFactory
import dev.msfjarvis.lobsters.data.local.createDatabase
import dev.msfjarvis.lobsters.database.LobstersDatabase
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object DatabaseModule {
@Provides
@Singleton
fun providesDriverFactory(@ApplicationContext context: Context): DriverFactory {
return DriverFactory(context)
}
@Provides
@Singleton
fun providesLobstersDatabase(driverFactory: DriverFactory): LobstersDatabase {
return createDatabase(driverFactory)
}
}
@@ -0,0 +1,21 @@
package dev.msfjarvis.lobsters.injection
import com.squareup.moshi.Moshi
import dagger.Module
import dagger.Provides
import dagger.Reusable
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.zacsweers.moshix.reflect.MetadataKotlinJsonAdapterFactory
@Module
@InstallIn(SingletonComponent::class)
object MoshiModule {
@Provides
@Reusable
fun provideMoshi(): Moshi {
return Moshi.Builder()
.add(MetadataKotlinJsonAdapterFactory())
.build()
}
}
@@ -0,0 +1,23 @@
package dev.msfjarvis.lobsters.injection
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.msfjarvis.lobsters.data.preferences.ClawPreferences
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object PreferenceModule {
@Provides
@Singleton
fun provideClawPreferences(
dataStore: DataStore<Preferences>,
): ClawPreferences {
return ClawPreferences(dataStore)
}
}
@@ -0,0 +1,24 @@
package dev.msfjarvis.lobsters.injection
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.msfjarvis.lobsters.data.api.LobstersApi
import dev.msfjarvis.lobsters.data.repo.LobstersRepository
import dev.msfjarvis.lobsters.database.LobstersDatabase
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {
@Singleton
@Provides
fun provideLobstersRepository(
lobstersApi: LobstersApi,
lobstersDatabase: LobstersDatabase
): LobstersRepository {
return LobstersRepository(lobstersApi, lobstersDatabase)
}
}
@@ -0,0 +1,18 @@
package dev.msfjarvis.lobsters.injection
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.android.qualifiers.ActivityContext
import dev.msfjarvis.lobsters.ui.urllauncher.UrlLauncher
@Module
@InstallIn(ActivityComponent::class)
object UrlLauncherModule {
@Provides
fun provideUrlLauncher(@ActivityContext context: Context): UrlLauncher {
return UrlLauncher(context)
}
}
@@ -0,0 +1,63 @@
package dev.msfjarvis.lobsters.ui.comments
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import dev.msfjarvis.lobsters.model.Comment
import dev.msfjarvis.lobsters.ui.posts.SubmitterName
import dev.msfjarvis.lobsters.util.toNormalizedHtml
import dev.msfjarvis.lobsters.utils.Strings
import dev.msfjarvis.lobsters.utils.get
@Composable
fun CommentEntry(
comment: Comment,
) {
val indentLevel = comment.indentLevel.toInt() - 1
Row(modifier = Modifier.height(IntrinsicSize.Min)) {
CommentTreeColors(indentLevel = indentLevel)
Column(modifier = Modifier.padding(bottom = 4.dp, end = 8.dp, start = 12.dp, top = 4.dp)) {
CompositionLocalProvider(LocalTextStyle provides TextStyle(fontWeight = FontWeight.Bold)) {
SubmitterName(
text = comment.user.username,
avatarUrl = comment.user.avatarUrl,
contentDescription = Strings.AvatarContentDescription.get(comment.user.username),
)
}
Text(text = comment.comment.toNormalizedHtml(), modifier = Modifier.padding(top = 8.dp))
}
}
}
@Composable
private fun CommentTreeColors(
indentLevel: Int,
modifier: Modifier = Modifier,
) {
Box(modifier = modifier) {
for (level in 1..indentLevel) {
Box(
modifier =
Modifier.padding(start = (level * 12).dp)
.fillMaxHeight()
.width(1.dp)
.background(CommentTreeColor[level % CommentTreeColor.size])
)
}
}
}

Some files were not shown because too many files have changed in this diff Show More