Skip to content

Commit

Permalink
remove duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuinden committed Feb 16, 2017
1 parent 0aa564b commit 24ccb80
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,12 @@ public void handleStateChange(StateChange stateChange, Callback completionCallba
Context newContext = stateChange.createContext(this, newKey);
View newView = LayoutInflater.from(newContext).inflate(newKey.layout(), root, false);

root.addView(newView);
backstackDelegate.restoreViewFromState(newView);

if(stateChange.getDirection() == StateChange.REPLACE) {
root.addView(newView);
backstackDelegate.restoreViewFromState(newView);
finishStateChange(previousView, newView, completionCallback);
} else {
root.addView(newView);
backstackDelegate.restoreViewFromState(newView);
ViewUtils.waitForMeasure(newView, (view, width, height) -> {
runAnimation(previousView, newView, stateChange.getDirection(), new AnimatorListenerAdapter() {
@Override
Expand Down

0 comments on commit 24ccb80

Please sign in to comment.