Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove isLaidOut check from copyBoundsInWindow method #275

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Nov 16, 2023

馃摐 Description

Removed isLaidOut check from copyBoundsInWindow method.

馃挕 Motivation and Context

When we are using native-stack then on initial mount the view property isLaidOut will be true. When we open a new screen and return back to the previous isLaidOut will be false.

I've tried to call invalidate/requestLayout/forceLayout methods in onAttachedToWindow method, but it doesn't seem to have any effect at all.

Then I decided to compare how copyBoundsInWindow works if isLaidOut check is removed. And turned out there is no difference between two executions:

Screen opened first time (isLaidOut check present) Returned to the screen (isLaidOut is missing to go to if-statement)
Screenshot 2023-11-16 at 17 31 24 Screenshot 2023-11-16 at 17 52 55

So taking this information into consideration I've decided to remove that check.

Also for the sake of safety and avoidance of unexpected crashes I decided to remove throw Exception construction and replace it with a simple logger (since I'm not handling exceptions in my code it's better to log it).

Closes #274 #203

馃摙 Changelog

Android

  • removed isLaidOut check from copyBoundsInWindow method;
  • replaced throwing error to logger.

馃 How Has This Been Tested?

Tested on Pixel 7 Pro (android 14).

馃摳 Screenshots (if appropriate):

telegram-cloud-document-2-5381959313151507275.mp4

馃摑 Checklist

  • CI successfully passed

@kirillzyusko kirillzyusko added 馃悰 bug Something isn't working 馃 android Android specific 馃憜 interactive keyboard Anything related to interactive keyboard dismissing 馃幆 crash Library triggers a crash of the app labels Nov 16, 2023
@kirillzyusko kirillzyusko self-assigned this Nov 16, 2023
Copy link
Contributor

馃搳 Package size report

Current size Target Size Difference
79940 bytes 79970 bytes -30 bytes 馃搲

@kirillzyusko kirillzyusko marked this pull request as ready for review November 16, 2023 16:57
@kirillzyusko kirillzyusko merged commit 7bff243 into main Nov 16, 2023
11 checks passed
@kirillzyusko kirillzyusko deleted the fix/274-keyboard-gesture-area-and-native-stack branch November 16, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃 android Android specific 馃悰 bug Something isn't working 馃幆 crash Library triggers a crash of the app 馃憜 interactive keyboard Anything related to interactive keyboard dismissing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyboardGestureArea + nested native-stack causes a crash
1 participant