Don't allow rotation on larger devices when drawing#7132
Merged
grzesiek2010 merged 3 commits intogetodk:v2026.1.xfrom Mar 15, 2026
Merged
Don't allow rotation on larger devices when drawing#7132grzesiek2010 merged 3 commits intogetodk:v2026.1.xfrom
grzesiek2010 merged 3 commits intogetodk:v2026.1.xfrom
Conversation
Member
Author
|
@dbemke good catch! That's fixed. |
|
Tested with Success! Verified on device with Android 10 Verified cases:
|
Member
Author
|
@dbemke just to check: you weren't able to check this on tablets right? |
No. We don't have a tablet. |
|
Tested with success Verified on Android 16 |
Member
Author
|
@grzesiek2010 given QA don't have a tablet to test on, could have a play with this on an emulator (or a physical tablet if you have one) using a couple of different Android versions? I've already done that, but it'd be good to make sure it's been checked by more than one person. |
Member
|
Yes I have a tablet so I test it. |
grzesiek2010
approved these changes
Mar 15, 2026
seadowg
pushed a commit
to seadowg/collect
that referenced
this pull request
Mar 19, 2026
Don't allow rotation on larger devices when drawing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #7124
Why is this the best possible solution? Were any other approaches considered?
On larger devices, even if the orientation is locked an Activity can still be resized when switching orientation as the device shows the locked screen letterboxd and still rotates it. This causes Activity recreation and leads to the drawing screen getting wiped when rotating. We can avoid this (for the current target Android version) by disabling resizing for the Activity (
android:resizeableActivity="false").That doesn't quite solve the problem for larger devices though: when switching from landscape to portrait orientation we still end up being resized even without recreation. The
DrawViewused did not have to deal with this on smaller devices/older Android versions so we also needed to disable resetting theCanvason every size change (rather than just the first render).Ideally the drawing screens should just handle resizing, but that's a new feature we'll need to discuss for either our Android 16 target version (or potentially Android 17 if opt-outs let us kick this can down the road). I'm not confident these fixes will work across the board as manufacturers are able to override a lot of the large screen behaviour here.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
On smaller devices, the app should behave exactly as before. On tablets, the drawing screens should no longer clear the user's work when rotating, but the image/canvas will not scale appropriately: whatever dimensions they first open in will be used regardless of orientation.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest