SchildiChat / SchildiChat-android

Matrix client / Element Android fork
https://schildi.chat/android/
Apache License 2.0
386 stars 49 forks source link

Improve rendering of rich reply to images #172

Closed HarHarLinks closed 1 year ago

HarHarLinks commented 1 year ago

Is your feature request related to a problem? Please describe. image

  1. wide images are "cropped"
    • actually I think it always scales to height and flows over to the right
    • note the missing corner rounding on the right
  2. why can the rich reply take more horizontal space than the regular image message?

Describe the solution you'd like

Describe alternatives you've considered /

Additional context List of rich reply commits: https://github.com/vector-im/element-android/issues/3731#issuecomment-1330363453

(btw, what happens with videos?)

SpiritCroc commented 1 year ago

Proper image rendering on Android is annoying, when wanting to follow the images measures, while handling the case that the original event did not send correct measures. So I went the easy way with fixed height for now, correct. Maybe when I'm motivated I can at some point port the more sophisticated measuring logic I wrote for regular image rendering to replies. This smarter logic basically updates measures after loading the image, so it can be sure about proper measures. As an easier workaround, one could only handle the case where there are measures included in the event source, and where one assumes that these are correct (hint: in practice, they aren't always correct, sometimes width and height are exchanged. also many bridges do not send measures at all).

I think videos are handled just the same as images, but just using the thumbnail picture.

HarHarLinks commented 1 year ago

Just for reference: in the screenshot above, the events contain correct ImageInfo

HarHarLinks commented 1 year ago

after: image

:heart: