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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): fix infinite loop by calling setDecorFitsSystemWindows more strictly #36

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

NaterGator
Copy link
Contributor

This fixes #35 and I believe should fix #25 as well.

@NaterGator NaterGator mentioned this pull request Oct 19, 2024
@eptercom
Copy link

eptercom commented Oct 19, 2024

This works much better for me!
Except I had to add lines to reset the nonce vars when running disable, which allows you to enable and refresh it again when the app is closed and re-opened. I run SafeArea.enable and disable on the appStateChange event to maintain it edge-to-edge.

@NaterGator
Copy link
Contributor Author

Except I had to add lines to reset the nonce vars when running disable, which allows you to enable and refresh it again when the app is closed and re-opened. I run SafeArea.enable and disable on the appStateChange event to maintain it edge-to-edge.

Hmm... interesting. I don't see that behavior when the app is put in the background and reopened... I wonder if the fix is to implement handleOnPause in the plugin to reset the nonce. I don't see updateInsets called on my end after backgrounding and resuming the app. I'll add another change to reset the nonce when backgrounded, can you give it a try to see if it fixes your issue without requiring enable/disable? @eptercom

@eptercom
Copy link

Thanks @NaterGator that fixes my issue perfectly! I'm not sure why it was happening, but it's probably another plugin I'm using at the same time that might be interfering somehow, like @capacitor/status-bar

@tafelnl tafelnl changed the title Fix Android feedback loop calling onApplyWindowInsetsListener as fast as possible fix(android): fix infinite loop by calling setDecorFitsSystemWindows more strictly Oct 25, 2024
@tafelnl tafelnl merged commit 923bb73 into capacitor-community:master Oct 25, 2024
@NaterGator NaterGator deleted the android-fix branch October 25, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite android logs Plugin makes app unresponsive on Android
3 participants