Android YogaLayout invalidate(View view) problem #669

Closed
opened 2017-11-20 08:49:29 -08:00 by AndrewYangmq · 1 comment
AndrewYangmq commented 2017-11-20 08:49:29 -08:00 (Migrated from github.com)

Report

Android YogaLayout invalidate(View view) will cause App frozen problem in some scenario.

Issues and Steps to Reproduce

I just got a App frozen scenario when I refreshed some content when I clicked an menu. The error I got in the logcat is:
“Only leaf nodes with custom measure functions should manually mark themselves as dirty”
This is because the current implementation in YogaLayout class invalidate(View view) method did not check if yogaNode has Measure defined.

Expected Behavior

The app should not be frozen.

Actual Behavior

The app is frozen and I got app no response message.

Link to Code

The source cause of this problem is in the public void invalidate(View view) method:
I just add 1 lines code to check if yogaNode has custom measure defined before marking its dirty and problem solved.
if (mYogaNodes.containsKey(view)) {
YogaNode yogaNode = mYogaNodes.get(view);
if (yogaNode.isMeasureDefined()) {
mYogaNodes.get(view).dirty();
}
return;
}

# Report Android YogaLayout invalidate(View view) will cause App frozen problem in some scenario. - [ X] I have searched [existing issues](https://github.com/facebook/yoga/issues) and this is not a duplicate # Issues and Steps to Reproduce I just got a App frozen scenario when I refreshed some content when I clicked an menu. The error I got in the logcat is: “Only leaf nodes with custom measure functions should manually mark themselves as dirty” This is because the current implementation in YogaLayout class invalidate(View view) method did not check if yogaNode has Measure defined. # Expected Behavior The app should not be frozen. # Actual Behavior The app is frozen and I got app no response message. # Link to Code The source cause of this problem is in the public void invalidate(View view) method: I just add 1 lines code to check if yogaNode has custom measure defined before marking its dirty and problem solved. if (mYogaNodes.containsKey(view)) { YogaNode yogaNode = mYogaNodes.get(view); if (yogaNode.isMeasureDefined()) { mYogaNodes.get(view).dirty(); } return; }
NickGerleman commented 2023-04-25 20:43:54 -07:00 (Migrated from github.com)

We're deprecating the com.facebook.yoga.android.YogaLayout ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.

We're deprecating the `com.facebook.yoga.android.YogaLayout` ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#669
No description provided.