[native] Fix NUX Android problem
Summary:
issue: ENG-9472
On some Androids, we cannot measure a button that is not visible on the screen. undefineds are returned. So we have to wait of the login screen to be dismissed, before we call measure.
I wanted to pass the measure function itseft through conxtext, but that results in Cannot read property '_nativeTag' of undefined error. Not sure what that means, but I don't think passing the ref is much worse.
measure asynchronously measures the component and then calls the callback. This is by I need states and an effect, instead of a memo.
buttonMeasured flag ensures the tip doesn't jump after the measure is done. measure returns quickly and I don't think this slight delay is a problem.
Test Plan:
Tested on Android 11 physical device, and iOS 17.4 simulator. Tesdted by updating NUXHandlerInner to run the effect on every app reaload.
Checked that on both Android and iOS the NUX tips are displayed in the correct position. Checked thare are no odd visual effects, like jumping (thanks to buttonMeasured)
Reviewers: tomek, kamil
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13697