Display full image when adding image description
Fixes #139
- Don't use
ComposeMediaLayoutas it's also used when attaching images to posts – always displaying them cropped, rendering it unusable for composing image descriptions - Use
MaxWidthFrameLayoutinstead to have the image obey the 400dp max width
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.
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).
In my testing,
adjustViewBoundsdidn'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!
Material3 redesign makes this irrelevant because it allows you to open the image in the image viewer on that screen.