VectorifyDaHome icon indicating copy to clipboard operation
VectorifyDaHome copied to clipboard

fix display cutout / notch support

Open wangcheng opened this issue 3 years ago • 0 comments

currently the support for notch is broken. mainly because we didn't reassign layoutParams to the view so the new params won't apply.

to solved this. I rewritten the logic and improve the notch handling.

  • fixed the bug that layoutParams is not reassigned
  • toolbar's background is expanded under the notch area.
  • always set seekbarCard width to 50% (no matter the OS version) to make room for moveBtnContainer
  • handles display cutout from every direction
  • changed some layout attributes
    • removed seekbarCard vertical margin in landscape mode because we are setting its width 50% anyway.
    • added a marginBottom to seekbarCard.
    • changed moveBtnContainer marginEnd to marginRight because we are setting marginRight in the code and marginRight and marginEnd cannot be set at the same time. I also ignored the RtlHardcoded warning because this won't really break RTL support.

test screenshots:

I test some scenarios with notch emulation in the developers options menu.

notch on the top and bottom

notch in the corner:

wangcheng avatar Aug 09 '22 20:08 wangcheng