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

Resolve issue with non-clickable links #4917

Closed

Conversation

shakivhussain
Copy link

@shakivhussain shakivhussain commented Mar 23, 2023

Explanation

  • "Fixes In Terms of Service the website should be displayed as link and should be clickable #4760 :"
  • I define two functions, makeAutoLinks and getUrls, for making links clickable in a TextView.
  • The makeAutoLinks function takes a list of links as input and applies ClickableSpan to each link in the text of the TextView. When the user clicks on a link, it opens the link in a browser.
  • The getUrls function takes a string input and returns a list of URLs in that string.
  • Overall, these functions work together to provide a convenient way to make links clickable in a TextView.

Essential Checklist

Output

Record_2023-03-23-07-38-45.mp4

@BenHenning BenHenning self-assigned this Mar 24, 2023
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

I left one comment, but @shakivhussain #4760 is currently assigned to @Uticodes and is being worked on in #4918. Closing this since it's already being worked on.

@@ -64,6 +66,8 @@ class PoliciesFragmentPresenter @Inject constructor(
supportsLinks = true,
supportsConceptCards = false
)
binding.policyDescriptionTextView.makeAutoLinks(policyDescription.getUrls())
Copy link
Member

Choose a reason for hiding this comment

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

Why doesn't LinkifyCompat work for this? It's not clear to me why the custom extension functions are needed here.

Copy link
Author

Choose a reason for hiding this comment

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

@BenHenning
After getting all the URLs from the text I highlight them one by one. If we need to add more then one URL's in the code will work fine.

LinkifyCompat not working here I don't know why.

@BenHenning BenHenning closed this Mar 30, 2023
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.

In Terms of Service the website should be displayed as link and should be clickable
2 participants