mastodon-android icon indicating copy to clipboard operation
mastodon-android copied to clipboard

Display full image when adding image description

Open sk22 opened this issue 3 years ago • 3 comments

Fixes #139

  • Don't use ComposeMediaLayout as it's also used when attaching images to posts – always displaying them cropped, rendering it unusable for composing image descriptions
  • Use MaxWidthFrameLayout instead to have the image obey the 400dp max width

sk22 avatar May 21 '22 15:05 sk22

adjustViewBounds feels like a bad idea because it would make the layout jump when the image is loaded. I usually set the size to known dimensions at runtime.

grishka avatar May 21 '22 15:05 grishka

Hm - since you used the ComposeMediaLayout before for this, I thought about adding some boolean parameter for whether to crop the image or not, but I didn't know how to properly do that, and I didn't want to duplicate the ComposeMediaLayout for this purpose alone either. In my testing, adjustViewBounds didn't cause the layout to jump (not sure if there's even a case where the image isn't fully loaded when the image description editor is opened?), but I'm gonna believe you (I don't have much experience with Android development).

sk22 avatar May 21 '22 15:05 sk22

In my testing, adjustViewBounds didn't cause the layout to jump

More testing (daily usage) and yes, it does jump, but I'd rather have it jump than not being fully displayed at all. If you have any other idea on how to improve this, feel free to let me know!

sk22 avatar May 31 '22 15:05 sk22

Material3 redesign makes this irrelevant because it allows you to open the image in the image viewer on that screen.

grishka avatar May 25 '23 18:05 grishka