Skip to content

Convert newpipe/util/text/TimestampLongPressClickableSpan.java to kotlin#12951

Closed
ghost wants to merge 1 commit intorefactorfrom
unknown repository
Closed

Convert newpipe/util/text/TimestampLongPressClickableSpan.java to kotlin#12951
ghost wants to merge 1 commit intorefactorfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Dec 26, 2025

What is it?

  • Bugfix (user facing)
  • Feature (user facing) ⚠️ Your PR must target the refactor branch
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Converted newpipe/util/text/TimestampLongPressClickableSpan.java to kotlin
  • Also converted one class used by it into java record

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. You can find more info and a video demonstration on this wiki page.

Due diligence

Also convert one class used by it into java record
@github-actions github-actions Bot added the size/medium PRs with less than 250 changed lines label Dec 26, 2025
Comment on lines +43 to +56
when (relatedInfoService) {
ServiceList.YouTube ->
return relatedStreamUrl + "&t=" + timestampMatchDTO.seconds()
ServiceList.SoundCloud, ServiceList.MediaCCC ->
return relatedStreamUrl + "#t=" + timestampMatchDTO.seconds()
ServiceList.PeerTube ->
return relatedStreamUrl + "?start=" + timestampMatchDTO.seconds()
}

// Return timestamp text for other services
return descriptionText.subSequence(
timestampMatchDTO.timestampStart(),
timestampMatchDTO.timestampEnd()
).toString()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be possible to concat string and also lift the return statement out of the when block with an else logic.

Copy link
Copy Markdown
Author

@ghost ghost Dec 28, 2025

Choose a reason for hiding this comment

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

I am dumb. Could you explain (about else)? And thanks for reviews

Comment on lines +21 to +22
context, relatedStreamUrl, relatedInfoService,
timestampMatchDTO.seconds()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please put all on single line or separate if its over 100 char.

@ghost ghost closed this Dec 31, 2025
@ghost ghost deleted the kotlin_refactor6 branch January 7, 2026 18:52
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/medium PRs with less than 250 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant