jeziellago / compose-markdown

Markdown Text for Android Jetpack Compose 📋.
MIT License
508 stars 42 forks source link

How to tweak rendered pictures? #18

Open dessalines opened 2 years ago

dessalines commented 2 years ago

Is there a way to set the min / max height of rendered pictures? Almost all mine end of getting rendered very tiny.

dessalines commented 2 years ago

Any updates? People using my app are starting to complain about tiny picture sizes.

jeziellago commented 1 year ago

You can create a custom ImageLoader to be used inside MarkdownText. https://github.com/jeziellago/compose-markdown/blob/d0a4c4eb6fcfc87611b9f8cda598d0f581387f40/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt#L47

dessalines commented 1 year ago

Thanks! I'll try this out once you get #25 working again.

dessalines commented 1 year ago

A custom coil image loader doesn't seem to have the options I need... specifically I need two things.

The ability to scale a picture, I'd like it to fill my item width. This is done in coil like:

AsyncImage(
  model = ...
  contentScale = ContentScale.FillWidth,

I'd also like the ability to get a callback when the image is clicked, so I can do an action with it (such as loading the URI in an external browser)

jeziellago commented 1 year ago

There is a simple way to get this result with HTML:

<a href="http://github.com">
    <img src="https://octodex.github.com/images/minion.png" width="100%">
</a>

dessalines commented 1 year ago

My users are just doing proper markdown images, ie ![imglink](url) .

ajfpay commented 8 months ago

Can user like pinch to zoom image?