Skip to content

Support set picture fill max screen width, and support set call back when click picture #113

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

Closed
wants to merge 2 commits into from

Conversation

equationl
Copy link
Contributor

From #108 #73 .

Add imgFillMaxWidth: Boolean to MarkdownParseOptions, which can make img fill parent's layout max width.

And add onImgClicked: ((String) -> Unit)? = null to RichTextScope.Markdown, which support call onImgClicked(url) when picture in MarkDown be clicked.

@equationl
Copy link
Contributor Author

This is set imgFillMaxWidth = true:

s1

And this is false:
s2

About click img:

              Markdown(
                content = sampleMarkdown,
                markdownParseOptions = markdownParseOptions,
                onLinkClicked = {
                  Toast.makeText(context, it, Toast.LENGTH_SHORT).show()
                },
                onImgClicked = {
                  Toast.makeText(context, it, Toast.LENGTH_SHORT).show()
                }
              )

s3

@equationl
Copy link
Contributor Author

@halilozercan Hello, please check this PR, thanks

@equationl
Copy link
Contributor Author

#114 better than this

@equationl equationl closed this Jun 14, 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.

1 participant