Skip to content

Commit

Permalink
Fix incremental mount for LithoViews with children with Transient State
Browse files Browse the repository at this point in the history
Summary:
LithoView is a ViewGroup. ViewGroups have transient state if they directly have transient state or if any of their children have transient state. This applies the same incremental mount fix to children updating transient state as the LithoView directly updating transient state.

Note: I think this fix kinda sucks, because it means we mount the whole thing immediately if any child in the hierarchy has transient state at any point. We should try to figure out something nicer. This is a decent fix for now.

Reviewed By: pasqualeanatriello

Differential Revision: D5139234

fbshipit-source-id: 5d1f399607176bb90ed96e916ebe9b8015b0e075
  • Loading branch information
jsendros authored and facebook-github-bot committed May 26, 2017
1 parent ea6f72c commit fb6e566
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions litho-core/src/main/java/com/facebook/litho/LithoView.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,15 @@ public void setHasTransientState(boolean hasTransientState) {
super.setHasTransientState(hasTransientState);
}

@Override
public void childHasTransientStateChanged(View child, boolean childHasTransientState) {
if (isIncrementalMountEnabled()) {
performIncrementalMount(null);
}

super.childHasTransientStateChanged(child, childHasTransientState);
}

@Override
public void offsetTopAndBottom(int offset) {
super.offsetTopAndBottom(offset);
Expand Down

0 comments on commit fb6e566

Please sign in to comment.