Page MenuHomePhabricator

[native] Add SafeAreaView to CameraModal, ImageModal and VideoPlaybackModal
ClosedPublic

Authored by kuba on Feb 14 2023, 12:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 9:51 PM
Unknown Object (File)
Mon, Oct 28, 9:51 PM
Unknown Object (File)
Mon, Oct 28, 9:51 PM
Unknown Object (File)
Mon, Oct 28, 9:51 PM
Unknown Object (File)
Mon, Oct 28, 9:51 PM
Unknown Object (File)
Mon, Oct 28, 9:51 PM
Unknown Object (File)
Mon, Oct 28, 9:49 PM
Unknown Object (File)
Oct 13 2024, 9:24 PM
Subscribers

Details

Summary

Issue: ENG-2476

Android: In some modals app buttons are rendered outside SaveArea and covered by the system GUI, especially in landscape mode.

Images:

Screenshot_20230214-111147.png (1×2 px, 2 MB)

Screenshot_20230214-111200.png (1×2 px, 972 KB)

Test Plan

Tested new view on Android and iOS modals:

  • CameraModal (including staging view),
  • VideoPlaybackModal,
  • ImageModal.

Images:

Screenshot_20230214-110640.png (1×2 px, 1 MB)

Screenshot_20230214-110632.png (1×2 px, 1 MB)

Screenshot_20230214-110710.png (1×2 px, 990 KB)

Diff Detail

Repository
rCOMM Comm
Branch
kuba/android-safearea
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kuba edited the test plan for this revision. (Show Details)
kuba added reviewers: inka, michal.
Harbormaster returned this revision to the author for changes because remote builds failed.Feb 14 2023, 1:07 AM
Harbormaster failed remote builds in B16473: Diff 22520!
kuba edited the test plan for this revision. (Show Details)
kuba edited the test plan for this revision. (Show Details)

Fixed imports

native/media/camera-modal.react.js
619

Is this View necessary? Since it has the same style as the parent, that is just flex: 1, it seems like it doesn't do much? I tried without it (on android), and it seemed to work

kuba added inline comments.
native/media/camera-modal.react.js
619

I believe that it is. If you remove this View and rotate the phone to landscape mode you end up with X going outside the SaveAreaView.
I added styles to see it clearly:

  • SafeAreaView: backgroundColor: '#FF000040' (red)
  • View: backgroundColor: '#00FF0040' (green)

Attaching screens:
Without inner View:

Screenshot_20230215-113106.png (1×2 px, 1 MB)

With inner View:

Screenshot_20230215-113116.png (1×2 px, 1 MB)

tomek added inline comments.
native/media/camera-modal.react.js
619

It's surprising that we need it. I guess it might be related to the fact that the buttons are absolutely positioned.

647

Do we have to provide both flex: 1 and stagingViewOverlay styles? Is flex: 1 really useful? It works in one direction, so the behavior might be different when a phone is rotated.

This revision is now accepted and ready to land.Feb 16 2023, 2:09 AM
native/media/camera-modal.react.js
619

Okay, thank you for the screenshots.

kuba marked 2 inline comments as done.

Removed flex: 1 from staging view overlay

kuba added inline comments.
native/media/camera-modal.react.js
647

I checked it and you are right. Everything works correctly without flex: 1 style. I removed it and updated the diff.

Removed flex: 1 from camera-modal