Skip to content

refactor: simplify LinkShareViewHolder.setSubline()#16463

Draft
joshtrichards wants to merge 7 commits into
masterfrom
jtr/refactor-downloadLimit
Draft

refactor: simplify LinkShareViewHolder.setSubline()#16463
joshtrichards wants to merge 7 commits into
masterfrom
jtr/refactor-downloadLimit

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Feb 7, 2026

Copy link
Copy Markdown
Member

Changes:

  • fix: Replace toInt() with NumberFormat.parse() to handle locale-specific grouping separators (e.g., "1,000" or "1.000"). Add validation for empty and negative inputs with inline error messages.
  • refactor: use NumberFormat consistently
  • refactor: remove redundant null check (already handled by remainingDownloadLimit())
  • refactor: miscellaneous code tidying
  • docs: miscellaneous additions/clarifications/tidying

Also addresses CI/CD detekt output:

/home/runner/actions-runner/_work/android/android/app/src/main/java/com/owncloud/android/ui/adapter/LinkShareViewHolder.kt - 10min debt
	ReturnCount - [Function setSubline has 3 return statements which exceeds the limit of 2.] at /home/runner/actions-runner/_work/android/android/app/src/main/java/com/owncloud/android/ui/adapter/LinkShareViewHolder.kt:101:17

No functional changes - simplifies logic while maintaining identical behavior.

  • Tests written, or not not needed

Changes:
- Remove redundant fileDownloadLimit null check (already handled by
  remainingDownloadLimit() extension function)
- Remove unnecessary intermediate variable
- Add KDoc documenting the method's behavior

No functional changes - simplifies logic while maintaining identical
behavior.

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
And also guard against <0 while permitting 0

Signed-off-by: Josh <josh.t.richards@gmail.com>
Replace toInt() with NumberFormat.parse() to handle locale-specific
grouping separators (e.g., "1,000" or "1.000"). Add validation for
empty and negative inputs with inline error messages.

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown

test-Unit test failed, but no output was generated. Maybe a preliminary stage failed.

@alperozturk96

Copy link
Copy Markdown
Collaborator

Hi! Thanks for your contribution.

This PR has been in draft for some time, so we'd like to check whether you're still planning to work on it.

If the PR is still valid and you intend to continue, please mark it as Ready for Review (remove the draft status) and add the review label. We'll then be happy to take a look.

If you no longer plan to continue with this PR, please let us know so we can keep the backlog up to date.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants