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): performance issue with deeply nested views as of 7.5.0 #11253
Conversation
|
if (insets.equals(this.previousInsets)) { | ||
return insets; | ||
} | ||
this.previousInsets = insets; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also need an Android api level guard? Would accessing it on api level < 20 cause a crash or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need a guard inside the onApplyWindowInsets()
method since it has argument type WindowInsets
which is API Level 20 only. Attempting to call onApplyWindowInsets()
on a lower API level would crash, meaning that the API Level guard needs to be done on the caller's side.
But good question. Thanks for asking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, I'll do a quick experiment with Google's @RequireApi(ApiLevel)
Java annotation. Android Studio's built-in linting tool is supposed to trigger compiler errors/warnings when making unguarded calls to methods like this. When we switch over to gradle, this may help reduce crashes on older OS versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote up a ticket TIMOB-27437 to implement the @RequireApi()
annotations in the future. We can't leverage it until we support the gradle linting tool and add the Google Support Annotation library.
FR Passed. Studio Ver: 5.1.4.201909061933 |
JIRA:
https://jira.appcelerator.org/browse/TIMOB-27434
Summary:
Performance Test:
TextField
.Inset Test:
This verifies that insets are still correctly propagated to child views.