subsampling-scale-image-view
subsampling-scale-image-view copied to clipboard
Immerisve Mode Causes Image Resize but Only When Enabled
I'm developing an app that uses immersive mode to show an image in full screen. When immersive mode is enabled the SubsamplingScaleImageView bounds increase because the Activity layout increases and the image resizes to fill the new space. When immersive mode is disabled, the image does not resize back again (note: I'm not using the flags SYSTEM_UI_FLAG_LAYOUT_STABLE or SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION so the layout is not hiding under the action bar).
I have spent a while trying to juggle the options in a subclass but it's not easy to create a one-stop solution that works in all cases such as rotating the screen, the image already being zoomed when immersive is enabled etc.
Is there a way I prevent the image being resized in the first place? or Can we get a fix to resize when the layout changes to a smaller size?
Expected (Desired) behaviour
a) When the view's layout size changes, the image scale remains the same when a flag is set. b) When the view's layout size changes, the image scale changes, for both increases and decreases.
Actual behaviour
Image resizes when the view's size increases but not when it decreases.
Steps to reproduce
Using the immersive mode from the linked training page but replace the two flags above with supportActionBar?.hide() / .show()
Affected devices
Tested on:
- Lenovo TB-X704F (API 25)
- Smasung Galaxy S7 Edge (API 26)
@LeoSnek Were you able to solve this issue?
@LeoSnek , having the exact same issue. Did you solve it and can tell us how?