Added ability to read comments on claims #920

Merged
clay53 merged 4 commits from comments into master 2020-05-30 01:47:50 +02:00
clay53 commented 2020-05-28 09:25:41 +02:00 (Migrated from github.com)

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • [] I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

Issue Number: resolves #652

What is the current behavior?

No comments or commenting under video

What is the new behavior?

You can now read the first "page" of comments on a video

Other information

There is still a lot of commenting features that aren't done yet like "infinite scroll". For now it just loads as many comments as possible on the first page. There is also lacking of the ability write comments, read replies, write replies, click on usernames to go to their channel, and and see the poster's icon. So I don't know if this should close the referenced issue but I'd imagine it'd be better to separate these "different" features into separate issues.

I'm not sure if this is a "breaking change" because I don't know if this was intentional. On FileViewFragment the function to listen for when the SDK was ready called onSDKReady when it wasn't ready and did the listener when it was so I switched that to prevent an error when fetching comments.

## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [] I have checked that this PR does not introduce a breaking change - [x] This PR introduces breaking changes and I have provided a detailed explanation below ## PR Type What kind of change does this PR introduce? - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting) - [ ] Refactoring (no functional changes) - [ ] Documentation changes - [ ] Other - Please describe: ## Fixes Issue Number: resolves #652 ## What is the current behavior? No comments or commenting under video ## What is the new behavior? You can now read the first "page" of comments on a video ## Other information There is still a lot of commenting features that aren't done yet like "infinite scroll". For now it just loads as many comments as possible on the first page. There is also lacking of the ability write comments, read replies, write replies, click on usernames to go to their channel, and and see the poster's icon. So I don't know if this should close the referenced issue but I'd imagine it'd be better to separate these "different" features into separate issues. <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. --> I'm not sure if this is a "breaking change" because I don't know if this was intentional. On FileViewFragment the function to listen for when the SDK was ready called onSDKReady when it _wasn't_ ready and did the listener when it was so I switched that to prevent an error when fetching comments.
clay53 commented 2020-05-28 09:32:10 +02:00 (Migrated from github.com)

This was my first time writing stuff for an Android app in Java (I took the AP Java course online in 8th grade but it was too late for me to sign up for the exam so I "know" Java but I haven't done any personal projects with it) & one of my first times contributing to an outside open-source project. I'm pretty sure there are no errors in the way I've done this, but I could be wrong.

This was my first time writing stuff for an Android app in Java (I took the AP Java course online in 8th grade but it was too late for me to sign up for the exam so I "know" Java but I haven't done any personal projects with it) & one of my first times contributing to an outside open-source project. I'm pretty sure there are no errors in the way I've done this, but I could be wrong.
akinwale (Migrated from github.com) requested changes 2020-05-28 10:41:36 +02:00
akinwale (Migrated from github.com) left a comment

Hi! This is great, thanks! Just a couple of things.

Hi! This is great, thanks! Just a couple of things.
clay53 commented 2020-05-28 11:25:12 +02:00 (Migrated from github.com)

Hi! This is great, thanks! Just a couple of things.

@akinwale Um, what are they? I don't see any comments.

> Hi! This is great, thanks! Just a couple of things. @akinwale Um, what are they? I don't see any comments.
akinwale (Migrated from github.com) requested changes 2020-05-28 14:20:49 +02:00
@ -0,0 +8,4 @@
import lombok.Data;
@Data
public class Comment {
akinwale (Migrated from github.com) commented 2020-05-28 11:00:50 +02:00

You can add the @Data annotation from lombok so you don't have to implement the boilerplate toString and getter methods. https://projectlombok.org/features/Data

You can add the @<!-- -->Data annotation from lombok so you don't have to implement the boilerplate toString and getter methods. https://projectlombok.org/features/Data
akinwale (Migrated from github.com) commented 2020-05-28 10:44:30 +02:00

Could you change this to handle pagination by adding page and pageSize parameters? For a simple example showing how pagination works for infinite scroll, refer to PurchaseListTask and the recycler view scroll listener contentList.addScrollListener in LibraryFragment.java.

Could you change this to handle pagination by adding `page` and `pageSize` parameters? For a simple example showing how pagination works for infinite scroll, refer to `PurchaseListTask` and the recycler view scroll listener `contentList.addScrollListener` in `LibraryFragment.java`.
akinwale (Migrated from github.com) commented 2020-05-28 10:47:50 +02:00

You can remove the top margin because the bottom margin last item in the related content view already has some spacing applied.

You can remove the top margin because the bottom margin last item in the related content view already has some spacing applied.
akinwale commented 2020-05-28 14:21:38 +02:00 (Migrated from github.com)

@clay53 For some reason, my first review submitted without the comments. I have posted a new review.

@clay53 For some reason, my first review submitted without the comments. I have posted a new review.
clay53 (Migrated from github.com) reviewed 2020-05-29 01:31:21 +02:00
@ -0,0 +8,4 @@
import lombok.Data;
@Data
public class Comment {
clay53 (Migrated from github.com) commented 2020-05-29 01:31:20 +02:00

Done in e88706e

Done in e88706e
clay53 (Migrated from github.com) reviewed 2020-05-29 02:31:39 +02:00
clay53 (Migrated from github.com) commented 2020-05-29 02:31:39 +02:00

Where are new comments added? I'm a little worried about comments getting added while users are scrolling.

Where are new comments added? I'm a little worried about comments getting added while users are scrolling.
clay53 (Migrated from github.com) reviewed 2020-05-29 02:45:28 +02:00
clay53 (Migrated from github.com) commented 2020-05-29 02:45:28 +02:00

I added the handling but I didn't implement it (I don't think you requested I implement and I'm not sure how to do that because of the above question so I just added handling). 9e6acd9

I added the handling but I didn't implement it (I don't _think_ you requested I implement and I'm not sure how to do that because of the above question so I just added handling). 9e6acd9
clay53 (Migrated from github.com) reviewed 2020-05-29 02:53:55 +02:00
clay53 (Migrated from github.com) commented 2020-05-29 02:53:55 +02:00

Done in c1853b8

Done in c1853b8
akinwale (Migrated from github.com) reviewed 2020-05-30 01:46:20 +02:00
akinwale (Migrated from github.com) commented 2020-05-30 01:46:20 +02:00

Where are new comments added? I'm a little worried about comments getting added while users are scrolling.

Usually, you could use a flag to check if comments are loading and then simply return instead of sending another request to fetch the next page. I'll accept this and make some tweaks.

> Where are new comments added? I'm a little worried about comments getting added while users are scrolling. Usually, you could use a flag to check if comments are loading and then simply return instead of sending another request to fetch the next page. I'll accept this and make some tweaks.
akinwale (Migrated from github.com) approved these changes 2020-05-30 01:47:31 +02:00
akinwale (Migrated from github.com) left a comment

Looks good. Thanks.

Can we show you some appreciation for the contribution?

Looks good. Thanks. Can we show you some [appreciation](https://lbry.com/faq/appreciation) for the contribution?
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-android#920
No description provided.