HomePhabricator
Diffusion Comm 79cc9a34d6f7

[native] calculate snap points for keyserver selection bottomsheet

Description

[native] calculate snap points for keyserver selection bottomsheet

Summary:
In order to correctly get our bottomsheet to snap up to the correct height we need to measure the container of the content. When I was working on user profiles, I introduced a bottomsheet context that exposed a setState for the bottomsheet height. We can reuse that here.

One thing that I considered in my solution was that the height of the remove keyserver text content might slightly vary on different devices due to how many times the text will wrap since different phones could have different screen sizes. To overcome this, I introduced a onLayout callback that would measure the remove keyserver section of the bottomsheet and then use that height to calculate the height of the overall bottomsheet and pass that into the bottomsheet context.

Linear task: https://linear.app/comm/issue/ENG-5473/calculate-the-snap-point-based-on-the-content-height-of-the

Depends on D9794

Test Plan:
Please see the demo video below

Reviewers: inka, rohan, michal

Reviewed By: inka

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9795

Details

Provenance
ginsuAuthored on Nov 14 2023, 5:17 PM
Reviewer
inka
Differential Revision
D9795: [native] calculate snap points for keyserver selection bottomsheet
Parents
rCOMMbda34094c90b: [native] update remove keyserver text based on connection status
Branches
Unknown
Tags
Unknown