Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show comment replies #9410

Closed
wants to merge 25 commits into from
Closed

Conversation

xz-dev
Copy link

@xz-dev xz-dev commented Nov 16, 2022

From #9020, for change branch name

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

Adds a "Show Replies" for the comments with replies for Youtube, just look like youtube.

Before/After Screenshots/Screen Record

Before After1 After2 After3
Before After1 After2 After3

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@xz-dev xz-dev mentioned this pull request Nov 16, 2022
5 tasks
@TobiGr TobiGr added GUI Issue is related to the graphical user interface feature request Issue is related to a feature in the app labels Nov 16, 2022
Copy link

@acrodemocide acrodemocide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested these changes on my Android, and they look good. I'm able to connect replies and navigate back to the comments section. The rest of the app appears to be working correctly.

Co-authored-by: Isira Seneviratne <31027858+Isira-Seneviratne@users.noreply.github.com>
@nicoursi
Copy link

nicoursi commented Nov 27, 2022

NewPipe player with this branch has got issues on my phone.

  1. I install the debug apk
  2. I import subscriptions and settings from my previous installation
  3. I longpress on a video and tap "play in background".
  4. It crashes for every video
  5. If I play the video in foreground then it works also for longpress and background.
  6. Videos often become Black and or crash while rotating the phone.
  7. This happens only with this PR.

Maybe b5c0823 should not be in this PR and it is creating problems?

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks nice and understandable, you did a great job! Thanks for looking into this. Most of the review comments are small things, except for the clone thingy, for which we might want to look into other solutions. Anyway, nothing too big.

I am getting some problems loading the next page of the 488 replies of the first comment on this video. The loading indicator just spins forever. I would not consider this blocking as the comments on which there are so many replies are not so many, but it would be nice if you could fix this, too, before merging. ;-)

app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
Comment on lines +15 to +22
<ImageButton
android:id="@+id/backButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_horizontal_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/back"
android:src="@drawable/ic_arrow_back" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just use android:navigationIcon and android:navigationContentDescription instead of adding a button manually

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can not use your way to do that, it will show nothing at here.
There is another way can do that, but it's even more complex.
图片

app/src/main/res/layout/list_comments_mini_item.xml Outdated Show resolved Hide resolved
app/src/main/res/layout/list_comments_item.xml Outdated Show resolved Hide resolved
Comment on lines +121 to +122
// clone comment object to avoid relatedItems and nextPage actually set null
info = CommentUtils.clone(info);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmh, I don't like this that much. Can you explain further why you need to clone the object is a way that is so low-level?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you check CommentReplyFragment, you will know.
Because I need create a fake CommentsInfo for the CommentFragment, then I can simply put two CommentFragment together.

itemContentReplyButton.setOnClickListener(
view -> itemBuilder.getOnCommentsReplyListener().selected(item)
);
final int replyCount = item.getReplyCount();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you setVisibility(View.GONE) when the reply count is 0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no reply, item.getReplies() will return null, so not need to set at here.

Comment on lines +24 to +38
<org.schabi.newpipe.views.NewPipeTextView
android:id="@+id/itemTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/backButton"
android:layout_marginTop="@dimen/activity_horizontal_margin"
android:layout_toEndOf="@+id/backButton"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="@string/replies"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/channel_item_detail_title_text_size" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you also can do this with just android:title. Also, maybe instead of just showing "Replies" as title, it would be nice if it also contained the number, e.g. "12 replies".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you can't, as #9410 (comment) say

this.url = u;
this.name = !TextUtils.isEmpty(title) ? title : "";
// clone comment object to avoid replies actually set null
this.comment = CommentUtils.clone(preComment);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here

@xz-dev
Copy link
Author

xz-dev commented Nov 28, 2022

NewPipe player with this branch has got issues on my phone.

Do you have any log or give me a screen recording to help me understand what happening?

@nicoursi
Copy link

nicoursi commented Dec 1, 2022

NewPipe player with this branch has got issues on my phone.

Do you have any log or give me a screen recording to help me understand what happening?

CreenRecord: https://ufile.io/pwdj823r

When it crashes like this it does it with every video. The only way to fix it is to play a video in foreground. After that i can play in background by longpressing again.

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: IT
  • Content Language: it-IT
  • App Language: it_IT
  • Service: none
  • Version: 0.24.1
  • OS: Linux Android 11 - 30
Crash log

java.lang.IllegalArgumentException: No view found for id 0x7f0a0199 (org.schabi.newpipe.debug.featcommentreply:id/fragment_container_view) for fragment CommentsFragment{e387d90} (c9dfad59-1f04-42a0-9a9d-ec848df9704e id=0x7f0a0199)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:513)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1840)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1758)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1701)
	at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:488)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7669)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)


@nicoursi
Copy link

nicoursi commented Dec 3, 2022

This screenrecord shows problems while rotating the screen: https://ufile.io/8dfzxp2m

@nicoursi
Copy link

nicoursi commented Dec 3, 2022

Another crash with rotation:

Screen record: https://ufile.io/aj35l7bb

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: IT
  • Content Language: it-IT
  • App Language: it_IT
  • Service: none
  • Version: 0.24.1
  • OS: Linux Android 11 - 30
Crash log

java.lang.IllegalArgumentException: No view found for id 0x7f0a0199 (org.schabi.newpipe.debug.featcommentreply:id/fragment_container_view) for fragment CommentsFragment{e2fe4bf} (85ea65be-5665-490a-a362-335938b9e29f id=0x7f0a0199)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:513)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1840)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1758)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1701)
	at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:488)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7669)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)


@TobiGr
Copy link
Member

TobiGr commented Dec 4, 2022

I got the following glitch while working on the SoundCloud replies:

bug.webm

I have no idea how i created it. I just opened the stream from the history and scrolled up and down a few times.

Co-authored-by: Stypox <stypox@pm.me>
@sonarcloud
Copy link

sonarcloud bot commented Dec 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Dragonfly-30
Copy link

Is this still being worked on?

@xz-dev
Copy link
Author

xz-dev commented Mar 1, 2023

Is this still being worked on?

I've been busy doing other things lately, I'll probably see later if there's anything else I can do.
If you're able to continue this work, I'd be glad someone could take over and finish it

@Stypox
Copy link
Member

Stypox commented Mar 1, 2023

Yes, this will be merged in 0.26.0, don't worry and stop asking

@DUOLabs333 DUOLabs333 mentioned this pull request Apr 9, 2023
5 tasks
@tsiflimagas
Copy link
Contributor

I've experienced the same crash reported in #9410 (comment) frequently lately, so I wanted to add that to reproduce it you have to be on description tab and rotate the video. I'm able to reproduce it reliably like that.

@Stypox
Copy link
Member

Stypox commented Apr 11, 2023

Closing in favour of #10018, since it is a simpler implementation and should also have less bugs. Thank you nonetheless for your work!

@Stypox Stypox closed this Apr 11, 2023
@MD77MD MD77MD mentioned this pull request Apr 19, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display comment replies
9 participants