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

setOnLinkClickCallback does not appear to be working #61

Open
MikeSimpson opened this issue Feb 1, 2019 · 1 comment
Open

setOnLinkClickCallback does not appear to be working #61

MikeSimpson opened this issue Feb 1, 2019 · 1 comment

Comments

@MikeSimpson
Copy link

Links appear underlined and coloured correctly with the following snippet but the links are not clickable. Using text_view.setMovementMethod(LinkMovementMethod.getInstance()) works correctly but handling links in MarkdownConfiguration.Builder does not.

 MarkdownConfiguration.Builder(context)
                .setLinkFontColor(
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                        context.resources.getColor(R.color.colorPrimary, null)
                    } else {
                        context.resources.getColor(R.color.colorPrimary)
                    }
                ).setOnLinkClickCallback { view, link ->
                    Timber.d("Not reached")
                    context.startActivity(Intent(Intent.ACTION_VIEW).apply {
                        data = Uri.parse(link)
                    })
                }.build()
            text_view.text = MarkdownProcessor(context).apply {
                factory(TextFactory.create())
                config(markdownConfig)
            }.parse(content)
@nikartx
Copy link

nikartx commented Nov 24, 2020

Hi, I fixed this issue using textView.movementMethod = LinkMovementMethod.getInstance()

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

No branches or pull requests

2 participants